query("SELECT * FROM galleries WHERE id = ".$_GET['gallery'].""); $rowt = $db->fetchObject($t); $title = " - Photos - ".$rowt->gallery; } have_header($title); have_navigation(); ?>

Photo Gallery (Methodically Modifying Your Morals.)

query("SELECT * FROM galleries ORDER BY order_id ASC"); $count = 0; $num = $db->getNumRows($gal); $rws = ceil($num/4); if($num == 0) { echo "

Sorry there are no galleries in the database yet

"; } else { while($row = $db->fetchObject($gal)) { $count++; $pic = $db->query("SELECT image, caption FROM photos WHERE gallery = ".$row->id." ORDER BY RAND() LIMIT 1"); $r = $db->fetchObject($pic); $caption = str_replace("\"", """, $r->caption); if($count == 1) { ?>

<? echo $caption; ?> gallery; ?>

"; echo "
"; if(ceil($num/4) != 1) { } else { $count = 0; } } } } ?>
query("SELECT photos.image, photos.id, photos.gallery FROM photos, galleries WHERE photos.gallery = galleries.id AND galleries.id = $gallery ORDER BY photos.order_id ASC LIMIT {$limitvalue}, {$limit}"); $total_results = mysql_result(mysql_query("SELECT COUNT(photos.id) as num FROM photos, galleries WHERE photos.gallery = galleries.id AND galleries.id = $gallery"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $limit); $res2 = $db->query("SELECT gallery FROM galleries WHERE id = $gallery"); $row2 = $db->fetchObject($res2); ?>

Photos(methodically modifying your morals.)

query("SELECT * FROM photos WHERE gallery = $gallery ORDER BY photos.order_id ASC LIMIT {$limitvalue}, {$limit}"); } else { $res3 = $db->query("SELECT * FROM photos WHERE id = $id ORDER BY order_id ASC"); } $r = $db->fetchObject($res3); $caption = str_replace("\"", """, $r->caption); $caption = str_replace("\r", "", $caption); $caption = str_replace("\n", "", $caption); $caption = str_ireplace("

", "

\r

", $caption); if($r->caption != "") { $dl2 = " - <a href="images/lightbox/download.php?file=$r->image">Download Image</a>"; } else { $dl2 = "<a href="images/lightbox/download.php?file=$r->image">Download Image</a>"; } ?> Photo Gallery Image caption != "") { ?>

caption); $caption = str_replace("\n", "", $caption); $caption = str_ireplace("

", "

\r

", $caption);*/ echo $caption; ?>

Back to Main

gallery; ?>

fetchObject($res)) { $count++; if($count == 1 && !$_GET['id']) { $current = $count; ?> <? echo $row->caption; ?> id) { $curr = " id=\"current_thumbb\""; $current = $count; } else { $curr = ""; } ?> ><? echo $row->caption; ?>
1) { include("pagination.php"); } ?>