spam from new users

mastram

New Member
Not so much a plugin, more a little code modification. It moderates any first posts which contains 'www' or 'http' and posts the post to a thread of your choice (presumably in a private forum) - the idea being that you can re-approve any false positives. Simple I know, but it has cut out the majority of my spam.

The change goes in includes/functions_newpost.php , around line 353 (depending on your VB version)



Code:
if ($vbulletin->userinfo['posts'] == 0) {

        if ((strpos($post['message'], "http") > 0) || (strpos($post['message'], "www.") > 0) || (strpos($post['message'], "www ") > 0) ) {

                $dataman->set('visible', 0);
                $post['visible'] = 0;

        $pete_post = "The following post by [url="http://%5c%22/forum/member.php?u=%22%20.%20$vbulletin-%3Euserinfo%5B%27userid%27"] . "\"]" .
            $vbulletin->userinfo['username'] . "[/url] has been auto-unapproved: [INDENT]
  " . $post['message'] . "

  [/INDENT]\n";

        $vbulletin->db->query_write("INSERT INTO post (threadid, parentid, username,userid, pagetext, dateline, visible) VALUES
            (162262, 0, 'bot', 183720, \"" . mysql_escape_string($pete_post) . "\", " . time() . ", 1)");

        $vbulletin->db->query_write("UPDATE thread SET replycount=replycount + 1 WHERE threadid='162262'");

        }
}
just after:


Code:
       else
        {
                $dataman->set('visible', 1);
                $post['visible'] = 1;
        }
and just before:


Code:
if ($type != 'thread')
        {
                if ($postinfo['postid'] == 0)
                {
More info at Linuxbox.co.uk
 
Top