I have been trying, unsucessfully, to find a image gallery script to suit my friends needs. He needs a script that will show thumbnails for all images in a directory, creating them if they are not present in a subdirectory, that when clicked show the full sized image in a new pop up window.
Having very limited time and resources just now, I've tried to come up with a solution. The pseudocode for which appears below.
Can anyone out there help me flesh this out to a proper working script?
mDm
define popUp Javascript method //opens new window with just close button,
//passed image location and size on call
$picDir //directory where images are stored
$thumbDir //directory where thumbnail images are stored
picArray[] //array storing image file locations
thumbArray[] //array storing thumbnail locations
columns = 5 //perhaps change to be parameter in function call?
open $picDir
while (next file != false){
read next file //possibly read sizes and store in array for thumbnails?
if (picture file extension) add location to picArray[]
}
close directory
bubble sort picArray[] by modified date
while (items left in picArray[] != false){
open $thumbDir
if (thumbnail != false){
create thumbnail using gd2image library
save to thumbDir
store location in thumbArray[]
} else store thumbnail location in thumbArray[]
close $thumbDir
print HTML for 'start of table' using Int variable
while (items left in picArray[] != false){
for (i<columns ; i=0 ; i++){
print HTML for 'new table column'
print thumbArray[i]
add link to pic array[i] using JavaScript popUp method
close HTML for column
}
HTML for 'add new table row'
}
print HTML for 'end of table'