PDA

View Full Version : News images & Lightbox


Tom M
02-27-2009, 03:57 PM
I've got multiple news stories on my index page and clicking an image brings up the full size image in a lightbox. So far so good. However if I click "next" it goes to the image from the next news story. This appears to be because they all reference the same module id. Any way to remedy this w/o turning the lightbox feature off?

Brian
02-27-2009, 04:22 PM
I'm not positive, but I would think you could take the code starting at // ##### Lightbox stuff in your news.php file, move that (except for the $headinclude .= line) to within the while() loop for the threads above, then add the threadid within the div and javascript calls.

Our Sponsors
 

Tom M
02-27-2009, 04:49 PM
Thanks for the pointer, Brian. I'll look into it as soon as I get a chance.

Tom M
02-28-2009, 09:17 AM
Well I've got something that is putting in unique 'rel=' tags for each news attachment but vb is still opening all the news item attachments. I tried changing things to operate using grouping syntax (i.e. rel="Lightbox[vba_news10774]") but it seems the vb version of the lightbox code doesn't support that.

At this point I'm not sure there's any way around it as it may be probably more capability than vb supports at this point.

You can see what I've done at the link in my signature. Since it doesn't break anything, I'll leave the modified code running for a while until I reach a definitive conclusion.

Our Sponsors
 

Brian
02-28-2009, 09:56 AM
Unfortunately I think you're right... I did a little testing locally, but I didn't have any luck either. :/

Tom M
02-28-2009, 10:06 AM
Thanks for looking into it Brian.

Is there any config option to just turn it off for vBa pages or should I just modify the news.php file?

Brian
02-28-2009, 10:18 AM
There's not an option, though you could add a plugin to the 'vba_cmps_module_news_start' hook location with something like this to avoid editing the template:
$vbulletin->options['lightboxenabled'] = 0;

Tom M
02-28-2009, 10:39 AM
Will do. As always, thanks for the great support.