David Artiss

PHP Speedy and Lightbox


Due to updates, over time, that have been made to the site and the age of this article, this post may not display correctly. In particular images may be missing or product reviews display incorrectly.

If this is the case and you'd particularly like me to fix it, then please reach out to me on Twitter.

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:

Replace this with:

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

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 😉


Google logic » « N95 apps & mobile internet

2 Comments

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

Talk to me!

Copyright © 2017 David Artiss

Theme by Anders NorenUp ↑

Scroll Up
%d bloggers like this: