The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Keyword weight based spam detector Details »» | |||||||||||||||||||||||||
I coded this one because I constantly had to moderate and / delete them lengthy lame cell phone ads on vBulletin.com's forums and my own forums. You know, buy iphone, ipod touch, noika blah blah blah sony ericsson blah blah blah etc. etc. etc. email us, we're legitimate business in a country you've never heard of, blah blah blah spam.
While Akismet does work on filtering them out, some times they still leak through. I know there's two other keyword based tools that automatically adds things to moderation queue (One from SirAdrian and one from tweakmonkey), but it doesn't work too well for me, because I run an iPhone / iPod Touch site and I can't have those keywords on auto spam for simply appearing. So, here's what I did for mine... What does this product do?
How does it work? 1) You configure your keyword list, and score weight. For example, I use this list: Code:
Nokia|0.5 iPhone|0.5 iPod Touch|0.5 Order|0.5 HTC|0.5 Samsung|0.5 Sony Ericsson|0.5 hotmail|0.5 $|0.5 usd|0.5 url|0.3 email|0.5 2) You configure your moderation score, for example, I use 50. 3) You configure your rejection score, for example, I use 100. 4) You configure your exemption post count, for example, I use 5. When a new post is being created (this could be a thread, or a reply, doesn't matter, they both trigger newpost_process hook), the plugin will count how many times each keyword appears, and total the score. If it is higher than or equal to the moderation score, it will tuck the post into moderation queue. If it is higher than or equal to the rejection score, a standard vBulletin error message is shown to the user. How much overhead does this add? Realistically, not much... depending on amount of keywords used, I'd say most likely under 0.05 seconds of your CPU time for each post. If you are really that worried, you can set your exemption post count to something lower, and so lesser posts are scanned. Default is 5 right now. This have been tested on 3.7.0 Beta 5, and 3.7.2. I see no reason why it would not work on 3.6.x series, too. Change log 0.0.0 => 0.1.0
Show Your Support
|
Comments |
#32
|
|||
|
|||
This is excellent, thanks a million times!
|
#33
|
|||
|
|||
Slight problem: I see it's not working for ''partial' words- i.e. if I blocked' nike', and someone spams 'nikefun', then his post goes through...
Can you add that it will block any instance of it even if it's part of another word? |
#34
|
|||
|
|||
Would something like this work for vb4?
|
#35
|
|||
|
|||
Does this work with vb4? This would be perfect for the issue we're having with people advertising handbags and Uggs.
|
#36
|
|||
|
|||
I just installed this on vBulletin 3.8.9. It seems to work well. I found one bug though which I think affects all vBulletin versions. If you set the Reject threshold to 0 to disable rejections the moderation will also be disabled, so if you do not want to use reject you should instead set the reject threshold to something very high. I can see in the source code that this is a bug. It wouldn't be very difficult to correct it, but just using a very high reject threshold also works.
|
#37
|
|||
|
|||
I have discovered an annoying bug in the edit part of this script. Here is an example of when the bug occurs:
1. A spammer first posts a message without any spam keywords so that a new thread and a new post is created 2. The spammer then returns and edits his message and adds spam keywords to the post 3. The filter then auto-moderates the post using the following code linked to the "editpost_update_process" hook: $dataman->set('visible', 0); $edit['visible'] = 0; 4. If the edit has been done within the time-limit when no "Edited by..." is displayed and the old version of the post is not saved then this will result in a visible thread that contains no posts visible for normal users. There is a post there, but the spam keyword filter has unapproved it so it is not visible for normal users. I think that I have found a solution to this. I have disabled the "editpost_update_process" hook used in this mod and I have instead written my own routine for the "editpost_update_complete" hook. My code only works with moderation, since I only use moderation and the php code for this new hook looks like this: Code:
if ($vbulletin->userinfo['posts'] < $vbulletin->options['kwas_antispam_posts']) { $scan = strtolower($edit['message']); $keywords = explode("\r\n", strtolower($vbulletin->options['kwas_keyword_weights'])); $total = 0; foreach($keywords as $keyword) { $keyword = explode("|", $keyword); $total += substr_count($scan, $keyword[0]) * $keyword[1]; } if (($total >= $vbulletin->options['kwas_moderate_threshold']) &&($total < $vbulletin->options['kwas_reject_threshold']) && $vbulletin->options['kwas_moderate_threshold']) { require_once(DIR.'/includes/functions_databuild.php'); unapprove_post($postinfo['postid'],($foruminfo['countposts'] AND !$post['skippostcount']), true, $postinfo, $threadinfo, false); } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|