include("config.inc"); if (isset($_POST['gallery'])) {$gallery=$_POST['gallery'];} else if (isset($_GET['gallery'])) {$gallery=$_GET['gallery'];} $start = 0; ################# read directories for gallery ################# $i = 0; if(is_dir($dir_pics.$gallery)) { if($handle = opendir($dir_pics.$gallery)) { $all_images = array(); while(($file = readdir($handle)) !== false) { if(!preg_match( '/^\./', $file)) { $img_type = strtolower(substr($file,-3)); //get image type if ($img_type == 'jpg' || $img_type == 'gif' || $img_type == 'bmp' || $img_type == 'png') { $image = $dir_pics.$gallery."/".$file; $all_images[$i] = $image; //just images $i++; } } } sort($all_images); // ORDENAR POR NOMBRE LOS FICHEROS LEIDOS!!!!! closedir($handle); } } ################################################################ ################# read images from directory ################### $images = array(); $images = array_slice($all_images,$start,$img_per_page); ################################################################ ?>
MONAMOUR Natural Design |