Page 1 of 1

Adding Askimet Spam checker to Gbook...

Posted: Fri Nov 10, 2006 7:43 pm
by gtk
I added Aksimet spam filtering along with the spam filtering already in Guestbook. Seems to work for me. If a developer on the Guestbook software wants to "standardize" it, perhaps they can share it with others ?

If you are not familiar with Akismet, it's a comment-spam management system that's adaptable to almost any application.

BACKUP ANYTHING YOU WILL BE MODIFYING, especially gbook.php and entries.txt ..
Add at your own RISK.

#1 The first thing you do is get a FREE Askimet key HERE.

#2 Next, download the PHP4 or PHP5 (depending on which version php you run) HERE

#3 Ftp the class from step #2 to your guestbook root directory.

#4 Edit your gbook.php and add
require('Akismet.class.php');
above the other requires.

Find the code
addEntry($name,$from,$email,$url,$comments,$isprivate);
and replace it with this:
$WordPressAPIKey = 'ADD_YOUR_API key ';
$MyBlogURL = 'http://www.your_guestbook_url/guestbook/';

$author = $name;
$comment = $comments;
$website = $url;


$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey);

$akismet->setAuthor($author);
$akismet->setAuthorEmail($email);
$akismet->setAuthorURL($website);
$akismet->setContent($comment);
$akismet->setPermalink("http://www.your_guestbook_url/guestbook/'");

if($akismet->isSpam()) {
problem('SPAN Detected.. Shame on you!',0);
} else {
addEntry($name,$from,$email,$url,$comments,$isprivate);
}
Change the ADD_YOUR_API key with the key that you recieve when signing up at Askimet.
Change the www.your_guestbook_url/guestbook/ with the URL to your guestbook..


Again, this worked for me & helps with knocking back the spam.. I am not 100% guaranteeing it will work for you.


Greg

Posted: Fri Nov 10, 2006 8:20 pm
by Klemen
Hi,

I think getting an API key is too much for many GBook users and I want the install to be as simple as it gets. But thanks for sharing, if anyone wants this they will just follow your guidelines.

Regards