include('include/config.php');
$ipp = 6;
include('scripts/php/functions.php');
$_table = "galphoto";
$navigator_query = mysql_query("SELECT COUNT(1) FROM ".$_table."_category WHERE active = 1", $conn) or die(mysql_error());
$tmp_var = mysql_fetch_array($navigator_query);
$navigator_recs = $tmp_var[0];
$nr_pages = ceil($navigator_recs/$ipp);
$query_recs = "SELECT * FROM ".$_table."_category WHERE active=1 ORDER BY `order` ASC, id_".$_table."_category DESC LIMIT $start,$ipp";
$recs = mysql_query($query_recs, $conn) or die(mysql_error());
$row_recs = mysql_fetch_assoc($recs);
$totalRows_recs = mysql_num_rows($recs);
$_page = "foto";
$_page_title = "Galerie foto";
#start output
include('include/meta.php');
?>
include('include/header.php');?>
if($totalRows_recs>0){?>
$i=1;
do{
$query_images = "SELECT * FROM ".$_table." WHERE active = 1 AND id_".$_table."_category = ".intval($row_recs['id_'.$_table.'_category'])." ORDER by `order` ASC, id_".$_table." DESC LIMIT 1";
$images = mysql_query($query_images, $conn) or die(mysql_error());
$row_images = mysql_fetch_assoc($images);
$totalRows_images = mysql_num_rows($images);
$row_recs['url'] = $_base.$_urls[$_page].generate_name($row_recs['title'])."-".$row_recs['id_'.$_table.'_category'];
$row_recs['img'] = $_base."uploads/".$_table."/thumb/".$row_images['image1'];
$navigator_query = mysql_query("SELECT COUNT(1) FROM ".$_table." WHERE active = 1 AND id_".$_table."_category = ".intval($row_recs['id_'.$_table.'_category']), $conn) or die(mysql_error());
$tmp_var = mysql_fetch_array($navigator_query);
?>
- class="last-right" }?>>
$i++;}while($row_recs = mysql_fetch_assoc($recs))?>
if($navigator_recs>$ipp){?>