Monthly Archives: November, 2005

Heh, I forgot

It occured to me that I’d totally forgotten to post pictures from that (now) long ago trip to the Niabi zoo. I have finally posted a few of the images in the gallery. Unfortunately, when I was going through the pictures there were quite a few where my camera’s autofocus had grabbed onto the wrong subject. *sigh*

WordPress/Akismet Hack 0.0.2

Do you run WP? Do you also have Akismet installed? Would you like a quick reference on the Dashboard showing you some info from Akismet? I do and did want this. Since I have zero idea on how to set this up as a plugin; I simply added the code into /wp-admin/index.php. I scanned through the file until I found the section of code which creates the “Latest Activity” box. Then between the sections for “Blog Stats” and “Incoming Links”1, I added the following code:

<h3><a href="" title="Stop Comment Spam and Trackback Spam « Akismet">Akismet</a> Stats</h3>
<? php
$deadspam = get_option('akismet_spam_count');
$livespam = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");
$sitelink = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_id = '1'");
print "Killed Spam Count: $deadspam\n";
if ($livespam == 0) {
print "Your spam queue is empty!";
} else {
print "<strong>Possible Spam Count: <a href="$sitelink/wp-admin/edit.php?page=akismet.php" title="Click here to see the moderation queue">$livespam</a></strong>\n";

There’s undoubtably a more elegant way of retrieving and displaying this information. And for somebody who actually writes PHP code regularly, this might even be a quick and easy plugin to create. Unfortunately, I’ve only read part of a book about PHP; so this is about as far as I can currently take the hack. Unlike what some people think, WordPress does not require you to be a PHP guru. It only requires a webserver with PHP, MySQL & a little patience2.


Update: Neto Cury was kind enough to point out an error in the above code. Though to be fair it’s not entirely my fault. I pasted into this post the exact code I used in my file, but something in WP or one of the plugins I use appears to have changed the first part of the PHP coding from <? php to < ?php. I’m not sure what caused that, but to help people avoid getting errors; I’ve uploaded a text file containing the code for the hack. You can download that file here.

Update #2: Fixed a typo in the previous update. Sorry about that Neto!

Update #3 2007-04-21: I’ve updated this hack to modify the akismet plugin file (Akismet v2.0 for WordPress 2.1.3) instead of one of the WordPress core files. Read about it here.

1 Blog Stats ends at line 85 in my file and at the time of this writing I am running WordPress 1.5.2.
2 This is true of every CMS that I’ve looked at.

Pukka’s Links of the Week

Due to recent crackdowns at the office on Internet access, this is likely to be the last PLotW. Also due to those crack downs, there is only one link this week.

Akismet Stats

Update: In case you are wondering why the links went up today instead of Friday that would be due to the Thanksgiving holiday being celebrated this week. As an extra bonus, here’s a sneak peek on a little WP hack I’ve been working on. Once I know that my code is correctly displaying the number of spam comments in the moderation queue; I’ll post it. Since I’m a -Z^42 list blogger1 it will probably take a day or two before I get any spam comments in my queue. So please be patient.

1 Versus one of those ultra-popular A list bloggers.


Over the weekend, Ariesna & I went with some friends to watch Harry Potter and the Goblet of Fire. I went into the movie with extremely low expectations1 but much to my surprise; I rather liked the movie. Sure huge chunks of the book were wacked out, but you have to expect that when you are taking 734 pages of text and converting it into a movie just over 2.5 hours long. The special effects were upto pair with anything in the prior movies. Also, although the actor playing Mad-Eye Moody didn’t look quite like I had pictured the character; he did a nice job of it. Overall, I give this one a thumbs up and it will eventually be going in my DVD collection (unlike some the previous one).

1 Harry Potter and the Prisoner of Azkaban was such a wretched film that it nearly ruined the entire series for me.

Dang Computers

I finished my evening in front of ye olde boob tube1 at 10 and was thinking about heading to bed early. I decided just before doing so I’d go read some email, maybe run CastPodder and grab some stuff to listen to at work. That was nearly two hours ago and I’m still not continuing on my way to bed. *sigh* I really should learn my lesson and stop thinking I can hit up the crack pipe use my computer for a just a few minutes. On the bright side, my last run of APT-GET updated amaroK which fixed an annoying crash I’d been experiencing for the last week or so. Also, I setup amaroK up to use the MySQL backend and it’s massively faster than using SQLite. The only downside is that somewhere along the way of my manual attempts to fix the crash, updating to the latest/greatest and switching the MySQL backend; amaroK “forgot” which songs I’ve already listened to. This brings my playlist of “new” music to just under 3,000 tracks2.

1 T.V. for you little whipper-snappers.
2 This playlist excludes podcasts, audiobooks and the like but does include music that is podsafe or ripped from CDs that I own.

Copyright © 2004 – 2021 Powered by WordPress.