Tag Archives: hacks

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

Links

Just a bunch of links that I’ve picked up in the last week or 2 that interested me…

Drawn! is a new group blog about illustration, art, and cartooning:
http://www.drawn.ca/

Stephen Colbert, from The Daily Show, interview:
http://www.onlisareinsradar.com/archives/002407.php

80’s TV Commercials:
http://www.x-entertainment.com/downloads/

Build your own magnetic spice rack:
http://www.washingtonpost.com/wp-dyn/articles/A43894-2004May20.html

Interesting Science Friday:
http://www.sciencefriday.com/pages/2005/Mar/hour2_031105.html

A “downloadable TV show” mentioned on Slashdot:
http://slashdot.org/articles/05/03/17/1322246.shtml?tid=129&tid=155

Some sort of online, short film recommended to me by Pukka:
http://www.delivery.framebox.de/

Ain’t It Cool News visits Pixar:
http://www.aintitcoolnews.com/display.cgi?id=19658#1

Wicked Cool Latte Art, links via Boing Boing
http://www.flickr.com/photos/tonx/sets/48921/
http://www.latteart.org/latteart.htm

Camera Hacks is a community website to share tips/tricks/tutorials/links to info on cameras (digital or film):
http://camerahacks.com/

WordPress is Web application of the year!

I was just over at ArsTechnica, checking up on the lastest news and noticed in their
Looking back at 2004 article that WP had been declared the Web app of the year. Way to go WordPress devs!

Web application of the year

We asked forumgoers to choose the best web application or development framework of the year.

Web-based applications provide interaction for all users regardless of platform or location. If you can connect to the web, you can use it. Forums, blogs, administration tools, collaboration frameworks; there were many excellent options to choose from in 2004.

Winner: WordPress

Let’s face it. Blogs are in fashion, and why not? Vanity knows no bounds, and there are some people who actually do something productive with theirs. From the influence of blogs on the coverage of the US presidential elections to every random teenager who has problems with their partner/parent/teacher/cat, blogs are out there allowing your most intimate feelings to be shared with random people at wifi hotspots. WordPress is the most prominent rising star of weblog software, completely free and with a large and active community. Styles, plugins and hacks are readily available, with problems such as comment spamming being addressed far more rapidly than competing applications.

Please pardon our mess

I installed WP 1.2.1 tonight and am in the process of restoring some of the hacks/plugins that I use for CoffeeBear.net. If you notice any oddities or problems; please let me know.

Also, I’m sending a trackback on this entry to Craig Hartel‘s site to try double-checking on whether or not trackbacks are broken in WP 1.2.1.

Thanks to my readers. Apologies to Craig for picking on his blog.

Links to WP1.2 Plugins

This post is just for me to use a reference to any plugins that I am or will consider using with WP v1.2.

Lorem Ipsum isn’t actually a WP 1.2 plugin, but it’s still bloody useful.

Word/Image Count

OpenPGP signed comment plugin

Topic Icon

PictPress

Comment Preview for WordPress 1.2, thread on WP Support Forums

Convert Hacks to Plugins, thread on WP Support Forums

WP Backup/Restore new version, thread on WP Support Forums

WP & Gallery integration, thread on WP Support Forums

Making AMM work with WP 1.2, thread on WP Support Forums

WP Wiki page of WP v1.2 plugins

WP Comment and Post plugins

Copyright © 2004 – 2018 CoffeeBear.net. Powered by WordPress.