PDA

View Full Version : Mini Mods - spam from new users


kermit2
10-27-2008, 10:00 PM
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)



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 . "\"]" .
$vbulletin->userinfo['username'] . " (\"/forum/member.php?u=" . $vbulletin->userinfo['userid') has been auto-unapproved:
" . $post['message'] . "\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:

else
{
$dataman->set('visible', 1);
$post['visible'] = 1;
}

and just before:

if ($type != 'thread')
{
if ($postinfo['postid'] == 0)
{

More info at http://linuxbox.co.uk/vbulletin_spam_hack.php

FReeSTER
10-27-2008, 10:39 PM
I will look into this, seen to be a nice add.

kermit2
10-27-2008, 10:50 PM
Of course I should also have said that you need to change the MySQL query to reflect the threadid and username/userID of the user/thread in which you'd like the notification post to appear.

nfn
10-28-2008, 04:06 PM
There's already some mods that do this:
https://vborg.vbsupport.ru/showthread.php?t=173490

Q-v-n-s-Q
11-22-2008, 04:27 AM
check it out latter