summary refs log tree commit diff stats
path: root/pages/blog.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/blog.php')
-rwxr-xr-xpages/blog.php49
1 files changed, 7 insertions, 42 deletions
diff --git a/pages/blog.php b/pages/blog.php index f99ad17..d55f9a4 100755 --- a/pages/blog.php +++ b/pages/blog.php
@@ -106,27 +106,7 @@ if (isset($_GET['post']))
106 $page_id = 'updates-' . $getpost3['id']; 106 $page_id = 'updates-' . $getpost3['id'];
107 include('includes/comments.php'); 107 include('includes/comments.php');
108 108
109 $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . addslashes($getpost3['title']) . "\") AS score FROM updates WHERE MATCH (title, text) AGAINST (\"" . addslashes($getpost3['title']) . "\") AND id <> " . $getpost3['id'] . " LIMIT 0,5"; 109 displayRelated($getpost3['title'], $getpost3['id']);
110 $getrelated2 = mysql_query($getrelated);
111 $i=0;
112 while ($getrelated3[$i] = mysql_fetch_array($getrelated2))
113 {
114 if ($i==0)
115 {
116 $template = new FITemplate('related');
117 }
118
119 $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'],
120 'CODED' => $getrelated3[$i]['slug'],
121 'AUTHOR' => $getrelated3[$i]['author'],
122 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate']))));
123 $i++;
124 }
125
126 if ($i > 0)
127 {
128 $template->display();
129 }
130 } else { 110 } else {
131 generateError('404'); 111 generateError('404');
132 } 112 }
@@ -135,6 +115,7 @@ if (isset($_GET['post']))
135 if (isset($_GET['author'])) 115 if (isset($_GET['author']))
136 { 116 {
137 $title = 'Author: ' . $_GET['author'] . ' - Blog Archive'; 117 $title = 'Author: ' . $_GET['author'] . ' - Blog Archive';
118 $template->add('HEADER', 'Posts by ' . $_GET['author']);
138 $getposts = "SELECT * FROM updates AS u WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC"; 119 $getposts = "SELECT * FROM updates AS u WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC";
139 $getbio = "SELECT * FROM bio WHERE username = \"" . $_GET['author'] . "\""; 120 $getbio = "SELECT * FROM bio WHERE username = \"" . $_GET['author'] . "\"";
140 $getbio2 = mysql_query($getbio); 121 $getbio2 = mysql_query($getbio);
@@ -148,9 +129,11 @@ if (isset($_GET['post']))
148 } elseif (isset($_GET['tag'])) 129 } elseif (isset($_GET['tag']))
149 { 130 {
150 $title = 'Tag: ' . $_GET['tag'] . ' - Blog Archive'; 131 $title = 'Tag: ' . $_GET['tag'] . ' - Blog Archive';
132 $template->add('HEADER', 'Posts tagged with ' . $_GET['tag']);
151 $getposts = "SELECT * FROM updates AS u, tags AS t WHERE u.id = t.post_id AND t.post_type = \"published\" AND t.tag = \"" . $_GET['tag'] . "\" ORDER BY u.id DESC"; 133 $getposts = "SELECT * FROM updates AS u, tags AS t WHERE u.id = t.post_id AND t.post_type = \"published\" AND t.tag = \"" . $_GET['tag'] . "\" ORDER BY u.id DESC";
152 } else { 134 } else {
153 $title = 'Blog Archive'; 135 $title = 'Blog Archive';
136 $template->add('HEADER', 'Blog Archive');
154 $getposts = "SELECT * FROM updates AS u ORDER BY id DESC"; 137 $getposts = "SELECT * FROM updates AS u ORDER BY id DESC";
155 } 138 }
156 $getposts2 = mysql_query($getposts); 139 $getposts2 = mysql_query($getposts);
@@ -166,10 +149,6 @@ if (isset($_GET['post']))
166 $curID++; 149 $curID++;
167 } 150 }
168 $template->add_ref($curID, 'MONTH', array('TITLE' => date('F Y',strtotime($getposts3[$i]['pubDate'])))); 151 $template->add_ref($curID, 'MONTH', array('TITLE' => date('F Y',strtotime($getposts3[$i]['pubDate']))));
169 if ($curID == 0)
170 {
171 $template->adds_ref_sub($curID, 'BIGEND',array('exi'=>1));
172 }
173 $lastmonth = date('m-Y',strtotime($getposts3[$i]['pubDate'])); 152 $lastmonth = date('m-Y',strtotime($getposts3[$i]['pubDate']));
174 } 153 }
175 154
@@ -195,23 +174,9 @@ if (isset($_GET['post']))
195 $comText = $total_post . ' Comments'; 174 $comText = $total_post . ' Comments';
196 } 175 }
197 176
198 if ($curID == 0) 177 $template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])),
199 { 178 'CODED' => $getposts3[$i]['slug'],
200 $template->adds_ref_sub($curID, 'BIG',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])), 179 'TITLE' => $getposts3[$i]['title']));
201 'CODED' => $getposts3[$i]['slug'],
202 'TITLE' => $getposts3[$i]['title'],
203 'ID' => $getposts3[$i]['id'],
204 'YEARID' => ((date('Y',strtotime($getposts3[$i]['pubDate']))-2006) % 4),
205 'MONTH' => date('M',strtotime($getposts3[$i]['pubDate'])),
206 'DAY' => date('d',strtotime($getposts3[$i]['pubDate'])),
207 'AUTHOR' => $getposts3[$i]['author'],
208 'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
209 'COMMENTS' => $comText));
210 } else {
211 $template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])),
212 'CODED' => $getposts3[$i]['slug'],
213 'TITLE' => $getposts3[$i]['title']));
214 }
215 $i++; 180 $i++;
216 } 181 }
217 if ($i==0) 182 if ($i==0)