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
  #12  
Old 04-15-2004, 03:29 PM
ptbyjason's Avatar
ptbyjason ptbyjason is offline
 
Join Date: Dec 2001
Location: TX
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh thank you so much! I have been wanting to do this but I had no idea how. Now everyone will be happy. THANK YOU!
Reply With Quote
  #13  
Old 04-15-2004, 08:31 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 Sonikku
I tried to install it but dunno why it af fected it, but my background image disappeared. 'Twas odd. I uninstalled it. Oh well, nice hack though.
I can't imagine why that would be, unless you were already using the replacement variables for something else, or added a word that modified your display template somehow. The replacement variables don't just get operated upon post contents, but entire templates, so it's quite possible that something like that happened. If you try re-installing the hack, check that it doesn't affect your forum display before adding any words. If it only happens with some words, then change those words, or change the part of the template that's being altered (such as the image name or URL). I can't think why else it would be happening.
Reply With Quote
  #14  
Old 04-18-2004, 03:09 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very awesome! Thank you TONS
Reply With Quote
  #15  
Old 04-19-2004, 01:16 AM
Gio Takahashi's Avatar
Gio Takahashi Gio Takahashi is offline
 
Join Date: Jul 2003
Location: Cape Coral
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is interesting however, I want to make it so that it is censored from Guests. Is it possible?
Reply With Quote
  #16  
Old 04-19-2004, 08:04 AM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gio Takahashi
this is interesting however, I want to make it so that it is censored from Guests. Is it possible?
Yes, it's a simple change.

Open ./includes/functions.php and replace this:

PHP Code:
    // USER OPTIONAL REPLACEMENTS AS WORD CENSOR HACK
    // Use replacements as an optional display-time swear filter.
    
if (== $bbuserinfo['usereplacementscensor'])
    {
        
// this user doesn't want censoring
        // so just return the text as given
        
return $newtext;
    } 
with this:

PHP Code:
    // USER OPTIONAL REPLACEMENTS AS WORD CENSOR HACK
    // Use replacements as an optional display-time swear filter.
    
if ( (== $bbuserinfo['usereplacementscensor']) && (!= $bbuserinfo['userid']) )
    {
        
// this user doesn't want censoring
        // so just return the text as given
        
return $newtext;
    } 
Save and close the file. That should be that, and guests will be subject to censorship. I'll update the main instructions with this information.
Reply With Quote
  #17  
Old 04-20-2004, 10:54 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The zip file has disappeared..
I was just going to install this, and now I can't.!
Reply With Quote
  #18  
Old 04-20-2004, 11:26 AM
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
The zip file has disappeared..
I was just going to install this, and now I can't.!
Oddness! Hehe, I think I screwed up when I was updating the instructions. Should be back now - sorry about that. =)
Reply With Quote
  #19  
Old 04-20-2004, 12:24 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

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?
Reply With Quote
  #20  
Old 04-20-2004, 01:06 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good work tjdrico. I don't have VB3 yet (plan to upgrade in the next week or so) so it will be nice not to have to rehack this one. Thanks for giving me credit for the idea. Looks like you have managed to take yours a step further and get it to work with titles as well. Looks good. I will install for sure when I upgrade.
Reply With Quote
  #21  
Old 04-20-2004, 04:13 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks 006, but there was absolutely zero extra effort involved in getting it to work with titles as well as thread bodies. The way the replacements system works, the entire page seems to be fed through the filter before it's sent to the browser, so it's always likely to catch everything. I may be wrong there, but it seems that way.

It could present a problem if a forum used a, image URL or something that matches part of the replaced text - users with the censorship turned on would end up with missing images. =)
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:21 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.10842 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_php
  • (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
  • (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