Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
User-optional Replacements-based Censorship Details »»
User-optional Replacements-based Censorship
Version: 1.00, by tjdrico tjdrico is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-13-2004 Last Update: Never Installs: 21
 
No support by the author.

User-optional Replacements-based Censorship Hack
================================================

Rationale:
----------

Some of my forum members wanted a swear filter for use at work, but others didn't. I searched for a hack that could do that and I saw a similar hack ( https://vborg.vbsupport.ru/showthread.php?t=53640 ) by 006 but that's for vB 2.2.* and I have vB 3.0.0. I started to look at the hack to install it but it looked significantly different from the code I had for vB, so I thought it'd be simpler to write a new version for vB 3 from scratch. This is it.

Description:
------------

The "bad words" censorship filter built in to vBulletin has at least three drawbacks:

1. It's all or nothing - all users are subject to the censorship whether they choose to be or not.

2. Censored words are replaced by asterisks and are not recoverable, even if the censorship is subsequently removed.

3. There is only a single list possible, where a forum administrator may wish different censorship lists within different styles (if they relate to different fora, for example).

This hack is a solution.

Based upon the built-in Replacement Variables system, this hack enables individual users to specify whether they want to view censored posts or not. Even if the Administrator chooses not to censor his forum, individual members sometimes prefer some words to be censored because they view in an office environment and Web proxies log certain words, or because minors may be present and read the screen.

Using his own "Edit Options" page, a member of your forum can turn his censorhip on or off unilaterally, and because of the way the replacements system works this is an entirely reversible operation. He can view censored posts at work, then log in at home and turn the censorship off again to view the posts as intended.

Also because of the way the replacements system works, censorship should take place in thread titles as well as posts.

If there are words that simply must be censored for all users, the built-in global censorship system can deal with that.

Caveats:
--------

Using the Replacement Variables system in this manner may preclude its use from any other function.

I have no useful information relating to how much additional load this will put in your server. I would imagine it would be minimal if the list of words is short or most users have censorship turned off.

Hack Information:
-----------------

Queries to run: 1
Files to modify: 2
Templates to modify: 1
Phrases to add: 4

Estimated time to install hack: 5 minutes

As ever, please take sensible precautions before installing this hack; back up your database and files beforehand. I have tested this hack on my own forum and my test forum and found it to be fine, but I am not responsible for the application of any hack I don't do myself.

For support, please use this thread or email me if you don't get a response. Thanks.

Daren "Rico" Chandisingh
rico[at]justice-department.org.uk
http://www.respawned.co.uk/forums/

Show Your Support

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

Comments
  #22  
Old 04-20-2004, 04:17 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Oblivion Knight
It doesn't appear to be working for me..

I'm using 3.0.1.. The Microstats hack also touches the same area of code in includes/functions.php, but I don't think that's the cause of it. The censor is disabled in the Admin CP, and tested on my account to enable the censor option - and the words are still visible uncensored..

Any ideas?
This hack doesn't use the vBulletin censorship system at all, so that would make no difference at all whether it's on or off. To get words filtered or replaced using this hack you must enter each one into the Replacement Variables system. It's a bit of a pain if you have a long list of words, but it is flexible and means that rather than have just asterisks (as with the vB censorship system) you can replace one word with another. For example, m*therf**ker could be replaced by muddyfunster.

I can't think of a reason why it wouldn't be working for you off the top of my head. I haven't upgraded my forum to 3.0.1 yet, nor do I have Microstats applied. All I can say is it "should work" if you've followed the instructions correctly, to the best of my knowledge.

If anyone else has had problems installing this, I'd be grateful to hear about it.
Reply With Quote
  #23  
Old 04-20-2004, 04:22 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh.. I thought it used the forum's censored words and bypassed the off switch.

My apologies.. I'm not with it at the moment.!


Unfortunately, doing it via replacements censors "ass" in password for example.. Bah, it's a nice idea - but not quite what I wanted.
Reply With Quote
  #24  
Old 04-21-2004, 01:13 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just remembered why I disabled it for titles. The fact that, like Obliviaon Knight said, parts of words are censored, such as "ass." That's the same problem I ran into. No worries though. it's still better than the permanent *** censor. I will install this later tonight when I get home from work.
Reply With Quote
  #25  
Old 04-21-2004, 01:54 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe, fair comment. Where I live, "ass" is more likely to mean donkey than buttocks, so I don't even regard it as a candidate for censorship.

However, if it posed a problem, an administrator should be able to get round it by using 3 replacements. For example:

1. ass -> donkey

This has the undesired side-effect of changing password to "pdonkeyword" and "class" to "cldonkey". The abomination of "class" means that a lot of the CSS stuff up. However, if the admin also includes:

2. cldonkey -> class
3. pdonkeyword -> password

Then everything's fine. "ass password" gets rendered as "donkey password", and all the class= definitions in the source are also correct.

Whether an admin can be bothered to add a couple of extra replacements to "correct" any such problems really depends on how important the optional censorship is.
Reply With Quote
  #26  
Old 04-25-2004, 07:27 AM
Eternal2u Eternal2u is offline
 
Join Date: Feb 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a very nice hack, i myself find it EXTREMLY aggrvating that i have to view edited ++++ even though i like to curse myself, therby not really caring if others do as well..
Reply With Quote
  #27  
Old 05-01-2004, 11:13 PM
Curll's Avatar
Curll Curll is offline
 
Join Date: Apr 2003
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I turn on filtering by default to my registered users?
Reply With Quote
  #28  
Old 05-04-2004, 05:11 AM
zsmom's Avatar
zsmom zsmom is offline
 
Join Date: Sep 2003
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't appear to be working for me either and I went back and double, and triple-checked that I followed the instructions correctly. I also have 3.0.1 and Microstats installed, not sure if there's a correlation or not. It just censors words for everyone, regardless of the setting in their control panel.

I'd love to use this, we have a few potty mouths (me included) and a few others quite the opposite and this would be perfect!
Reply With Quote
  #29  
Old 05-05-2004, 06:46 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Curll
How do I turn on filtering by default to my registered users?
You can do this by using the following SQL instead of the line in the instructions:

Code:
ALTER TABLE user ADD usereplacementscensor TINYINT(1) NOT NULL DEFAULT '0' AFTER pmunread;
If you have already added this new column, you can set all the existing users to use the censorship by default using this:

Code:
ALTER TABLE user ALTER COLUMN usereplacementscensor SET DEFAULT '1';

UPDATE user SET usereplacementscensor=1;
This will set everyone to be using the censorship filter, and make it the default for all new users. Anyone that had it turned off will have to turn it off again if they want it that way.
Reply With Quote
  #30  
Old 05-05-2004, 06:48 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zsmom
It doesn't appear to be working for me either and I went back and double, and triple-checked that I followed the instructions correctly. I also have 3.0.1 and Microstats installed, not sure if there's a correlation or not. It just censors words for everyone, regardless of the setting in their control panel.

I'd love to use this, we have a few potty mouths (me included) and a few others quite the opposite and this would be perfect!
I'm not sure about this as I don't have Microstats installed. If you give me a link ti the appropriate release thread I'll take a look at installing it and see if I can work out what the problem is.
Reply With Quote
  #31  
Old 05-08-2004, 04:41 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm interested in this hack, but I'm brand new to vB3 and a bit put off by the caveat that use of the replacements system in this way might preclude its use in other ways. I guess I'm asking what potential I lose by using this, since I'm not really sure what else I would use replacements for.

Thanks!
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 07:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07454 seconds
  • Memory Usage 2,321KB
  • 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
  • (2)bbcode_code
  • (3)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
  • (4)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