From 9cb1fcba82027daa21eb457f1b2912ee02e5c7eb Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 14 Dec 2008 09:39:10 -0500 Subject: 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. --- includes/functions.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'includes/functions.php') 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')) } } +function displayRelated($title, $avoid = 0) +{ + $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"; + $getrelated2 = mysql_query($getrelated); + $i=0; + while ($getrelated3[$i] = mysql_fetch_array($getrelated2)) + { + if ($i==0) + { + $template = new FITemplate('related'); + } + + $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], + 'CODED' => $getrelated3[$i]['slug'], + 'AUTHOR' => $getrelated3[$i]['author'], + 'DATE' => date('F d<\S\U\P>S Y',strtotime($getrelated3[$i]['pubDate'])))); + $i++; + } + + if ($i > 0) + { + $template->display(); + } +} + ?> -- cgit 1.4.1