PDA

View Full Version : Remove Captions from Lightbox



sjbohlman
09-23-2008, 05:34 PM
1) Script Title: PHP Photo Album script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm

3) Describe problem:
I have combined the PHP Photob Album script with Lytebox, but want to remove the captions that show up above the [Image # of #] caption when the lytebox has been activated. But I am not sure were to take out that part of the code... anyone have any suggestions?

You can find my page here (the site uses iframes, so follow the directions below to get to the correct page):
{website taken off for personal reasons}
Click on - 'Check out our Media Gallery' at the bottom
Then click on any one of those links to get to the photo album

Nile
09-23-2008, 10:19 PM
In your code find:


tempcontainer+='<img src="'+imagepath+galleryarray[i][0]+'" title="'+galleryarray[i][0]+' ['+galleryarray[i][1]+']" />'
And replace it with:


tempcontainer+='<img src="'+imagepath+galleryarray[i][0]+'" />'

sjbohlman
09-24-2008, 02:25 PM
Thanks so much for getting back to me... but that change didn't work for me. :(

Nile
09-25-2008, 01:53 AM
In getpics.php replace:


echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";

With:


echo "";

jscheuer1
09-25-2008, 07:15 AM
None of that will work. Lightbox gets its captions from the title attributes of the links, not the images, that's why Nile's first idea doesn't work. The second suggestion is worse, there will be no images. Instead, edit this line:


document.write('<a title="'+galleryarray[i_tem][0].replace(/^.*\/|\.[^\.]+$/g, '')+'" href="'+targetlinkdir+galleryarray[i_tem][0]+'" rel="lyteshow[vacation]"></a>');


to:


document.write('<a title="" href="'+targetlinkdir+galleryarray[i_tem][0]+'" rel="lyteshow[vacation]"></a>');


Added Later:

In an unrelated matter - You are also going to want to replace the (in lytebox.js near the top):


Array.prototype.removeDuplicates = function () { for (var i = 1; i < this.length; i++) { if (this[i][0] == this[i-1][0]) { this.splice(i,1); } } }

with:


Array.prototype.removeDuplicates = function () {for(var i = 0; i < this.length; ++i)for(var j = this.length-1; j > i; --j)if(this[i][0] == this[j][0])this.splice(j,1);};

Otherwise you will have dupes that could cause problems.

Nile
09-25-2008, 11:37 AM
Thanks for the save there John.

sjbohlman
09-30-2008, 02:58 PM
Perfect! Thanks so much!!