'.$title.'

'; echo '
'; //running the while loop to fill array with images while (false !== ($fileName = readdir($dir))) { if($fileName!="." && $fileName!=".."){ foreach($formats as $type) { if(strpos(strtolower($fileName), $type, 1) > 0){ $mypics[] = $fileName; if ($createThumbs == 1){ $thumbLoc = $thumbs.'/'.$fileName; $imgLoc = $images.'/'.$fileName; $returnVAL = array(); $cmd = 'convert -define jpeg:size=200x200 '.$imgLoc.' -thumbnail \''.$imgW.'x'.$imgH.'>\' -background white -gravity center -extent '.$imgW.'x'.$imgH.' '.$thumbLoc ; //crop if ((file_exists($thumbLoc))){ if (filemtime($imgLoc) > filemtime($thumbLoc)){ //thumb is older try to create thumb $inky = exec($cmd, $returnVAL, $err); } } else{ $inky = exec($cmd, $returnVAL, $err); } } } } } } //closing the directory closedir($dir); for($i=0; $i'; //close row } else{ echo '
'; //start column for($j=0; $j<$imagesAcross; $j++){ if ($i<(count($mypics))){ $thumbLoc = $thumbs.'/'.$mypics[$i]; $imgLoc = $images.'/'.$mypics[$i]; if ((file_exists($thumbLoc))){ //only create link if thumb is present //image only shows if both thumb and image are present echo ''; } if($j == ($imagesAcross-1) ){ echo '
'; //close column $i++; } } } } //create closing echo '

'; ?>