Very simple PHP ‘gallery’ script
Published November 1st, 2007Somebody asked for a very simple script that would scan a directory (and its subdirectories) for all images, and then present them all as a list of thumbnails. So I had a quick go and came up with this (zip file). Just place the two PHP files in the directory you want to scan, open that URL in your browser and presto! a great big list of all your images.
Yes it’s very basic, but that was the point. No, you can’t add captions, or change the order, or have a whizzy rotating slideshow with cute sound effects.
However you can alter the output size of the thumbnails (using the $max_width and $max_height values) and the number of thumbnails in each row of the list table (using the $images_per_row value). The markup is very simple too so you should be able to alter the layout quite easily if you feel the need.
What’s it good for? Well if you just want to dump images into a folder and see them in a list, then it’s ideal.
Gigs on September 8, 2008
Giving this a try, thanks for it!
Gigs on September 9, 2008
$format = strtolower($matches[ 1 ]);
This works better because you were breaking on *.JPG capitals in get_image.php $format case statement.