vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=281400

I want to share my autoban code
by semprot
11 Apr 2012 02:55

I want to share my autobanning code. If it detects a word on a post, the poster will be banned. I attach the code on "postbit_display_complete" hook. On the code below, i only use strpos() to detect but you can change it to preg_match.

Here is the code

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can modify & reuse this code on your product :)

SEOvB 11 Apr 2012 20:22

Cool stuff, thanks! If you added it in the mods section, it may be easier for people to find.

-Nick, SEOvB Developer

semprot 12 Apr 2012 03:21

Quote:

Originally Posted by SEOvB (Post 2319134)
Cool stuff, thanks! If you added it in the mods section, it may be easier for people to find.

-Nick, SEOvB Developer

It's still far from publicly shareable mods, no option page yet to input magic words to catch, etc.
I hope someone will reuse this code and make a mod from this :)

Boofo 12 Apr 2012 05:57

A better idea would be to have it send a PM to the admin (or set userid) when a magic word appears in a post. That way it can be investigated as the magic word in the post might not be in the same context as you would think it should be.

akanevsky 08 Jun 2012 13:42

I agree with Boofo, and also I think that it might be a better idea to run this on post (if the post is not moderated). That way, the function won't run on every single post every single time, as you have it now. So just move it to a different hook with slight modifications, I guess.

In addition, it might be nice to switch the two conditions in the outer if statement, because checking for whether a usergroup is in a list of two items is a lot faster than checking for a word in a long post.


All times are GMT. The time now is 00:01.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.