Your ultimate PunBB resource!
You are not logged in.
## ## ## 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. ## ##
Offline
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
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
// 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
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