PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2006-05-26 13:56:37

505
Member
Registered: 2005-02-04
Posts: 13

Forbidden word spam blocker 1.0.0

Code:

##
##
##        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.
##
##

Download here

Offline

 

#2 2006-10-06 21:31:47

fdsa
Member
Registered: 2006-10-04
Posts: 21
Website

Re: Forbidden word spam blocker 1.0.0

when i install the mod_install.php
it gave me a tip that it only support Mysql Database,but i'm using mysql now


光宇游戏推广人

Offline

 

#3 2006-10-07 01:21:48

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1259

Re: Forbidden word spam blocker 1.0.0

isnt this sort of what Censoring is for hmm


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#4 2006-10-07 15:00:58

Cursedxx
Member
Registered: 2006-09-16
Posts: 21

Re: Forbidden word spam blocker 1.0.0

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

 

#5 2006-10-08 05:51:23

SDTux
Member
From: Russia, Ekaterinburg
Registered: 2006-01-24
Posts: 23
Website

Re: Forbidden word spam blocker 1.0.0

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

 

#6 2006-10-08 06:16:42

StevenBullen
Administrator
Registered: 2005-09-13
Posts: 345
Website

Re: Forbidden word spam blocker 1.0.0

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. wink

Install_mod dont work tho as stated before.


Blog - Follow Me and FluxBB on Twitter

Offline

 

#7 2006-10-08 09:06:33

SDTux
Member
From: Russia, Ekaterinburg
Registered: 2006-01-24
Posts: 23
Website

Re: Forbidden word spam blocker 1.0.0

StevenBullen, suck, you're right - install script didn't create that table, if anyone have such problem make this SQL-query:

Code:

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:

Code:

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

 

#8 2006-10-08 09:13:05

SDTux
Member
From: Russia, Ekaterinburg
Registered: 2006-01-24
Posts: 23
Website

Re: Forbidden word spam blocker 1.0.0

Yahoo!!! It's great! No problems with russian language, and very easy.
THNX a lot for this mod.

Offline

 

#9 2006-10-08 10:17:06

SDTux
Member
From: Russia, Ekaterinburg
Registered: 2006-01-24
Posts: 23
Website

Re: Forbidden word spam blocker 1.0.0

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:

Code:

#
#---------[ 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:

Code:

'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:

Code:

'Remove spam word'    => 'Сработала защита от спама. Удалите фразу <u>%s</u> из вашего сообщения.',

Last edited by SDTux (2006-10-08 10:24:31)

Offline

 

#10 2006-10-08 10:38:46

StevenBullen
Administrator
Registered: 2005-09-13
Posts: 345
Website

Re: Forbidden word spam blocker 1.0.0

StevenBullen wrote:

I am popping out but I will put the live demo I have up when I get back. wink

Done - http://www.pundemo.org/viewtopic.php?id=67


Blog - Follow Me and FluxBB on Twitter

Offline

 

#11 2006-10-14 00:16:11

fdsa
Member
Registered: 2006-10-04
Posts: 21
Website

Re: Forbidden word spam blocker 1.0.0

ive got that error when i add a spam word to that.

Code:

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

 

#12 2006-10-16 06:24:50

505
Member
Registered: 2005-02-04
Posts: 13

Re: Forbidden word spam blocker 1.0.0

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

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.