Gallery
=$from+$PER_PAGE)?$from+$PER_PAGE:count($pics);
for ($i=$from;$i<$to;$i++){
$imgAttribs=getimagesize($gallery . $pics[$i]);
$imgW = $imgAttribs[0];
$imgH = $imgAttribs[1];
// check for photo description file
$f=substr($pics[$i],0,strlen($pics[$i])-4);
$description="";
if(file_exists($gallery . $f . ".txt")){
$descr=file($gallery . $f . ".txt");
// take each row in the description file (the same name as the picture, but with .txt extension) and append it to a single string with new line inbetween
foreach($descr as $sentence) $description.=($sentence . "
"); } // check for photo thumb existence; fallback to original file of thumb doesn't exist $thumbImagePath=$gallery . $pics[$i]; if(file_exists($gallery . "thumbs/" . $pics[$i])) $thumbImagePath=$gallery . "thumbs/" . $pics[$i]; echo ""; $currentImageIndex++; } //end for // ==== EO visualization ==== } //end else } //end else open dir ?>
"); } // check for photo thumb existence; fallback to original file of thumb doesn't exist $thumbImagePath=$gallery . $pics[$i]; if(file_exists($gallery . "thumbs/" . $pics[$i])) $thumbImagePath=$gallery . "thumbs/" . $pics[$i]; echo ""; $currentImageIndex++; } //end for // ==== EO visualization ==== } //end else } //end else open dir ?>
=generate_pagination("", count($pics), $PER_PAGE, $CURRENT)?>



