I need a gallery script that isn't retarded.
November 16, 2009 1:23 AM Subscribe
I have a lot of photos on my blog that I want to put into a gallery, but there are so many that I don't want to deal with reuploading them somewhere or installing a feature-creepy (I just made that up!) gallery script and putting them all into it. They're all in a big messy directory on my server, so is there a very simple script that will look in the directory for anything that's a JPG and spit it out in gallery format? Or, if you know PHP: I could probably write the thing myself, but what would the code for "look in /directoryx/, put all filenames into this array" look like?
$handle = opendir('/path/to/files');
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
posted by gregr at 6:22 AM on November 16, 2009
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
posted by gregr at 6:22 AM on November 16, 2009
Even smaller PHP:
$allfiles = glob("/directoryx/*.*")
posted by AzraelBrown at 7:57 AM on November 16, 2009
$allfiles = glob("/directoryx/*.*")
posted by AzraelBrown at 7:57 AM on November 16, 2009
This thread is closed to new comments.
posted by borkingchikapa at 1:26 AM on November 16, 2009