PDA

View Full Version : Auto-Moderation by Keywords


Andreas
08-08-2005, 10:00 PM
<font size="3">Auto Moderation by Keywords</font>
Description
This Hack allows you to automatically place Posts under moderation that contain certain Keywords.
Moderators, Supermoderators and Admins are excempted.

The Keywords can be specified in ACP / vBulletin Options / vBulletin Options / General Settings.

Details
1 Product XML with 2 plugins and 1 Setting

Attention
The description Text for the setting is wrong!
Keywords must be entered separated by Comma (eg. bad,badword,spam)

Boofo
08-09-2005, 03:20 PM
This works without Moderating Posts/Threads turned on? What a great idea! ;)

Andreas
08-09-2005, 03:22 PM
If the Keyword is in a Post and the User isn't a Mod, Supermod or Admin it will be placed under moderation - no matter if Moderation for the Usergroup or Forum is turned on or not.

Marco van Herwaarden
08-09-2005, 03:23 PM
Just to bad that Kirby is not supporting it. :(

Andreas
08-09-2005, 03:24 PM
I am not "supporting" any of my Hacks ;)
Too time-consuming

Boofo
08-09-2005, 03:27 PM
Well, I guess I'll have to use it then and hope for the best. ;)

Maybe we ought to use it here for all of those clowns that can't spell my name right?

Marco van Herwaarden
08-09-2005, 03:32 PM
Well since you are our official Voodo doll, according to your sig, i guess you will just have to use some pins on them then, Beefy.

Boofo
08-09-2005, 03:35 PM
Oh, I see. We're playing the "let's change Boofo's sig" now. And whoever changed it needs to learn how to spell "Voodoo". ;)

And I think I'll keep it that way. ;)

Boofo
08-09-2005, 03:38 PM
Like my new sig line, Marco? ;)

Andreas
08-09-2005, 03:38 PM
/me kicks Boofo and MarcoH64 out of his Thread for posting OT

Please continue in the Lounge or via PM. Thank you.

Boofo
08-09-2005, 03:39 PM
Ok, but I'm taking this Mod with me.

Cyricx
08-09-2005, 03:46 PM
Schooled by the Kirby..

Awesome idea for a hack Kirby :)

Marco van Herwaarden
08-09-2005, 03:59 PM
Please continue in the Lounge or via PM. Thank you.
Why do you care, you are not supporting this anyway ;)






















PS Sorry, will continue somewhere else.

@Boofy :D

Boofo
08-09-2005, 03:59 PM
Well, I can't seem to get it to work. I placed a word in the box and the post with that word is not being moderated. It slipped right by. ;)

EDIT: Cancel that. I forgot to change my usergroup. Doh!!! ;)

jugo
08-09-2005, 04:08 PM
Is it Boofo or Bafoon?? j/k

Nicely done Kirby.

/me Installs.

Boofo
08-09-2005, 04:15 PM
Kirby, is there a way of letting us know when we veiw the post as an Admin that the post has been put in Moderation? Or did I miss it somewhere? And maybe highlight which word or words are on the list?

nexialys
08-09-2005, 04:28 PM
Reason for Moderation: filtered a bad word in this post - will be back as soon as possible - maybe!

oh btw, would be just great to have the alternative to shut it down depending on forums... like a Lounge where you can post about anything stupid!

Andreas
08-09-2005, 04:39 PM
@Boofo
It should show the Moderated Post Icon ... at least does for me :)

@nexialys
Hmm, making it show a reason would require DB changes I guess.
Adding an Option to Forum Manger to trun this off for certain Froums sounds pretty much doable.

Boofo
08-09-2005, 04:40 PM
@Boofo
It should show the Moderated Post Icon ... at least does for me :)

@nexialys
Hmm, making it show a reason would require DB changes I guess.
Adding an Option to Forum Manger to trun this off for certain Froums sounds pretty much doable.

I've never moderated posts before, I'm sure the icon is there. ;)

Andreas
08-09-2005, 04:43 PM
In the Postbit it's on the right, next to the Quick Reply Button.

Boofo
08-09-2005, 05:03 PM
In the Postbit it's on the right, next to the Quick Reply Button.

Ahhh, there it is now waving at me. :)

Thank you, sir. ;)

Boofo
08-09-2005, 06:05 PM
Would there be a way to make a post like this really stand out compared to like say a regualr moderated post? In case you have moderation turned on, it might be nice to know what posts were because of the keyword entered and not just moderated like normal. Does that make any sense? ;)

Andreas
08-09-2005, 06:18 PM
It does make sense - but it's not that easy, would require a new Flag in Post Table I guess.
But when I got time i'll take a look and see what's possible.

