Spam

Discussing the forum, suggestions, criticism etc.
Locked
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Spam

Post by pepak »

The one simple solution to spammers that seems to work quite well is to modify the forum software to prevent posts with URLs if a user is either anonymous or has few posts (I use 3 and less). It is very easy to do and it does prevent most spam (I combine it with a list of banned words, such as certain medicines to improve certain biological characteristics, but the URL-prevention seems to be effective even without them).

It requires a tiny change in includes/functions_post.php in function prepare_post() - something like

Code: Select all

if ((intval($userdata['user_posts']) <= 3) || ($userdata['uname'] == 'Anonymous'))
  if ((eregi('https?://', $message) OR (eregi('www\.', $message)))
    $error_msg .= 'New users may not post URLs';
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

pepak
Thanks. I'll try.
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Post by pepak »

t-rex wrote:pepak
Thanks. I'll try.
You may need to check the contents of $userdata first - I am using phpBB which came with PhpNuke version 5.something, so I am pretty certain the actual variable names will be somewhat different (such as maybe $userdata['user_name'] instead of $userdata['uname']) - just use

Code: Select all

print_r($userdata);
to display the actual content and look for variables which relate to user's name and user's number of posts. If you need help, ask.
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

pepak
Well, I'm not that stupid. :roll:
I also added code to disallow to set webpage, interests and signature for new users - this I hope will prevent 90% of spammers from even registering.
Locked