KP - " . $cat . " - " . $scale . "" ?>

= now() - INTERVAL 1 " . $scale); $result = getVideos("views DESC",$start, 10,"WHERE timestamp >= now() - INTERVAL 1 " . $scale); } else if($cat == "Latest") { $result = getVideos("timestamp DESC",$start,10,"WHERE timestamp >= now() - INTERVAL 1 " . $scale); $resultCount = getVideos("timestamp DESC",null,null,"WHERE timestamp >= now() - INTERVAL 1 " . $scale); } else if($cat == "Top Rated") { $result = getVideos("rating DESC, no_ratings DESC",$start,10,"WHERE timestamp >= now() - INTERVAL 1 " . $scale); $resultCount = getVideos("rating DESC, no_ratings DESC",null,null,"WHERE timestamp >= now() - INTERVAL 1 " . $scale); } else { echo "ERROR"; exit(); } if(mysql_num_rows($result) ==0) { echo "

No Videos

"; } else { $limit = ceil(mysql_num_rows($resultCount) / 10); $pageString = ""; //print page 1 if($page > 1) { $pageString = "first"; $pageString .= " prev"; if($limit>1) { $pageString .= " 1"; } } else { $pageString = "first prev"; if($limit>1) { $pageString .= " 1 "; } } for($i =2; $i < $limit+1; $i++) { if($page == $i) { $pageString .= " " . $i . " "; } else { $pageString .= " ". $i . ""; } } if($page != $limit) { $pageString .= " next"; $pageString .= " last"; } else { $pageString.= " next last"; } echo $pageString; echo "
"; printVideos($result); echo $pageString; echo "
"; } footer(); ?>