Category Details
There are currently no photos for this category. Please check again later!
$page_access = 0; include ("ssi/authorize.php"); if(isset($_GET["cname"])) stripslashes($cname = $_GET["cname"]); else $cname="Gallery Photos"; // $problem=0; $sql = "SELECT * FROM category WHERE Name = '$cname' AND IsEnabled='Yes'"; //echo $sql; $pr = mysql_query($sql); if (mysql_num_rows($pr) != 1) //1 { $prob["notfound"] = true; } else { $res = mysql_fetch_array($pr); extract($res); $cname=$Title; $breadcrumb = "Home > ".$cname; $pagename = $cname; $pagemeta = $Meta; // How many adjacent pages should be shown on each side? $adjacents = 3; /* First get total number of rows in data table. If you have a WHERE clause in your query, make sure you mirror it here. */ $query = "SELECT COUNT(*) as num FROM photo WHERE CategoryID = $ID"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[num]; /* Setup vars for query. */ //$targetpage = "page.php?section=".$section."&page=".$page; //your file name (the name of this file) $targetpage = "Gallery--".$Name.".html?"; $limit = 30; //how many items to show per page $page_num = $_GET['page_num']; if($page_num) $start = ($page_num - 1) * $limit; //first item to display on this page else $start = 0; //if no page var is given, set start to 0 //Select Photos $sql = "SELECT * FROM photo WHERE CategoryID=$ID ORDER BY Name LIMIT $start, $limit"; //echo $sql; $photos = mysql_query($sql); /* Setup page vars for display. */ if ($page_num == 0) $page_num = 1; //if no page var is given, default to 1. $prev = $page_num - 1; //previous page is page - 1 $next = $page_num + 1; //next page is page + 1 $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up. $lpm1 = $lastpage - 1; //last page minus 1 /* Now we apply our rules and draw the pagination object. We're actually saving the code to a variable in case we want to draw it more than once. */ $pagination = ""; if($lastpage > 1) { $pagination .= "
There are currently no photos for this category. Please check again later!