View Full Version : PHP Photo Album script- naming and displaying

01-08-2007, 02:58 PM
PHP Photo Album script (naming),

Hi everyone,

I really like this script. Kudos to the coder(s). I was wondering how do i name each image with its original name. example, fido at the hydrant.jpg, fido chasing mailman.jpg. instead of "photo".
and on a different note: when i choose 3*3 i get 9 images in line vertically. How do i display 3 by 3



01-09-2007, 05:43 AM
3*3 means 9. It is three times three in javascript. The script calls for this syntax:


The x in this case is just a delimiter not an operator as the * is.

About the image captions, I believe you mean. Edit the script here:

function buildimage(i){
var imagecompletepath=(targetlinkdir!="")? targetlinkdir+galleryarray[i][0] : imagepath+galleryarray[i][0]
var tempcontainer='<a href="'+imagecompletepath+'" target="'+href_target+'" onClick="return popuplinkfunc(this)">'
tempcontainer+='<img src="'+imagepath+galleryarray[i][0]+'" title="'+galleryarray[i][0]+' ['+galleryarray[i][1]+']" />'
tempcontainer+='</a><br />'
tempcontainer+=(descriptionprefix[0]==1)? descriptionprefix[1]+(i+1) : ""
return tempcontainer

Replace that red line with this one:


I see you are probably using spaces in your filenames. In some browsers they will get escaped and come out as %20 so, use this instead if using filenames with spaces:


Another nice twist would be to strip the extension (.jpg or .gif) or whatever:

tempcontainer+=unescape(galleryarray[i][0]).replace(/\.[^\.]*$/, '');