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-10-16 06:15:36

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

Forbidden word spam blocker 1.0.1

Code:

##
##
##        Mod title:  Forbidden word spam blocker
##
##      Mod version:  1.0.1
##   Works on PunBB:  1.2.x
##     Release date:  2006-10-16
##           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 word
##                    is used in a post a warning is displayed and the post
##                    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
##                    edit.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'.
##                    3) Spam words that should be blocked are cached in
##                    cache_spamwords.php When you upgrade PunBB to a newer version
##                    all cache files are deleted, including cache_spamwords.php
##                    Go to the admin panel, select the spam words option and
##                    click on Add to regenerate the cache file.
##
##       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-16 06:28:48

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

Re: Forbidden word spam blocker 1.0.1

What's new in this release:
- Error in install_mod.php fixed.
- Check for forbidden words when editing posts
- Display forbidden words in admin panel that include source code (e.g. forbid '<a href=')
- Do not insert blank words when press Add with no word in the input box
- Added comment about updating PunBB. Cache files are deleted when you update PunBB. Use the Add button in the admin panel (with no word in the input box) to regenerate the cache file

Offline

 

#3 2006-10-17 23:50:23

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

Re: Forbidden word spam blocker 1.0.1

check that, ...

1. on signature do not allow to use Forbidden word
2. on title do not allow to use Forbidden word.


i can not do that


光宇游戏推广人

Offline

 

#4 2006-10-21 08:51:24

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

Re: Forbidden word spam blocker 1.0.1

fdsa: I won't make a new release now, but it should be easy to do what you want.
If you also want to forbid words in the title of posts, open 'post.php' (where this mod is already applied to), find the line

if(substr_count(strtolower($message),strtolower($word)))

and replace it with

if(substr_count(strtolower($subject . ' ' . $message),strtolower($word)))

Do the same for the file edit.php.

To enable it for signatures, open the file 'profile.php' Find the line

// Validate BBCode syntax

And above this line, paste

Code:

    // simple spam filter
    $pun_spamwords = array();    
    @include('cache/cache_spamwords.php');
    foreach ($pun_spamwords as $word)
    {
        if(substr_count(strtolower($form['signature']),strtolower($word)))
        {
            message(sprintf($lang_prof_reg['Remove spam word'],$word));
        }
    }

Open the file /lang/[...]/prof_reg.php and add the following line

'Remove spam word'    => 'This is a protection against spam bots. Delete the word %s from your signature.',

Last edited by 505 (2006-10-21 08:54:06)

Offline

 

#5 2006-10-22 20:19:38

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

Re: Forbidden word spam blocker 1.0.1

i've got another problem.

when i add a word to plugin ,

it display nothing,just refresh the page,then the word didn't been added. there is no erro msg.


光宇游戏推广人

Offline

 

#6 2006-10-29 03:44:56

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

Re: Forbidden word spam blocker 1.0.1

fdsa wrote:

i've got another problem.

when i add a word to plugin ,

it display nothing,just refresh the page,then the word didn't been added. there is no erro msg.

Damn, stupid me, why can't I just release files without any errors in it?
Anyway, I reuploaded the mod, this works correct. If you want to update an existing installation, open /plugins/AMP_Spam_word.php, and replace, on line 75, $POST with $_POST.

It's a small type, but it makes all the difference ;-)

Offline

 

#7 2007-04-25 10:04:05

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

Re: Forbidden word spam blocker 1.0.1

Naitkris released an improved version of this plugin. You can get this new version here.

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.