Considering how regularly new versions of Firefox now come along, that's quite some bug fix list in version 10! http://t.co/K3I2vLpW 1 week ago

3rd
Jul 08

PHP Speedy and Lightbox



closeThis post was written 3 years 7 months 11 days days old, so is a bit old now. Feel free to read and comment on this post, just remember some things change with time and any facts in this post may not be accurate anymore.

I’ve talked before about the excellent PHP Speedy application – both a PHP script for your website or a WordPress plugin. However, as with all apps of this type, it doesn’t always “play ball” with everything.

In this case, I use the Lightbox 2 plugin for WordPress and, well, PHP Speedy has a tendency to break it.

So, having spoke with Leon at Aciddrop, I have the following fixes (this works on the current 1.8.2 version of Lightbox 2).

First of all, find the following line in lightbox.php:

$lightboxscript.= "<script type=\"text/javascript\" src=\"".$lightbox_path."js/scriptaculous.js?load=effects,builder\"></script>\n";

Replace this with:

$lightboxscript.= "<script type=\"text/javascript\" src=\"".$lightbox_path."js/effects.js\"></script>\n";
$lightboxscript.= "<script type=\"text/javascript\" src=\"".$lightbox_path."js/builder.js\"></script>\n";

Next, open up lightbox.js and before any of the code, add the line:

lb_path = "http://www.artiss.co.uk/wp-content/plugins/lightbox-2-wordpress-plugin/lightbox/";

Obviously, you will need to change the path to wherever your lightbox folder is.

And then, as if by magic, all should work. If you find that photos appear but without any buttons, then it’s the second fix (the one to lightbox,js) that fixes this, so look again at this. If the change to lightbox.php doesn’t work then, well, the lightbox won’t work at all (the picture will simply be displayed normally).

Hopefully, this might help someone ;)

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly

2 Comments

  1. dave says:

    well, i just found your post after having the same issue, but new phpspeedy has ignore rules, and using the lightbox2 plugin (as of december 2008), i simply tell phpspeedy to ignore lightbox.js and lightbox.css (and postratings, whcih i’m also using) and it works just fine

    you can see it in action at badzit.com – check the page source, you’ll see the compressed cache script reference while viewing a lightbox in the page – very happy about it!

  2. David says:

    Hi Dave. Yes, I’m aware of the new functionality. However, at least with my method, PHP Speedy will still function with it – with yours you use the benefit of PHP Speedy for that script.

    Of course, it depends whether you want to fiddle around with the code or not! However, since I made the change to the Lightbox script there hasn’t been any upgrades to it, so I’ve not had to make it again since.

No Pingbacks/Trackbacks

    Leave a Comment

    All comments are approved manually. No spam please, or comments that add nothing to the conversation.

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>