Hey,
Im a newb to php so I can hardly write anything on my own. I am trying to write a script that automatically makes a gallery page for me but I can't do it!
I want to make a table with 3 pictures a row with all the images in a given directory. The I want each image to be a link to the full-size image in a popup window. I have this so far:
$gallery = "encrucijadas";
$dir = dir("/bbtest/images/galleries/$gallery/large");
while($file = $dir->read())
{
if (ereg(".*\.jpg$", $file))
{
$image = "/bbtest/images/galleries/$gallery/large/$file";
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$imagethumb = "/bbtest/images/galleries/$gallery/thumbnails/$file";
$sizethumb = GetImageSize($imagethumb);
$widththumb = $size[0];
$heightthumb = $size[1];
So now I have the thumbnails image sizes and the full size images too (for the popup). Now I want to somehow make it display this, but repeating till all the images are displayed:
echo "<td align =\"center\">\n";
echo "<a href='#' onclick=\"window.open('popup.php?img=$image','width=$width,height=$height,
directories=no,location=no,menubar=no,scrollbars=no,status=no,
toolbar=no,resizable=no');return false\" target=\"_blank\">";
echo "<img src\"../images/galleries/$gallery/thumbnails/$file\" alt=\"$file\" width=\"$widththumb\" height=\"$heightthumb\" border=\"0\">";
echo "</a>\n";
echo "</td>";
Obviously all that should go within the <tr> tags but the previous code should loop 3 times (with the next image each time) before closing the <tr>. To see what I mean go to http://www.photographyasartgallery.com/bbtest/galleries/encrucijadas_1.php and click on the first image (ignore the stuff at the top).
I hope you understand what I'm saying.
Thanks!
BTW if you don't understand my question tell me and I'll try to explain again.