Boofo
08-09-2005, 06:19 PM
It does make sense - but it's not that easy, would require a new Flag in Post Table I guess.
But when I got time i'll take a look and see what's possible.

Couldn't we just do it as a conditional in the template?

Andreas
08-09-2005, 06:22 PM
Well, what condition would you like to check?
You only know it's in moderation - that's the same condition as for the Moderated Post Icon :)

Boofo
08-09-2005, 06:23 PM
Well, what condition would you like to check?
You only know it's in moderation - that's the same condition as for the Moderated Post Icon :)

Don't you have a badword variable in your mod for the words it looks for? ;)

Andreas
08-09-2005, 06:25 PM
Yeah, but to use this it would require checking the Post for it upon each Display ... hmm.

Boofo
08-09-2005, 06:27 PM
Yeah, but to use this it would require checking the Post for it upon each Display ... hmm.

Is that a good hmm or a bad hmm? ;)

Whatever way you come up with will be great, I'm sure. ;)

Martin
08-09-2005, 06:41 PM
this will be MUCH better than any of the spam filters :) Now I need to tie it to post count.

Boofo
08-09-2005, 06:43 PM
this will be MUCH better than any of the spam filters :) Now I need to tie it to post count.

I never thought to use it as a spam filter. Great idea! ;)

What would tying it to the post count do? And what words would you suggest for filtering spam?

Andreas
08-09-2005, 06:45 PM
@Boofo
You can give this a try:

Hook: postbit_display_start

if (!$post['visible'])
{
if (!$this->cache['automodkeywords'])
{
$this->cache['automodkeywords'] = explode(',', $this->registry->options['automodkeywords']);
}
if (str_replace($this->cache['automodkeywords'], '', strtolower($post['pagetext'])) != strtolower($post['pagetext']))
{
$this->highlight =& $this->cache['automodkeywords'];
$post['title'] = 'Automatically put under Moderation due to highlighted Keywords';
}
}

This should change the Post Title and highlight the Words.
To make it stand out further, you could overwrite the CSS Class here too, or set a $show Flag to check in postbit, or ...

@Martin
Brining Postcount into play is easy, just change the condition in the _presave Hooks to check $vbulletin->userinfo['posts']

Boofo
08-09-2005, 06:57 PM
Works like a charm! See the attached pic. ;)

What wouod you suggest to make it stand out further? I have no idea how to do what you suggested about the flag or css. ;)

Martin
08-09-2005, 07:06 PM
I never thought to use it as a spam filter. Great idea! ;)

What would tying it to the post count do? And what words would you suggest for filtering spam?

Well, most people who spam with crap like Free iPod, etc, register for that sole purpose.

If you added a check on post count, say less than 10 posts, it would auto-moderate the spammer's posts while allowing your real members to use words that might otherwise be filtered, like "free".

Just a thought.

Boofo
08-09-2005, 07:56 PM
Well, most people who spam with crap like Free iPod, etc, register for that sole purpose.

If you added a check on post count, say less than 10 posts, it would auto-moderate the spammer's posts while allowing your real members to use words that might otherwise be filtered, like "free".

Just a thought.

But if you have newer members that don't post alot, wouldn't that catch them, too?

It sounds like an interesting idea. I'd like to see what you come up with and try it, if you don't mind. It would come in handy on my new site and I will be dealing with a controverial issue and I don't need any spammers messing things up. ;)

Did you incorporate the post count code that Kirby gave you?

Boofo
08-09-2005, 07:57 PM
Kirby, how would I go about changing the css or whatever to make the post stand out?

And is there a way to make the icon different than the default for this (like the warning sign)?

Andreas
08-09-2005, 08:09 PM
$bgclass='classname';

But I guess this only works for postbit_legacy.
You can show any Icon or whatever you want, just set a Flag and check this in Template postbit *rolleyes*

Boofo
08-09-2005, 08:15 PM
$bgclass='classname';

But I guess this only works for postbit_legacy.
You can show any Icon or whatever you want, just set a Flag and check this in Template postbit *rolleyes*

You and your "Flags". ;)

Yes, I suppose I can do a conditional for the post icon.

I just thought of something, when Xenon does his Hide post except for staff Mod, he also check for post[visble]. Is there an AND we can use for this as not to interfere with that when it happens? And wouldn't an error message to the poster that his post is being moderated due to a word (or whatever) maybe keep him from reposting the message because he doesn't know why it isn't showing? ;)

Andreas
08-09-2005, 08:28 PM
Then he might just try to trick the Filter ... but of course this would be possible.
You'd have to make the check in build_new_post()

