Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
FractalizeR: Extended Post Censor Details »»
FractalizeR: Extended Post Censor
Version: 0.9, by FractalizeR FractalizeR is offline
Developer Last Online: Nov 2014 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.8 Rating:
Released: 11-11-2007 Last Update: Never Installs: 28
Uses Plugins
Translations Is in Beta Stage  
No support by the author.

What this hack does?
This hack is a post censor, that will replace unwanted words and phrases by the values you specify.

Features:
  • Supports standard replace
  • Supports replacing using regular expressions
  • Allows to apply censor only to specified usergroups
  • On-the-fly regular expression syntax checking

Some use cases:
  • I don't like posts with multiple exclamation or question marks. Maximum three signs is allowed.
  • Sometimes you ban competitor forum names from using on your forum. But users enter them separating letters by spaces or underscores. This is unwanted and it is difficult to deal with using standard censor
  • Any forms of curses and bad words should be replaced by XXX

Version was tested under VB 3.6.8, but supposed to work on any 3.6.x release. Please report all compatibility issues here.

Please look at control panel screenshot below (please mind, that I am russian and screenshots are from russian forum, so for example usergroup names are incorrectly displayed when I set langauge to English).

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 11-14-2007, 07:16 AM
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Location: Russia, Moscow
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, '?' is a special sign in regular expressions language that means, that preceding symbol can be in string, or can be omitted. You need to escape it by '\' to use as a string.
To replace many question marks by some string use the following regex:

'/\?{3,}/' => '???'

The expression in {} tells, that preceding symbol is repeated three or more times. We can write {,3} for example and it will mean, that something repeated up to three times. We can specify {3,6} and it will mean, that something is repeated from 3 to 6 times.

dot (".") means one any symbol.
plus ("+") means, that preceding symbol or expression is repeated one or more times. It is actually equal to {1,}.
asterisk ("*") means, that preceding symbol or expression is repeated zero or more times.

\d - means one any digit.
\s - means any space character

For example we can replace multiple spaces by one:
'/\s+/' => '' " - remember, + means "one or more"

If you need to apply + or * or any other "quantifier" to several characters you need to put these characters into brackets:

/(abc)+/ => "abc" - replace one or more abc sttrings by one copy so that "abcabcabc" becomes "abc"

So, about your case - yes, all correct, just escape ? by \
Reply With Quote
  #13  
Old 11-14-2007, 12:34 PM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it, thanks so much!

One question, since I can't test this until my site goes live... does this work in post preview, or just when they submit the post?
Reply With Quote
  #14  
Old 11-14-2007, 01:55 PM
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Location: Russia, Moscow
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, censor makes no changes to DB. So, words are replaced on post is displayed.
Preview is not affected preventing users from experimenting with filter faking.
Reply With Quote
  #15  
Old 11-14-2007, 02:50 PM
mrkiwi mrkiwi is offline
 
Join Date: Jun 2007
Location: Russia, Saint-Petersburg
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi!
Tell me please, is it possible to censor/replace the whole message, if it contains unwanted word?
Thanks )
Reply With Quote
  #16  
Old 11-14-2007, 04:23 PM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FractalizeR View Post
Actually, censor makes no changes to DB. So, words are replaced on post is displayed.
Preview is not affected preventing users from experimenting with filter faking.
Awesome, thank you! That's what I was afraid of, if it happened during preview
Reply With Quote
  #17  
Old 11-14-2007, 05:22 PM
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Location: Russia, Moscow
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mrkiwi View Post
Hi!
Tell me please, is it possible to censor/replace the whole message, if it contains unwanted word?
Thanks )
Hi. Yes, actually, it is. Try to make it by such regex:

'/.*UnwantedWord.*/' => 'I don't like this message!'
Reply With Quote
  #18  
Old 11-14-2007, 05:23 PM
tobybird's Avatar
tobybird tobybird is offline
 
Join Date: Jul 2006
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Interesting concept and one our forums could benefit from if the follow works as desired.

What would happen if you wanted to replace the "U" with "You" in the following sentence: "U should bring an umbrella."

Would the outcome be "You should bring an umbrella." or You shoyould bring an youmbrella."?
Reply With Quote
  #19  
Old 11-15-2007, 02:46 AM
Elenna Elenna is offline
 
Join Date: Jan 2006
Location: St. Charles, MO
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is working nicely, thank you!
How would I have it reduce
"?!?!?!?!?" to just "?!"

I kno wmy members will 'get around' it by alternating them. :P
Reply With Quote
  #20  
Old 11-15-2007, 05:29 AM
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Location: Russia, Moscow
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tobybird View Post
Interesting concept and one our forums could benefit from if the follow works as desired.

What would happen if you wanted to replace the "U" with "You" in the following sentence: "U should bring an umbrella."

Would the outcome be "You should bring an umbrella." or You shoyould bring an youmbrella."?
In this case we need to change a single "u" with "you". You can try this one:
/\w+u\w+/ =>"you"
\w - is any "non-word" character

Quote:
Originally Posted by Elenna
This is working nicely, thank you!
How would I have it reduce
"?!?!?!?!?" to just "?!"
I kno wmy members will 'get around' it by alternating them. :P
Make it like:
"/((\?\!)|(\!\?))+/" = > "?!"
It means, replace any number of "?!" or "!?" sequences by single "?!". "|" - means "or"

Small update: to prevent users from using different combinations of "!", "?" and spaces one may try something like this:
"/((\!\s*)|(\?\s*)){3,}/" => "Exclamation!"
Reply With Quote
  #21  
Old 11-15-2007, 09:13 AM
mrkiwi mrkiwi is offline
 
Join Date: Jun 2007
Location: Russia, Saint-Petersburg
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FractalizeR View Post
Hi. Yes, actually, it is. Try to make it by such regex:

'/.*UnwantedWord.*/' => 'I don't like this message!'
Thanks.

But i have the same problem as brandondrury
same mistakes and no messages on my forum shown at all.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05207 seconds
  • Memory Usage 2,314KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete