<?php
// ======================================================================== //
//   KOOBI - CMS                                                            //
//   SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS                     //
//                                                                          //
//   DREAM4 - AM MICHELSGRUND 7 - 69469 WEINHEIM - GERMANY                  //    
//   TEL. +49(0) 6201 - 980442 / FAX. +49(0) 6201 - 64809                   //
// ======================================================================== //
if(!is_numeric(UGROUP)) { 
	exit; 
	}
if((!is_mod($_REQUEST['toid'])) && (UGROUP != 1)) {$extra = " AND opened='1'";}
$sql = new dbc("SELECT * FROM " . PREFIX . "_f_post WHERE topic_id = '$_REQUEST[toid]' $extra  order by id DESC limit 5");
while($row = $sql->fetchrow())
{
	$row->user = fetchusername($row->uid);
	$row->message = ($row->use_bbcode == 1) ? kcodes($row->message) : nl2br($row->message);
	if ( ($row->use_smilies == 1) && (SMILIES==1) ) $row->message = dosmilies($row->message);
	$row->message = badwordreplace($row->message);
	array_push($items,$row);
}
?>