I did it in the Datamanager to also cover editing.

Martin
08-09-2005, 08:32 PM
Haven't tried it yet, I'm too busy with support stuff right now. Hell, my test board are still on RC1.

Thanks Kirby. I will play with it tonight when I have time :)

Boofo
08-09-2005, 08:36 PM
Then he might just try to trick the Filter ... but of course this would be possible.
You'd have to make the check in build_new_post()

I did it in the Datamanager to also cover editing.

Ok, I'll take your word for it. If you think it is fine as is, I'm good to go. ;)

Are you gonna add the code you posted for me to try to your Mod? There are others I'm sure that could use it. ;)

Boofo
08-09-2005, 08:37 PM
Haven't tried it yet, I'm too busy with support stuff right now. Hell, my test board are still on RC1.

Thanks Kirby. I will play with it tonight when I have time :)

I'm still running RC 1, also. I think I'll wait for the next version. ;)

Please let me know what you find out after playing with it. ;)

Kru
08-10-2005, 05:40 AM
I never thought to use it as a spam filter. Great idea! ;)

What would tying it to the post count do? And what words would you suggest for filtering spam?

mmh doesn't work for me. I put in a keyword. Then I login with my test account as a normal user. Made a post with the keyword in it and it still shows up?!

Neal-UK
08-10-2005, 06:16 AM
mmh doesn't work for me. I put in a keyword. Then I login with my test account as a normal user. Made a post with the keyword in it and it still shows up?!

not working on mine either with rc2

TCM
08-10-2005, 06:46 AM
You've got a typo in your setting. :P

If any of the Keywords listed here (separated by a Colon) does appear in a Post, the Post will automatically be placed under Moderation - no matter what Moderation Setting the Usergroup or Forum has.
Enter Keyowrds in lowercase only!

Neal-UK
08-10-2005, 07:26 AM
You've got a typo in your setting. :P

Just to clarify, I type the keywords in like this don't I?:

naughty:bad:naughtyword:badman:ship:yes

Princeton
08-10-2005, 01:22 PM
Great idea!!

Protoman
08-10-2005, 01:44 PM
This is exactly what I need! Now if there was the same thing for PM's I'd be set :D

Andreas
08-10-2005, 01:46 PM
Just to clarify, I type the keywords in like this don't I?:

naughty:bad:naughtyword:badman:ship:yes

@nealparry
No.
nautghty,bad,badman,ship

Will fix the description Text soon :)

ConqSoft
08-11-2005, 02:37 PM
Typo in Keywords: "Enter Keyowrds in lowercase only!" :D

Could this be made to be case-sensitive? For example, when spammers come on the site they usually post something is FREE, but I don't want to moderate every post that has the word "free" in it.

Andreas
08-11-2005, 02:43 PM
Hmm, it could ... but then you would have to enter every possible spelling you want to have filtered ...

ConqSoft
08-11-2005, 02:44 PM
Right.. I'm asking for it to allow for case-sensitive as well, hence looking for FREE and not free.

Boofo
08-11-2005, 03:36 PM
What if they used FrEe or fRee, or a million other combinations? Not really feasible. ;)

ConqSoft
08-11-2005, 03:38 PM
It's feasible to allow some way of defining which ones should be looked at as case-sensitive though.

Maybe:

{FREE},this,that,theother

Neal-UK
08-11-2005, 04:12 PM
@nealparry
No.
nautghty,bad,badman,ship

Will fix the description Text soon

Thanks Kirby, i'll reinstall thankyou

Rabbitoh Warren
10-15-2005, 04:14 PM
Does this work for vB 3.5.0 Gold?

intox
01-14-2006, 01:35 PM
This doesnt moderate thread , like if some1 use Keyword FREE blabla . The post gets moderated but the Thread is visible to other users too. Any way to also moderate the thread , and user gets a message like ur thread is under moderation.

IrPr
01-16-2006, 01:01 PM
works fine on 3.5.3 for me :) Special Thanks to KirbyDE :)

IrPr
02-26-2006, 12:21 PM
This doesnt moderate thread , like if some1 use Keyword FREE blabla . The post gets moderated but the Thread is visible to other users too. Any way to also moderate the thread , and user gets a message like ur thread is under moderation.

No suggestion yet?

