Live free, frag hard.
You are not logged in.
Pages: 1
Giusto un promemoria, che prima o poi me lo dimenticherò!
Hello everyone,
we (gamezoo.org, gamers association providing gaming-related services) put together a mod enabling Akismet spam protection for FluxBB 1.5.*.
Features:
Group check - decide which user groups are to be checked (untrusted users). It's a powerful feature with group auto-promotion: you can tell Akismet to check only posts from guests or newly registered users, avoiding to ban known-good users.
Additional triggers - if akismet is too unforgiving, you can restrict it to check only posts longer than X bytes, or containing links.
Spam queue - every post marked as spam will be put in a queue, and the spammer banned. Every post can stay indefinitely in the spam queue, or being deleted forever after X days. Admins and moderators can review the spam queue and decide to restore hams. Hams will be signaled to akismet, to help it learning from its mistakes.
"Mark as spam" link under posts - trusted users can zap the spam that Akismet failed to catch. These posts will be signaled to akismet. You can configure user groups that are trusted (usually admins and mods).
Sanitize spammers' user infos - when a spam post is deleted from the spam queue, this mod deletes everything from the spammer's profile, except from its IP, username and email, preventing your forum to contain dangerous links that may cause a downranking by search engines.
Rough edges:
Tested only on MySQL - we can't guarantee it working on other databases, though the table install script is the only SQL code added with respect to these found in post.php and viewtopic.php.
Restore ham - works as expected only if its forum and topic haven't been deleted in the meantime.
Doesn't forbid spammers from registering - we solved the problem by changing the registration form and geoip-banning the whole world except EU and some other states in nginx.
Only English - I'm not really into translating.
License - this one: http://www.wtfpl.net/
Not really clean code - I should have put all the code in a single file or class, I had to copy entire sections from post.php due to the ham restore feature, and it's being already used so I'm not keen on rewriting it now. It's E_ALL compliant code nonetheless, so your logs won't get flooded.
Files to edit:
post.php
viewtopic.php (you could skip it if you don't want the "mark as spam" option to trusted users).
Database changes:
Adds a new table: gz_akismet_queue
How to install it:
Go to https://github.com/sevendays/fluxbb15-GZ (do NOT pull the whole project, it has PHPass password hashes too and won't work with an original database)
Get: https://github.com/sevendays/fluxbb15-G … et_cfg.php and put it in your plugins/ folder
Get: https://github.com/sevendays/fluxbb15-G … _queue.php and put it in your plugins/ folder
Get: https://github.com/sevendays/fluxbb15-G … t_lang.php and put it in your lang/English folder
Get: https://github.com/sevendays/fluxbb15-G … .class.php and put it in your include/ folder (it's taken from here: https://github.com/achingbrain/php5-aki … .class.php )
Get: https://github.com/sevendays/fluxbb15-G … t_spam.php and put it in your root folder (that's what I told you - I should have done a single file).
Edit post.php, find:
// Did everything go according to plan?
if (empty($errors) && !isset($_POST['preview']))
{
insert, AFTER:
/******* Post: pre-save hooks BEGIN *******/
// GameZoo Akismet antispam post filter
require_once PUN_ROOT.'include/gamezoo_akismet.php';
if($tid)
gz_ak_post_presave_hook($username, $email, $tid, $fid, NULL, $orig_message);
// set tid to NULL if we're posting a new topic
else if($fid)
gz_ak_post_presave_hook($username, $email, NULL, $fid, $subject, $orig_message);
/******** Post: pre-save hooks END ********/
See the example here: https://github.com/sevendays/fluxbb15-G … r/post.php around line 170
Edit viewtopic.php, find:
// Perform the main parsing of the message (BBCode, smilies, censor words etc)
$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
insert, BEFORE:
/******* Post: pre-view hooks BEGIN *******/
// GameZoo Akismet antispam post filter
require_once PUN_ROOT.'include/gamezoo_akismet.php';
// insert "vote as spam" in $post_actions[] for normal users
// insert "mark as spam" in $post_actions[] for admins and moderators
gz_ak_viewtopic_preview_hook($post_actions, $cur_post['g_id'], $cur_post['id']);
/******** Post: pre-view hooks END ********/
See the example here: https://github.com/sevendays/fluxbb15-G … wtopic.php around line 330
Go to the admin panel and click on Plugins menu > GZ Akismet Cfg. Install the database table.
When done, insert your API key. Save. The API key is checked agains akismet to avoid your error log to fill up.
Rejoice and cheer, no spam on your forum!
Here is an image showing the spam queue: http://www.imagecross.com/d/image-hosti … kismet.jpg
Punirne cento per educarne uno.
Offline
Punirne cento per educarne uno.
Offline
Replaced every "require" with "require_once".
See http://fluxbb.org/forums/viewtopic.php?pid=50330#p50330 and my reply there.
Punirne cento per educarne uno.
Offline
Stavo scrivendo qui ma poi ho rinotato il thread ufficiale sul sito flux, quindi ho scritto lì
Offline
benvenuto lo stesso!
Punirne cento per educarne uno.
Offline
Hi! I've been having some problems installing this on the latest version of FluxBB. I've followed the procedures exactly, but when I click the button to create the gz_akismet_queue table I just get a screen saying "Error: Unable to create table fl_gz_akismet_queue. Please check your settings and try again.."
So I went through the php source and copies out the create table query, and replaced the db prefix variable with fl_. Created the table manually in phpmyadmin, and verified that it looked ok. Returned to FluxBB and the plugin page, but it still has the "Create table" button. How do I make it move on from this after manually adding the table?
Offline
Hi, I've made a new release and answered you in the fluxbb.org forum: http://fluxbb.org/forums/viewtopic.php?pid=55014#p55014
Punirne cento per educarne uno.
Offline
Pages: 1