diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-12-14 09:39:10 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-12-14 09:39:10 -0500 |
commit | 9cb1fcba82027daa21eb457f1b2912ee02e5c7eb (patch) | |
tree | b9ad822ca0f186f42da00e1a2c882ede77d2ee14 /includes/functions.php | |
parent | f037e1d6baa069b324b7a0fd6eaffbdfb5c6f4dc (diff) | |
download | fourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.tar.gz fourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.tar.bz2 fourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.zip |
Major design and code overhaul
I don't know, a lot of stuffses happened that I don't quite remember anymore. Goodness, that's not good.
Diffstat (limited to 'includes/functions.php')
-rwxr-xr-x | includes/functions.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/includes/functions.php b/includes/functions.php index 7f85f96..1caef59 100755 --- a/includes/functions.php +++ b/includes/functions.php | |||
@@ -282,4 +282,29 @@ if (!function_exists('unique_id')) | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | function displayRelated($title, $avoid = 0) | ||
286 | { | ||
287 | $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . addslashes($title) . "\") AS score FROM updates WHERE MATCH (title, text) AGAINST (\"" . addslashes($title) . "\") AND id <> " . $avoid . " LIMIT 0,5"; | ||
288 | $getrelated2 = mysql_query($getrelated); | ||
289 | $i=0; | ||
290 | while ($getrelated3[$i] = mysql_fetch_array($getrelated2)) | ||
291 | { | ||
292 | if ($i==0) | ||
293 | { | ||
294 | $template = new FITemplate('related'); | ||
295 | } | ||
296 | |||
297 | $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], | ||
298 | 'CODED' => $getrelated3[$i]['slug'], | ||
299 | 'AUTHOR' => $getrelated3[$i]['author'], | ||
300 | 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate'])))); | ||
301 | $i++; | ||
302 | } | ||
303 | |||
304 | if ($i > 0) | ||
305 | { | ||
306 | $template->display(); | ||
307 | } | ||
308 | } | ||
309 | |||
285 | ?> | 310 | ?> |