function blog(){ global $rights; $req = mysql_query("SELECT COUNT(*) FROM `blog` WHERE `type` = 'ca' AND `mod` = '1'"); $totalcat = mysql_result($req, 0); $req = mysql_query("SELECT COUNT(*) FROM `blog` WHERE `type` = 'bl'"); $totalbl = mysql_result($req, 0); $req = mysql_query("SELECT COUNT(*) FROM `blog` WHERE `type` = 'ca' AND `mod` = '0'"); $totalmod = mysql_result($req, 0); $time = $realtime - 24 * 3600; $totalt = mysql_query("SELECT COUNT(*) FROM `blog` WHERE `type` = 'bl' AND `time` > '".$time."'"); $totaltime = mysql_result($totalt, 0); if($rights > 7){ return $totalcat.'+'.$totalmod.'мод / '.$totalbl; }else{ return $totalcat.' / '.$totalbl; } } ///код на главную echo '
';