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="http://akismet.com/" 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="https://coffeebear.net/wp-admin/$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.

NOTE: THIS IS A CORE WORDPRESS FILE! EDIT AT YOUR OWN RISK! I AM NOT RESPONSIBLE IF YOU HOSE YOUR BLOG, SERVER, LIFE, THE UNIVERSE, AND EVERYTHING! BACKUP EVERYTHING BEFORE YOU EVEN CONSIDER ATTEMPTING THIS! ONLY ATTEMPT THIS HACK IF YOU FEEL COMFORTABLE EDITING CORE WORDPRESS FILES.

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.

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.

I’ve written before about trying to get sound working on my ancient laptop. When Ubuntu Breezy (5.10) was released; I wiped my laptop and reloaded it from scratch. Unfortunately, this version of Ubuntu also failed to auto-detect/setup my laptop’s soundcard. After much googling and reading of the Ubuntu Forums, I finally got the sound working!

Below, I’ve summarized everything I read and tried in getting this working:

  1. Edit /boot/grub/menu.lst and add acpi=off to the end of the options for the kernel1.
  2. Install libsdl1.2debian-alsa via Synaptic.
  3. Removed /etc/modprobe.d/alsa-base.
  4. Created /etc/modprobe.d/alsa2.
  5. Added snd-cs4236 to the bottom of /etc/modules.

Mind you that summary leaves out dozens of pages of instructions, including the various diagnostics I ran to try figuring out what was wrong. Some of those diagnostics were:

  • lspci -v — No help to me as my soundcard is connected via ISA and not PNP.
  • lspnp -v — This would only detect my soundcard after I turned off acpi.
  • dmesg | grep -i "isa\|multi\|sound\|audio" — This might give you more info about the soundcard, but didn’t help me.
  • pnpdump — This might give you more info about the soundcard, but didn’t help me

Additionally, I ran across several recommendations for the options line in /etc/modprobe.d/alsa but the version of the file listed in the footnotes is the only one which worked for me.

Lastly, if you have this laptop there is a considerable amount of good information still available on Dell’s website for it. For example, apparently there is a Windows/DOS utility for configuring the IRQs and whatnot that the soundcard uses. Fortunately, I didn’t have to try downloading it and finding some way to run it but the option is there if you need it.

1/boot/grub/menu.lst
title Ubuntu, kernel 2.6.12-9-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda1 ro quiet splash acpi=off
initrd /boot/initrd.img-2.6.12-9-386
savedefault
boot

2/etc/modprobe.d/alsa
alias char-major-116 snd
alias char-major-14 soundcore
alias snd-card-0 snd-cs4236
options snd-cs4236 port=0x530 cport=0x210 isapnp=0 dma1=1 dma2=0 irq=5
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

options snd cards_limit=1

As you’ve probably noticed by now, I’ve found a work around to the plugin problems. From what I’ve been able to determine so far, the plugin is having problems calling in the Amazon product images for my sidebar. For now, I’ve reconfigured the plugin to display the text without images which seems to be mostly working though my sidebar is now getting tossed down to the bottom of the page. *sigh*

Update: Actually, it appears a different plugin is the source of the sidebar being shoved down. This other plugin adds in it’s own CSS; so I’ll be looking at that to try fixing the issue. Life is never easy.

CoffeeBear.net is currently experiencing some problems. We are aware of the issue and looking into it. We’ll let you know when we have it fixed.

Update: The problem appears to be related to the plugin I’ve been using to display books and whatnot down the side of the site. I’m still investigating why this started happening and will restore the site to normal once I’ve got it fixed.