Archive for the ‘Program-errrz’ Category

Yeah! It Worked!!!

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. :roll:
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
}

Programmer’s Block

I cannot code.

Somebody should remind me that I am a web developer. Sometimes my brain forgets. I need to work on a script and I’ve been start it, finished the code, tested it, didn’t get the output I wanted and although I should be debugging it (which might be just a simple typo or misplaced variable), my mind is elsewhere.

I have been staring at a semi-blank php page in dreamweaver for the last 30 minutes that I decided to have a break (oh great, I need a break from doing nothing) and blog for a while. I know what I’m suppose to do and I have actually done this before… My only weirdness is that I can’t make myself continue typing out the codes and test it again. My mind is willing but the flesh won’t cooperate. Joiz snap out of it already!

@_@

Thank you to those who greeted me on the forums and through sms and through IM and email and to those who called and even to a few who visited me personally. I didn’t receive pictures of pets or half naked men greeting me on skin like I did a few years back. :lol: my friends provided me with such funny memories to blackmail them with…