Forum Moderators: mack
This may be too complicated to explain here, but any pointers in the right direction would be great.
Thanks!
You place all your images in a folder, the script then creates a small version of each on the fly to display in a gallery, it then opens the full image when a smaller version is clicked on. This will prevent you from having to manualy make the small version and large version for each of your images.
You might want to have a look through hotscripts.com for a suitable script.
Mack.
Unfortunately the only way i know to do this is to build a new page to display each image.
Yes, I had the same problem with photo gallerys that were updated frequently - it became quite tedious doing it every week, and so I got myself an automated php script that really requires almost no knowledge of php to use.
You place all your images in a folder, the script then creates a small version of each on the fly to display in a gallery, it then opens the full image when a smaller version is clicked on.
It appears Mack uses a similar, if not, the same script as me - because the thumbnails are the images themselves, just resized, once they're clicked, the loading is almost instant.
Here is a short, yet dandy php code I use to generate an image galler. CSS compliments it well and make it appear well optimized.
This is an example I have taken from one of my photo gallerys.
yourphotogallery.php<html>
<head>
<title>your page</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head><body id='gbody'>
// you can add any html you like to this. Wrapping it in a well styled div and giving it a nice header is always good.
<?
$NAMEFILE = "index.php"; //This files name.$dir = opendir("."); //Replace the dot with ./yourfolder or leave it as it is. This is the folder that the images are taken from.
while ($file = readdir($dir)) {
if ($file!= "." && $file!= ".." && $file!= "$NAMEFILE") {
$time = filemtime("$file");
$data[$time] = "<a href=\"$file\" target=\"new\"><img src=\"$file\" width=\"#\" height=\"#\"></a>
";
}}krsort($data);
while(list($k,$v) = each($data)) { echo $v; }
clearstatcache();
?>
</body>
</html>
I have added comments to the basics (what you will need to know most of all) and I have made the image proppertys bold.
Just replace the hash signs with the appropriate data. You can add borders too if you wanted, even an image class or id if you're using CSS.
Hope that helped.