В Избранном нет записей

[ форум ]

"; exit; } $res_pp=$HTTP_COOKIE_VARS["cfo_res_pp"]; if (!$res_pp) $res_pp=10; if ($rt&&is_numeric($rt)){ if ($r=mysql_fetch_object(mysql_query("SELECT fo_replyto, fo_id from $dbtable WHERE fo_id=".$rt))){ while ($r->fo_replyto!=0) $r = mysql_fetch_object(mysql_query("SELECT fo_replyto, fo_id from $dbtable WHERE fo_id=".$r->fo_replyto)); if ($r=mysql_fetch_object(mysql_query("SELECT Count(fo_id) as num from $dbtable WHERE fo_replyto=0 AND fo_id>=".$r->fo_id))) $pg = ceil($r->num/$res_pp); } } else $rt = ""; if (!$pg) $pg=1; $q=mysql_query("SELECT fo_id from $dbtable WHERE fo_replyto=0 and fo_id in ($cfo_memories)"); $total=mysql_num_rows($q); $pages=ceil($total/$res_pp); $start=$res_pp*($pg-1); $stop=$start+$res_pp; if ($stop > $total) $stop = $total; //navigation if ($pg<$pages) $next="[ следующие » ]"; else $next=": [ следующие » ]"; if ($pg>1) $back="[ « предыдущие ] :"; else $back=": [ « предыдущие ] :"; $nav="
$back: [ обновить ] :$next

Темы в «избранном»: ".($start+1)."-$stop из $total

[ вернуться ]

"; ####################### START OUTPUT ############## echo ""; ?>
"; echo ""; echo "\n"; $q=mysql_query("select fo_id, fo_subj, fo_name, date_format(fo_posted, '%Y.%m.%d %H:%i') as date, unix_timestamp(fo_posted) as udate from $dbtable where fo_replyto=0 and fo_id in ($cfo_memories) order by fo_posted desc LIMIT $start, $res_pp"); while($r=mysql_fetch_object($q)) { if ($r->udate > $last_visit) $isnew=""; else $isnew=""; echo "\n\n \n"; get_replys($r->fo_id, 1, $rt); } echo "

$isnew fo_id"; if ($r->fo_id == $rt) echo " name=".$rt.">$r->fo_subj ($r->fo_name, $r->date)"; else echo ">$r->fo_subj ($r->fo_name, $r->date)"; echo "

"; ################### FUNCTIONS ##################### function get_replys($m_id, $level=1, $rt){ global $dbtable, $last_visit; if ($level >=100) return; $space=str_repeat("  ", $level); $q=mysql_query("select fo_id, fo_subj, fo_name, date_format(fo_posted, '%Y.%m.%d %H:%i') as date, unix_timestamp(fo_posted) as udate from $dbtable where fo_replyto='$m_id' order by fo_posted desc"); while($r=mysql_fetch_object($q)){ if ($r->udate > $last_visit) $isnew=""; else $isnew=""; echo " \n $isnew $space fo_id"; if ($r->fo_id == $rt) echo " name=".$rt.">$r->fo_subj ($r->fo_name, $r->date)"; else echo ">$r->fo_subj ($r->fo_name, $r->date)"; echo "\n \n"; get_replys($r->fo_id, $level+1, $rt); } } ?>