$totalcount ? $totalcount : $start + $limit); if ($displayend == $totalcount) { $nextset = 0; } else { $nextset = ($totalcount - $displayend > $limit ? $limit: ($totalcount - $displayend)); } $sort = check_input($_REQUEST['sort']); if ($sort == "") { $sort = "added"; } if ($search_query!="") { $query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath, i.added as add_dt, i.ip as ip, i.filesize as filesize, sum(ih.kb) as bandwidth, count( ih.filename ) as ctr from images i left outer join imagehits ih on i.filename = ih.filename where i.prv='0' and i.filename LIKE '%" . $search_query . "%' group by filename order by " . $sort . " desc limit " . $start . "," . $limit; } else { $query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath, i.added as add_dt, i.ip as ip, i.filesize as filesize, sum(ih.kb) as bandwidth, count( ih.filename ) as ctr from images i left outer join imagehits ih on i.filename = ih.filename where i.prv=0 group by filename order by " . $sort . " desc limit " . $start . "," . $limit; } $result = mysql_query($query) or die("Query failed."); $query_ti = "SELECT * from images where prv=0"; $result_ti = mysql_query($query_ti) or die("query_ti failed"); $totalimages = mysql_num_rows($result_ti); if ($totalcount>$totalimages) { $totallimit=$totalimages; } else { $totallimit=$totalcount; } if ($displayend>$totalimages) { $displaylimit=$totalimages; } else { $displaylimit=$displayend; } if ($search_query!="") { $totallimit=mysql_num_rows($result); if ($displaylimit>$totallimit){$displaylimit=$totallimit;} } ?>

Photo Gallery




Image name:
Images per page:     Sort by:     



Displaying images to of . 0) { ?>Previous Page - Next Page






Displaying images to of . 0) { ?>Previous Page - Next Page