ERROR: Your request contains an invalid path.
"; print "For security purposes, you can only access directories "; print "within this one.
"; print "Your dir path may not contain .. or : or start with a /
"; print "
Try again"; exit; } // if there is no $heading_info_file (see format above) set page heading here if ( !file_exists("$directory/$heading_info_file")) { $header = "Viewer"; $browser_title = "$header"; } else { $heading_info = file("$directory/$heading_info_file"); $header = "$heading_info[0]"; } // image / text buttons if ($show_navigation_buttons == "true") { $back_src = "\"$back_alt\""; $next_src = "\"$next_alt\""; } else { $back_src = "$back_alt"; $next_src = "$next_alt"; } if ( !file_exists("$directory/$pic_info_file")) { $dh = opendir( "$directory" ); while( $file = readdir( $dh ) ) { // look for these file types.... if (eregi("(jpg|jpeg|gif|png)$",$file)) { // thumbnail code // if (substr($file,0,2) == "th") { $pic_info[] = $file; // } //sort( $pic_info ); } } } else $pic_info=file("$directory/$pic_info_file"); sort( $pic_info ); // begin messing with the array $number_pics = count ($pic_info); if (empty($currentPic)) $currentPic = 0; if (($currentPic > $number_pics)||($currentPic == $number_pics)) $currentPic = '0'; $item = explode (";", $pic_info[$currentPic]); $last = $number_pics - 1; $next = $currentPic + 1; if ($currentPic > 0 ) $back = $currentPic - 1; else $currentPic = "0"; // print the description if it exists $blank = empty($item[1])?' ':$item[1]; $show_name = ($show_image_name=="false")?' ':$item[0]; if ($currentPic > 0 ) $nav=$back; else $nav=$last; // meta refresh stuff for auto slideshow... if ($auto_slideshow == "true") { $meta_refresh = ""; } else $meta_refresh = "\n"; ################################################################################ // top of html page stuff #8C1111 // print the page header if in standalone mode if ($standalone == "true") { ?> <? echo $mypath; ?> 0) { $total_pages = $totp + 1; } else { $total_pages = $totp; } $startingAt = (($page - 1) * $max_results) + 1; //echo "
sa is $startingAt"; $showdistance=2; $pagend=1; $pagstart=1; $pagendthis=1; $pagstartthis=1; $page = intval((($startingAt+$max_results)/$max_results)); $pagstartthis = (($page * $max_results) - $max_results ) + 1; $pagendthis = ($page * $max_results); //echo "page: $page end: $pagendthis start: $pagstartthis"; $range = $max_results; $maxpage = $page + $range; $minpage = $page - $range; //echo "rante is $range page is $page maxp is $maxpage"; if ($pagendthis > $total_results) { $pagendthis = $total_results; } // echo "
s $pagstartthis ". " to $pagendthis of $total_results
"; //echo "
"; ?>
"; //echo "Return to galleries

"; echo "Images $pagstartthis to $pagendthis of $total_results

"; //print "
"; //print "Select a page:     "; $hrefstring="".$_SERVER['PHP_SELF']."?directory=$mypath"; if($page > 1){ $prev = ($page - 1); // $startrecord = (($prev * $max_results) - $max_results ); $pagen = $prev; $hrefstringn = "$hrefstring&page=$pagen"; echo "<< Previous  "; } else { echo "<< Previous  "; } echo "| "; if ($minpage < 1) { $minpage = 1;} $minpage = ($minpage < 1) ? 1 : $minpage; $maxpage = ($maxpage < ($minpage + $range - 1)) ? $minpage + $range - 1 : $maxpage; $elipflag=0; $under = $range - $page; if ($under >= 0) { $maxpage = $maxpage + $under +1;} $over = (($range + $page) - $total_pages); if ($over >= 0) { $minpage = $minpage - $over;} for($i = 1; $i <= $total_pages; $i++){ $pagstart = (($i * $max_results) - $max_results +1); $pagend = ($i * $max_results); if ($pagend > $total_results) { $pagend = $total_results; } if (($i <= $total_pages) && ($i >= 1)) { if(($page) == $i){ echo "[$pagstart - $pagend] | "; } else { if ((($i < (($page + $showdistance) + 1)) && ($i > (($page - $showdistance) - 1))) || ($i==1) || ($i == $total_pages) || (($page < $showdistance + $showdistance+1) && ($i < ($showdistance + $showdistance + 3 )) ) || ( ($page > ($total_pages - ($showdistance + $showdistance ))) && ($i > ($total_pages - ($showdistance + $showdistance +2)))) ) { //print "
sd is $showdistance page is $page i is $i max is $total_pages"; $startrecord = $pagstart-1; $pagen = round($pagstart/$max_results)+1; //$hrefstringn = "$hrefstring&startingAt=$startrecord"; $hrefstringn = "$hrefstring&page=$pagen"; echo "$pagstart - $pagend  | "; $elipflag = 0; } else { if ($elipflag == 0) { print ".......   "; $elipflag=1; } } } } } # this ends maxpage check if($page < $total_pages){ $next = ($page + 1); $startrecord = (($next * $max_results) - $max_results); // $hrefstringn = "$hrefstring&startingAt=$startrecord"; $hrefstringn = "$hrefstring&page=$next"; echo "  Next >>"; } echo "

"; //echo "
$pagendthis $pagstartthis"; // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $max_results); // Build Page Number Hyperlinks //echo "
Select a page:
"; // Build Previous Link if($page > 1){ $prev = ($page - 1); // echo "<< Previous  "; } //echo "| "; $range = 3; $maxpage = $page + $range; $minpage = $page - $range; //if ($minpage < 1) { $minpage = 1;} $minpage = ($minpage < 1) ? 1 : $minpage; $maxpage = ($maxpage < ($minpage + $range - 1)) ? $minpage + $range - 1 : $maxpage; $under = $range - $page; if ($under >= 0) { $maxpage = $maxpage + $under +1;} $over = (($range + $page) - $total_pages); if ($over >= 0) { $minpage = $minpage - $over;} for($i = 1; $i <= $total_pages; $i++){ $pagstart = (($i * $max_results) - $max_results +1); $pagend = ($i * $max_results); if (($i <= $maxpage) && ($i >= $minpage)) { if(($page) == $i){ // echo "$i "; //echo "" . $pagstart . " - " . $pagend ." | "; } else { // echo "$i "; //echo "". $pagstart . " - " . $pagend ." | "; } } } // this ends $maxpage check // Build Next Link if($page < $total_pages){ $next = ($page + 1); // echo "  Next >>"; } echo "
"; // paging end *************************************** ?>

Click on an image to enlarge, then scroll through images.

"; $jj++; $ff = $ii + 1; $fpath = $directory . "/" . $pic_info[$ii]; $size = getimagesize($fpath); $x = $size[0]; $y = $size[1]; $img = $pic_info[$ii]; //$img = substr($pic_info[$ii],8,8); //list($iwidth, $iheight, $itype, $iattr) = getimagesize($item[0]); echo "\n"; //\"Zoom\" if ($jj > ($perrow - 1)) { echo ""; if ($ii <= ($lastpic - $perrow)) { // echo ""; } $jj = 0; } $zz++; } ?>
"; //echo "width=\"160\" height=\"160\" >"; //echo "
" . $ff . ": " . $img . "
"; echo ""; echo "



Photos by Ted Roeder