![]() |
User-optional Replacements-based Censorship
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/ |
nice idea, I think I might use it for my board
|
I'm definatly using this for my board. Will install later today. :) Finally, some php editing to do. XD
|
Quote:
Say you have a webhost running a banner on your website, now you could charge him to have every instance of the word webhosting replaced with a link to his site. Maybe you could charge a few $$$ per key word... :) Great hack BTW... |
Definately will try this out :-D
|
fantastic idea, thank you!
Suggestion: If a user types a censored word with bbcode in the middle of it (ie: sh[anybbcode]it) vbulletin will display the word uncensored. Any way you could incorporate a fix for this into your hack? |
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. :)
|
Quote:
|
I really like the idea behind this hack.. :)
I'll take a look at it later today and hopefully it won't increase the server load too much. Thanks for sharing.! |
just the other day I had a thread started on my board about this, the older members wanted to see this and it looks like i,ll be able to do it thnx :D
|
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! :)
|
Quote:
|
Very awesome! Thank you TONS :)
|
this is interesting however, I want to make it so that it is censored from Guests. Is it possible?
|
Quote:
Open ./includes/functions.php and replace this: PHP Code:
PHP Code:
|
The zip file has disappeared.. ;)
I was just going to install this, and now I can't.! |
Quote:
|
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? |
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.
|
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. =) |
Quote:
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. |
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. |
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. :)
|
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. |
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..
|
How do I turn on filtering by default to my registered users?
|
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! |
Quote:
Code:
ALTER TABLE user ADD usereplacementscensor TINYINT(1) NOT NULL DEFAULT '0' AFTER pmunread; Code:
ALTER TABLE user ALTER COLUMN usereplacementscensor SET DEFAULT '1'; |
Quote:
|
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! |
Quote:
I put the caveat in there really as I'm sure some people use the replacements for various purposes, but in general I think most people would be fine using them to implement a censorship hack. |
Excellent. I think I'll give it a shot, then. Thanks. :)
|
I really like the idea of this hack, but as you mentioned in the instructions, some odd errors may appear. I must frankly say that it is really hard to actually think of all the combinations of ( ass = donkey , password = donkeyword ) swearing / non-swearing words. There must be some way to work this out without having to sit and think of hundreds, maybe thousands of combinations? ( yes... norwegian language has a whole lot of swearing )
|
This is very useful for me as one of my members logs on from work and constantly has pages restricted to her by 'webmarshal' software because of bad language. *installs*
|
Nice little hack, thanks.
In regards to having part words replaced, you can solve the problem in most cases by using spaces, example: If you want "ass" replaced with "thingy" for the text to replace put <space>ass<space> then "password ass glass" would come out as "password thingy glass" rather than "pthingyword thingy glthingy" the only time this wouldn't work is if they post the word that's getting replaced as the first word in their post, but it's probally very very rare that would happen. |
That's handy to know, Loon, thanks.
I noticed that "parse links in text" was coming out as "pdonkey links in text" on my test forum the other day. =) |
AAhhh. Awsome! I'll have to seriously consider this when we install vb3.
I briefly read over this and am wondering if there's still a place where you can have words censored for everyone outside of the optional censorship? We sometimes censor outwar links and other various domain names. |
You can still use the standard vBulletin censorship system, and those words would be replaced by '**********' as normal.
|
great thanks
|
One more suggestion, if you don't mind...
Instead of using the forum default for "bad words", why not allow users to specify their own list of words that they personally find offensive? |
All times are GMT. The time now is 04:43 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|