Stop spam bots from posting Links as Guest users in a PHPBB3 Message Board

CLASSIC PC | YOU DO SUCCEED | DOWNLOAD | FAQ LIBRARY
LINKS | LINUX | MAIN MENU | PS2 | REFERENCE | USENET

To stop spam bots from posting Links as Guest users in a PHPBB3 Message Board, use this code:

in posting.php, after :

Code: Select all
if (sizeof($message_parser->warn_msg))
  {
     $error[] = implode('<br />', $message_parser->warn_msg);
  }

add:

Code: Select all

//=== TOO: Anti-Spammer BEGIN
  if (isset($post_data['poster_id']) && $post_data['poster_id'] == ANONYMOUS)      // Guest ?
  {
     $NbH = substr_count($message_parser->message, "href=");
     $NbU = substr_count($message_parser->message, "[/url");

     if ($NbH + $NbU >= 1)
     {
        $error[] = "Guests can't post link..!<br />Create an account (it's free), or remove the link(s) from your post.<br />"
//                  ."NbH = $NbH; NbU = $NbU<br />"
//                  .$message_parser->message
                 ;
     }
  }
//=== TOO: Anti-Spammer END