<?
$total = mysql_result(mysql_query("select count(`id`) from `images` where `cat`='1' && `time`>'".(time()-84600*31)."'"

,0);
$top_q = mysql_query("select `id`,`cat`,`podcat`,`img`,`name`,`meta` from `images` where `cat`='1' && `time`>'".(time()-84600*31)."' order by `likes` desc limit $start, $in_page"

;
?>