Firefox PHP

Akismet Spam Service

Posted by Brian Moon 
All files from this thread

File Name File Size   Posted by Date  
akismet-1.1.tar.gz 2.8 KB open | download Brian Moon 09/12/2006 Read message
akismet-1.2.tar.gz 2.8 KB open | download Brian Moon 12/29/2006 Read message 5.8 KB open | download iamback 03/17/2007 Read message 355 bytes open | download m.two 11/06/2007 Read message
Akismet Spam Service
May 18, 2006 10:19PM
Update: I have fixed the settings issue. It was saving, just not displaying the settings that were saved correctly.

Someone in IRC pointed me to Akismet. It looked neato. So, I hacked up this module. Akismet is a real time spam checking service. You have to have a key from them to use it. Its free for personal use. If you are a commercial site, you can pay to get a commercial key.

This module will send messages to Akismet for spam checking. If Akismet believes they are spam, Phorum will alter the message to an unapproved state. No message is given to the user. No sense tipping them off and usually spam comes from bots.

There are two options in the settings. The first allows you to not check registered users messages. The second allows you to set a minimum trusted post count. Any user that has less than that many posts will be check for spam.

When messages are approved, they are sent to Akismet to recognize them as NOT spam. What Akismet calls ham. There is a little template work that has to be done to add a spam link to the read pages if you want to report things you believe to be spam to Akismet.

This code has been tested for sanity. That is all. There are likely bugs.

Here is the readme:
Akismet Module

To block spam
1. Go to and get a key.
2. Unpack the akismet module in your mods dir.
3. Go to your Phorum admin and turn the module on.
4. Edit the Settins for the module and enter you key.

To report spam
This is a little trickier.  You have to edit your template to insert the Spam
links on the read page.

In read.tpl, you will find something like: 

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteThread}'))

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteMessage}'))

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteMessage}'))

You will want to add another link just before each of those:

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteThread}'))

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteMessage}'))

<a class="PhorumNavLink" href="javascript:if(window.confirm('{LANG->ConfirmDeleteMessage}'))

These links will delete the spam and submit it to Akismet.

For read_threads.tpl, look for the same URLs.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter

Edited 1 time(s). Last edit at 09/12/2006 03:02PM by brianlmoon.
open | download - akismet-1.1.tar.gz (2.8 KB)
Re: Akismet Spam Service
July 31, 2006 09:18AM
I tried installing this, but it won't "take" - I can enter my Akismet key and other prefs as often as I like but they don't stay in place. Any ideas? It's a TERRIFIC idea.
Re: Akismet Spam Service
July 31, 2006 11:56AM
did you check that there are no error-messages shown above the form?
what happens when you save the data? are you presented with the form again or do you get to the mods-page again?

I'm using the akismet-mod too and without problems.

Thomas Seifert
Re: Akismet Spam Service
July 31, 2006 12:03PM
No error messages at all. I'm presented with the "There are no settings for this module." page.
Re: Akismet Spam Service
July 31, 2006 12:10PM
whats the name of the folder of the mod? did you rename that?
it *has to* be "akismet".

Thomas Seifert
Re: Akismet Spam Service
July 31, 2006 12:18PM
I tried reinstalling from scratch and that fixed it!! Thanks! Great plug-in!
Re: Akismet Spam Service
August 04, 2006 04:01PM
I'm getting an error (I'm positive it's my fault as I'm pretty new at this)

Fatal error: Call to undefined function: phorum_admin_okmsg() in /home/www/fatmawrooney/phorum-5.0.21/mods/akismet/settings.php on line 33

this is when I enter the key and hit submit.

Any help? Thanks much in advance!!

Re: Akismet Spam Service
August 04, 2006 04:02PM
you are using an outdated phorum-version.
phorum-5.1 is required for this module to work.

Thomas Seifert
Re: Akismet Spam Service
August 04, 2006 04:03PM
ugh. Thanks much. Is it gonna be hard for me to upgrade?
Re: Akismet Spam Service
August 04, 2006 04:08PM
It was easy for me... I was pleasantly surprised.
Sorry, only registered users may post in this forum.

Click here to login