Page 1 of 2

Suggestion (more a plea..) for the Lightbox plugin

Posted: Sat Jan 03, 2009 8:27 pm
by Mangek
Hey guys,

I'm using the Lightbox plugin to post some images in a Gallery-like manner and I'm starting to miss the rel='lightbox[groupname]' feature.

I've tried adding that bit by hand, and it's grouping the images, but it still spits out a second rel='lightbox' which probably will break something somewhere at some point. ;)

Would it be easy to edit the plugin to have it add [groupname] automatically? I tried adding that in a single-image entry and the arrows wouldn't appear, so that would work fine for me.

And a following question, could I somehow use the name of the entry as the group (or something equally diversing)? So that they don't 'all' group together, only from the same entry.

I tried editing serendipity_event_lightbox.php, but realised, as it's .php, that I couldn't just insert the smarty tags to include the entry title.

Any help would be appreciated. (And rewarded with e-cookies!) :)

Posted: Mon Jan 05, 2009 4:45 pm
by Mangek
Any suggestions? Before I break something, going in over my head.. :D

Posted: Mon Jan 05, 2009 5:02 pm
by garvinhicking
Hi!

Usually, $eventData should be available within the entry plugin hook to be used in PHP code...

Regards,
Garvin

Posted: Tue Jan 06, 2009 1:24 pm
by Mangek
Thanks for the reply Garvin! unfortunately I don't know where to begin, or what to do. :oops:

I did a search, and found this function in the above mentioned file:

Code: Select all

function event_hook($event, &$bag, &$eventData) {
and below that

Code: Select all

if ($regex == null) {
                if ($type == 'lightbox' || $type == 'lightbox_plus' || $type == 'lightbox2') {
                    $regex = '/<a([^>]+)(href=(["\'])[^"\']*\.(jpe?g|gif|png)["\'])/i';
                    $sub   = '<a $1 rel=$3lightbox$3 $2';
                } elseif ($type == 'thickbox') {
					~ code stripped ~
                }
            }
This is where I'm stuck. I don't know what to add to rel=$3lightbox$3 to group it individually for entries, as smarty won't work. My PHP skills don't go much further than your average 'Hello World'... :roll:

Posted: Tue Jan 06, 2009 1:44 pm
by garvinhicking
Hi!

Sadly I don't use the lightbox plugin, so I am also not familiar with the code, and currently have no time to look into this.

Best regards,
Garvin

Posted: Tue Jan 06, 2009 3:23 pm
by DwB
Mangek: try using "Gallery with photos of the entry" in the configuration of the plugin.

Posted: Tue Jan 06, 2009 3:56 pm
by Mangek
DwB wrote:Mangek: try using "Gallery with photos of the entry" in the configuration of the plugin.
Hm I don't see that. I'm using an older version of the plugin (had some troubles with the recent one). I'll see about fixing an updated version.

If I can do it from within the plugin that would be great. :)

Posted: Tue Jan 06, 2009 4:07 pm
by DwB
I was able to create a kind of slide-show within an entry contaiining 2 pictures using this setting.
I'm using the latest version coming from spartacus, perhaps that's the problem witz your blog.

Posted: Tue Jan 06, 2009 4:15 pm
by Mangek
Yep, encountering the same problem I had last time I tried the recent version. Take a look here. The script breaks, for some reason. :?

Edit: I want to use Lightbox 2, but that's what breaks. Lightbox 1 and Greybox won't load at all. Lightbox Plus and Thickbox both run, but they look ugly.. Could this be a setting on my host's end? :?

Posted: Tue Jan 06, 2009 5:12 pm
by DwB
Okay, I use lightbox_plus, since the others don't work correctly on my blog...

Posted: Tue Jan 06, 2009 5:14 pm
by Mangek
Ok, with a bit of hacking the versions together (adding the new serendipity_event_lightbox.php to the old install) I finally got it to work properly.

Don't know what's causing it not to work with a proper fresh install, but this will do.

Thanks for the help and suggestions, Garvin and DwB. Sent me on the right way. :)

Re: Suggestion (more a plea..) for the Lightbox plugin

Posted: Sun Mar 15, 2009 5:06 pm
by ed587
Anyone have new words on how to get lightbox2 to work? It sounds from what is written above I should try to get an earlier version of lightbox and then just add the serendipity_event_lightbox.php to it?

If this is the case, where would I find the earlier version of lightbox plugin?

I had a server error 500 yesterday and had to do a reinstall, lightbox2 now doesn't work. I have deleted and reinstalled twice.

Any help will be wonderful. Thanks.

The best,
~Ed587

Re: Suggestion (more a plea..) for the Lightbox plugin

Posted: Mon Mar 16, 2009 9:36 am
by garvinhicking
Hi ed587!

What's your URL of an entry that should contain a lightbox image?

Regards,
Garvin

Re: Suggestion (more a plea..) for the Lightbox plugin

Posted: Mon Mar 16, 2009 2:11 pm
by ed587
garvinhicking wrote:Hi ed587!

What's your URL of an entry that should contain a lightbox image?

Regards,
Garvin
Hello Garvin,

The first entry of the first page is one. http://www.neterm.net/serendipity

~Ed587

Re: Suggestion (more a plea..) for the Lightbox plugin

Posted: Mon Mar 16, 2009 2:43 pm
by garvinhicking
Hi!

When I call http://www.neterm.net/serendipity/plugi ... ototype.js I get a permission denied error. Is the path right? Check the file/directory permissions?!

Regards,
Garvin