"; if(isset($picdir)) { // ////////////////////////////////////////////////////////////////// // open the directory $dh = opendir("$picdir"); while($file = readdir($dh)) { if( (substr($file,-3)=="gif") || (substr($file,-3)=="jpg") || (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
this directory yet!!

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