Adding Askimet Spam checker to Gbook...

Everything related to GBook PHP guestbook
Post Reply
gtk
Posts: 2
Joined: Mon Jun 19, 2006 5:32 pm

Adding Askimet Spam checker to Gbook...

Post 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
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply