diff options
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 | ?> |