IrPr
02-27-2006, 09:42 PM
ANY CODER THERE?!
I NEEEEEED THIS ASAP
some1 is attackin my forum using Proxy and i want this mod to moderate his/her threads
plz :(

IrPr
02-28-2006, 02:27 PM
Hey! Any1 there?!!!!!!!!!!!!!!!!!

Sal Collaziano
03-30-2006, 10:33 AM
I've been having a lot of people come to my forum asking for members to visit survey sites (as their first post).. I'd like to use this modification on the word "survey". However, it would be REALLY nice if I could allow my registered members with 25 posts or more to bypass the filter.. Is this at all possible?

royouth
06-29-2006, 08:20 PM
this would be the perfect solution if it included the first post in the thread to also be moderated.

tweakmonkey
10-15-2006, 10:35 PM
Nice plugin. It's useless for spam though (IMO) because most spammers start new threads instead of replying to others. I hope it gets updated some day to stop new threads from being posted.

Edit - this only happens on VB 3.6+ it seems. See my fix below.

Wongod
10-16-2006, 06:43 AM
Nice plugin. It's useless for spam though (IMO) because most spammers start new threads instead of replying to others. I hope it gets updated some day to stop new threads from being posted.

It already does

tweakmonkey
10-18-2006, 12:47 AM
Not for me. I run VB 3.6 though, which may be the reason.

Here's the fix for anyone who wants it to moderate new threads as well:
Open product-kwautomod.xml
Around line 12, find two occurences of 'pagetext' and change it to 'pagetext', 'post'

Here's the complete code including spelling and description fix if anyone wants it (I may post an updated version of the code later with more modifications):
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="kwautomod" title="Auto-Moderation by Keywords" description="This Hack allows you to automatically place Posts that contain certain Keywords under Moderation" version="1.0.0" active="1">
<codes>
</codes>
<templates>
</templates>
<plugins>
<plugin active="1">
<title>Auto-Moderation by Keywords: First Post/Thread</title>
<hookname>threadfpdata_presave</hookname>
<phpcode><![CDATA[if (str_replace(explode(',', $this->registry->options['automodkeywords']), '', strtolower($this->fetch_field('pagetext', 'post'))) != strtolower($this->fetch_field('pagetext', 'post')) AND !can_moderate())
{
$this->set('visible', 0);
}]]></phpcode>
</plugin>
<plugin active="1">
<title>Auto-Moderation by Keywords: Normal Post</title>
<hookname>postdata_presave</hookname>
<phpcode><![CDATA[if (str_replace(explode(',', $this->registry->options['automodkeywords']), '', strtolower($this->fetch_field('pagetext'))) != strtolower($this->fetch_field('pagetext')) AND !can_moderate())
{
$this->set('visible', 0);
}]]></phpcode>
</plugin>
</plugins>
<phrases>
<phrasetype name="vBulletin Settings" fieldname="vbsettings">
<phrase name="setting_automodkeywords_desc"><![CDATA[If any of the Keywords listed here (separated by a Comma) does appear in a Post, the Post will automatically be placed under Moderation - no matter what Moderation Setting the Usergroup or Forum has.<br />
Enter Keywords in lowercase only!]]></phrase>
<phrase name="setting_automodkeywords_title"><![CDATA[Auto-Moderation Keywords]]></phrase>
</phrasetype>
</phrases>
<options>
<settinggroup name="general" displayorder="30">
<setting varname="automodkeywords" displayorder="360">
<datatype>free</datatype>
</setting>
</settinggroup>
</options>
</product>


I posted this earlier instead (https://vborg.vbsupport.ru/showthread.php?p=1099436) that also stops people from posting a set # of URLs per post to further reduce spam. It also checks the number of posts a user has before applying the moderation.

JPnyc
01-04-2007, 06:48 PM
This thing works a treat, well done Kirby. However coming up with a comprehensive list of keywords is a killer.

JPnyc
01-04-2007, 06:52 PM
Darn, they're right, it prevents posts but not new threads on 3.5.7

Edit: however the fix works. Well done.

Smitty
03-28-2007, 07:53 AM
Has anyone tried this on vBulletin version 3.6.x?

ValorduX
05-01-2007, 09:24 PM
Yeah. And no it doesn't work. But try this one out:
https://vborg.vbsupport.ru/showthread.php?t=131568&page=4

It's the same thing, but with more features.

Smitty
05-02-2007, 12:56 AM
Yeah. And no it doesn't work. But try this one out:
https://vborg.vbsupport.ru/showthread.php?t=131568&page=4

It's the same thing, but with more features.

Thanks! Looks valuable!

Boofo
05-21-2007, 10:47 PM
Darn, they're right, it prevents posts but not new threads on 3.5.7

Edit: however the fix works. Well done.

Not on 3.5.4, it doesn't. I keep getting an invalid thread error after submitting a new thread post with the word in it.

sonic83
05-08-2013, 05:56 PM
Hi, it works for vbulletin 4.2.1?

thanks:)