
Originally Posted by
chillinbro07
Thanks for solving this problem guys! I've been trying for months. Only problem I still have is:
When you are one page one and you go to the lighbox viewere it only shows the images on the that page. Can I make it so lightbox will recognize all the pictures in the given directory as a group.
ie. Lets say i have a total of 24 pictures in a directory and i have 8 thumbnails on each page. The rel=lightbox[group1]
Right now: If you click the first image on page one it shows "1 of 8"
I want it to operate like: "1 of 24"
Any help is much appreciated
This is a rather old thread, and lightbox 2 has been upgraded several times in the interim and browsers have changed a bit as well. As a result, the above solution is no longer optimal, even for single image enlargement, let alone for creating a grouping that spans two or more pages of PHP photo album.
I now favor a method that assigns the lightbox event directly to the thumbnail (in the PHP Photo Album script):
Code:
function buildimage(i){
var imagecompletepath=(targetlinkdir!="")? targetlinkdir+galleryarray[i][0] : imagepath+galleryarray[i][0]
var tempcontainer='<a href="'+imagecompletepath+'" target="'+href_target+'" rel="lightbox[joe]" 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
}
And change this in the PHP Photo Album script:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open(imgsrc.href, "popwin", popupsetting[1])
popwin.focus()
return false
}
else
return true
}
to:
Code:
function popuplinkfunc(imgsrc){
myLightbox.start(imgsrc); return false;
}
To get multiple 'pages' of PHP album to be included in the lightbox next/previous array, code like this should be added to the PHP Photo Album script:
Code:
document.write('<div style="display:none;">');
for (var i_tem = 0; i_tem < galleryarray.length; i_tem++)
document.write('<a title="'+galleryarray[i_tem][0].replace(/^.*\/|\.[^\.]+$/g, '')+'" href="'+targetlinkdir+galleryarray[i_tem][0]+'" rel="lightbox[joe]"></a>');
document.write('</div>');
just after the galleryarray has been sorted:
Code:
if (gsortorder=="asc" || gsortorder=="desc")
galleryarray.sort(sortbydate)
document.write('<div style="display:none;">');
for (var i_tem = 0; i_tem < galleryarray.length; i_tem++)
document.write('<a title="'+galleryarray[i_tem][0].replace(/^.*\/|\.[^\.]+$/g, '')+'" href="'+targetlinkdir+galleryarray[i_tem][0]+'" rel="lightbox[joe]"></a>');
document.write('</div>');
Bookmarks