Your ultimate PunBB resource!
You are not logged in.
## ## ## Mod title: Forbidden word spam blocker ## ## Mod version: 1.0.0 ## Works on PunBB: 1.2.x ## Release date: 2006-05-26 ## Author: Daniel Vijge <vijge@dse.nl> ## ## Description: This mod allows forum administrators and moderators ## to forbid certain words to be in a post. When such a ## is used in a post a warning is displayed and the message ## cannot be posted until that word is removed. ## This can be used to stop spam bots from posting on ## your forum. Just set part of the message they post ## as a forbidden word. ## ## Affected files: post.php ## lang/English/post.php ## lang/[...]/post.php (when more languages are installed) ## ## Affects DB: Yes ## ## Notes: 1) To add a spam word, go to the forum administration page ## and click on 'Spam word'. This page is available for ## both administrators and moderators ## 2) Be carefull what words you block. For example, if you ## block 'foo', users can't post message containing 'foobar'. ## ## DISCLAIMER: Please note that "mods" are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## ##
Offline
this mod seems very useful censoring just ****'s the word this mod apparently makes it where if you have a bad word in the post it will make you fix it before allowing you to post.
Offline
I've had the same problem as fdsa had, but it's easy to solve it. Unfortunatelly, mod doesn't work, but it will call a white clean page after you'll press a Submit button. And there's no words in cache-file at all even if I enter some of them.
Pershaps it's my error, but I couldn't see a place where I could go wrong.
Offline
Works fine.
Check to make sure you have the spamwords table in your DB. I am popping out but I will put the live demo I have up when I get back. ![]()
Install_mod dont work tho as stated before.
Offline
StevenBullen, suck, you're right - install script didn't create that table, if anyone have such problem make this SQL-query:
CREATE TABLE ".$db->prefix."spamwords (id INT( 11 ) NOT NULL AUTO_INCREMENT ,word TEXT NOT NULL ,PRIMARY KEY ( id )) TYPE = MYISAM
where you must replace ".$db->prefix." with the prefix of your punbb database, in my case that would be so:
CREATE TABLE punbbspamwords (id INT( 11 ) NOT NULL AUTO_INCREMENT ,word TEXT NOT NULL ,PRIMARY KEY ( id )) TYPE = MYISAM
Now, I'm testing it with english and russian block-words.
Offline
Hmm, I've found, that spam-protection doesn't work when you edit post. It's not major, but I think, it would be better to fix it this way:
#
#---------[ 10. OPEN ]---------------------------------------------------------
#
edit.php
#
#---------[ 11. FIND (line ~97) ]---------------------------------------------------------
#
// Validate BBCode syntax
#
#---------[ 12. ADD, BEFORE ]---------------------------------------------------------
#
// simple spam filter
$pun_spamwords = array();
@include('cache/cache_spamwords.php');
foreach ($pun_spamwords as $word)
{
if(substr_count(strtolower($message),strtolower($word)))
{
$errors[] = sprintf($lang_post['Remove spam word'],$word);
}
}
#
#---------[ 13. SAVE/UPLOAD ]-------------------------------------------------
#Also, i think it would be more informative to make an accent on words that need to be removed, for example:
'Remove spam word' => 'This is a protection against spam bots. Delete the word <u>%s</u> from your message.',
For russian language you can use this:
'Remove spam word' => 'Сработала защита от спама. Удалите фразу <u>%s</u> из вашего сообщения.',
Last edited by SDTux (2006-10-08 10:24:31)
Offline
StevenBullen wrote:
I am popping out but I will put the live demo I have up when I get back.
Offline
ive got that error when i add a spam word to that.
Warning: fopen(cache/cache_spamwords.php) [function.fopen]: failed to open stream: Permission denied in /home/xxx/public_html/plugins/AMP_Spam_words.php on line 47 Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/plugins/AMP_Spam_words.php on line 61 Warning: fclose(): supplied argument is not a valid stream resource in /home/xxx/public_html/plugins/AMP_Spam_words.php on line
and then the new word i added been useless ..they can post that word.
Last edited by fdsa (2006-10-14 00:18:50)
Offline
Sorry I haven't kept myself updated on the comments on my release.
I've uploaded a new version with the comments from this thread. I hope everything now works the way it should.
fdsa: looks like your webserver does not have permission to write to the disk. Make sure you CHMOD the /cache directory to make is writeable.
Offline