image gallery help
Posted: Thu Apr 13, 2006 9:36 pm
I've recently taken over a website which contains a photo gallery and I was told the photo gallery used to work in a way that if you clicked on a photo it would open a larger version of the photo in a pop up window, and I've been asked to fix it so it works that way again. The code is as follows
I assumed the part that was commented out is the part that would make the photos open in the popup window but if I include that, none of the photos will show up at all. Any help would be great
Code: Select all
<?php
echo "&begin=1";
$mydir = "photos/";
$d = dir($mydir);
$fileString = "";
while($entry = $d->read()) {
if ($entry!= "." && $entry!= "..") {
$fileString .= $entry.",";
}
}
$fileString = substr($fileString,0,strlen($fileString));
$fileArray = explode(",",$fileString);
sort($fileArray);
$photoCount = 0;
for ($i=0; $i < count($fileArray); $i++) {
if (strlen($fileArray[$i]) != "") {
$photoCount++;
echo "&photolink".$photoCount."=".$mydir.$fileArray[$i];
echo "&photofile".$photoCount."=image.php?w=70%26h=70%26image=".$mydir.$fileArray[$i];
//echo "<td align=\"center\"><a href=\"javascript:PopupPic('".$mydir.$fileArray[$i]."');\"><img src=\"image.php?w=100&h=100&image=".$mydir.$fileArray[$i]."\" border=\"0\"></a></td>";
}
}
echo "&numphotos=".$photoCount;
$d->close();
echo "&end=1";
?>