World Wide Whatever

Yeah! It Worked!!!

February 6, 2007

I hate it when a plugin suddenly no longer works because of a wordpress update. And the Lightbox plugin is one of my favorite plugins that suddenly doesn’t work anymore after upgrading to Ella.

Egad, 3 posts in 1 day… talk about blabbing too much. 🙄

Back to the plugin.. I visited the plugin’s page and the author hasn’t updated for Ella yet. There was a visitor there though, Alan, who was able to figure out what to do with the first part…

he changed a part lightbox-plugin.php from this:

preg_match_all('/<a(.*?)href="(.*?)"(.*?)>/i', $content, $found);

to this:

preg_match_all('/<a(.*?)href=["'](.*?)["'](.*?)>/i', $content, $found);

It worked but then I still found a bug when it comes to using series… aaaah (putting the photos in batches/groups) and yey! I made my own solution! And it worked!

I replaced this:

$nlink = str_replace($title[0].' ', '"', $link);

with a few more codes that just checks something before doing something… :mrgreen:

$testq = substr($title[0], 0, 1);
if ($testq != '"'){
$nlink = str_replace($title[0].' ', '$testq', $link); // remove series tag, not using double quotes
} else {
$nlink = str_replace($title[0].' ', '"', $link); // remove series tag, uses double quotes
}

Woot it worked! I know there might be a better solution but I’ll leave it to the author to fix it properly. I hope I do help out on those who need a work-around while waiting for that update. :mrgreen:

You Might Also Like

No Comments

  • Reply Colleen February 6, 2007 at 8:07 pm

    Hey, when I blog in wordpress 2.1, and then go publish, it says are you sure you want to edit this? yes or no. No matter what I pick, my entry doesn’t go through!

    I have to copy it before hitting publish, cause it will erase, then quickly past and publish again, does this happen to you?

  • Reply joiz February 6, 2007 at 8:27 pm

    Haven’t experienced that. It maybe with your hosting? 😕 I’m not sure…

  • Reply smarcute February 7, 2007 at 5:20 pm

    ang galing! ako rin…..pero hindi ko pa gaano gets 🙁

  • Leave a Reply