read()) { $entry = preg_replace("/ /","%20",$entry); $pos = strpos (strtolower($entry), ".jpg"); if (!($pos === false)) { $arr_pic[] = $dir."/".$entry; } } $d->close(); } @sort ($arr_pic); $total = sizeof($arr_pic); echo ""; ?>

$total) { $next_url="?gal=".$gal."&pic=".$pic; } else { $next_url='?gal='.$gal.'&pic='.($pic+1); } if ( $pic-10<1) { $skip_back_url='?gal='.$gal.'&pic=1'; } else { $skip_back_url='?gal='.$gal.'&pic='.($pic-10); } if ( $pic+10>$total) { $skip_url='?gal='.$gal.'&pic='.$total; } else { $skip_url='?gal='.$gal.'&pic='.($pic+10); } echo "Previous Image | "; echo $pic." of ".$total." | "; echo "Next Image"; ?>