"; print ""; foreach($alldir as $key) { $dirname = strtoupper(str_replace("_"," ",$key)); print ""; } print "
SELECT DIR
$dirname
"; if(isset($dir)) { // open the directory $dh = opendir("$picdir/$dir"); while($file = readdir($dh)) { if( (substr($file,-3)=="gif") || (substr($file,-3)=="jpg") ) { // insert all images in array $a_img[] = $file; } } $totimg = count($a_img); // total images number $totxpage = $col*$maxrow; // images x page $totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage):((int)($totimg/$totxpage)+1); // number of total pages ////////////////////////////////////////////////////////////////// // // Start to print and page break // ////////////////////////////////////////////////////////////////// if($totimg == false) print "
No Images avalaible in
".strtoupper($_GET[dir])." directory yet!!

"; else { ?>
$val) { if(($x%$col)==0) print "\n"; if($a_img[$x]) { // create thumbnail with imglib $imagehw = getimagesize("$picdir/$dir/$a_img[$x]"); $height = 120; $width = (int)(($imagehw[0]*120)/$imagehw[1]); ///////// $ctime = filectime("$picdir/$dir/$a_img[$x]"); if("$dir/$a_img[$x]" !="") print "\n"; } if(($x%$col) == ($col-1)) { print "\n"; $r++; } // print "r=$r - maxrow=$maxrow
"; if($r==$maxrow) { break; } else $x++; } print "
  Total Images :  

$a_img[$x]
\n"; } // page break if($totimg>$totxpage) { ?>
$page) { $next = $page+1; $back = ($page>1)?($page-1):"1"; if($page>1) { $back = $page-1; print "<< back "; } print "    gallery $page of $totpages   next >>"; } else { $next = (($page-1)==0)?"1":($page-1); print "<< back   gallery $page of $totpages   "; } } print "
"; } /// ///////////////////////////////////////////////////////// ?>