Просмотр поста

.
cahpatih

seg0ro, like this on old forum

$naziv=strtolower($type1['text']);
$arr=explode(" ",$naziv);
$i=1;
$hcar=count($arr);
$simlq=" AND (text LIKE '%".$arr[0]."%' ";
if($hcar>0) {
foreach($arr as $kewr) {
if($i!=1) $simlq.=" OR text LIKE '%$kewr%' ";
$i++;
}
}
$simlq.=") ";
 $req = mysql_query("SELECT * FROM `forum` WHERE `type`='t' AND `id`!='$id' $simlq ORDER BY `time` DESC LIMIT 5");
 $total = mysql_num_rows($req);
 if($total!=0){
 echo '<div class="phdr">Similar Topics</div><div>';
 while ($res = mysql_fetch_assoc($req)) {
 echo '<div class="menu">' ;
echo '&nbsp;<a href="'.$home.'/forum/' . functions::converturl($res['text']) . '_'.$res['id'].'">' . $res['text'] . '</a>';
 echo '</div>';
 ++$i;}
 echo'</div>';
 }