PHP Speedy and Lightbox

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 = "";

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 😉

Join the conversation


  1. 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 – check the page source, you’ll see the compressed cache script reference while viewing a lightbox in the page – very happy about it!

  2. 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.

Leave a comment

Talk to me!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll Up
%d bloggers like this: