Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
User Optional Word Censorship Details »
User Optional Word Censorship
Mod Version: 1.00, by MrEyes (Coder) MrEyes is offline
Developer Last Online: May 2017 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.0 RC 3 Rating: (1 vote - 5.00 average) Installs: 21
Released: 18 Apr 2008 Last Update: Never Downloads: 7
Not Supported Code Changes Re-usable Code Translations  

User Optional Word Censorship

What this hack does

The default censorship options in VB are all or nothing, in other words it is either enabled or disabled for all users regardless of their personal preference. Without any additional SQL calls and an extremely low runtime impact (on top of the resource usage required when using the censor in the first place), this hack gives the user the option to view your forum with the AdminCP configured censor switched on if you have it enabled.

How to install

In summary the install requires:
  • Around 2 minutes.
  • 1 file change.
  • The addition of a custom user profile field.
  • A basic understanding of PHP.

So this is what you need to do:

First create a custom user profile field:
  1. Log in to your AdminCP.
  2. Goto "User Profile Fields -> Add New User Profile Field"
  3. In "Profile Field Type" select "Multiple-Selection Checkbox" and then click "Continue"
  4. In "Title" enter "Enable word censor" *
  5. In "Description" enter "If you choose to enabled this option all words on the current censor list will be replaced with * characters" *
  6. In "Options" enter "Enable censor" *
  7. Set "Private Field" to "Yes"
  8. Set "Field Searchable on Members List" to "No"
  9. Set "Show on Members List" to "No"
  10. Set "Display Page -> Which page displays this option?" to "Options: Other"
  11. Click "Save", this will then take you to a page that summarises all current profile fields.
  12. On this profile fields list find the one you just added and take note of the "Name" value. Typically this will be somthing like "Field5".

* These options set the text that is displayed to the user, feel free to customise/change these to whatever you want.

All the AdminCP work is done now, so if you want logout. The next step is to make a small file edit, to check this field value when VB calls the censor code.
  1. Take a backup of "includes\functions.php" just incase something goes horribly wrong.
  2. Open the "includes\functions.php" file in your favourite text editor.
  3. Find the following lines (typically these are around line 545):


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  4. Immediately after the lines above (i.e. after the {) add the following code:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    You should end up with something that looks like this:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  5. Now this is probably the most complicated part of this simple install. Remember when you setup the profile field and you took a note of the "Name" value? Well in the text you just pasted into the function.php file you need to change this:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    To match the name of the field, so for example if your field name is "Field12", it would look like this:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  6. Save the file, and upload to your server.

The last, and most critically important step is:
  1. Click Install
All done, sit back and relax

Footnotes

By default the censor will be off for all users, so they will have to change their profile in order to enabled this. I could not find a way to create a profile checkbox field that is checked by default, and describing how to run SQL scripts to set the field value is more complicated than I wanted to go with this simple hack. So if anybody knows how to do this post the details and I will update the article. In the meantime a simpler option (rather than playing with the DB) is to use "Yes" / "No" radio buttons and set the default value to Yes (or no if you prefer). If you do this you will also have to subtly change the code above from:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
User-optional Replacements-based Censorship tjdrico vBulletin 3.0 Full Releases 70 04 Nov 2007 13:10

  #16  
Old 04 Dec 2008, 12:59
Brittany Brittany is offline
 
Join Date: Jul 2008
anyone?
Reply With Quote
  #17  
Old 31 Dec 2008, 13:09
Brittany Brittany is offline
 
Join Date: Jul 2008
nobody can help me?
Reply With Quote
  #18  
Old 02 Jan 2009, 05:57
Phaedrus Phaedrus is offline
 
Join Date: Aug 2006
You need to go to your options, create a list of censor words and then turn it on. The user then can decide to use the censoring or not by adding or removing the checkmark.

Have you created a censor list in your options in the admin control panel?

Last edited by Phaedrus; 02 Jan 2009 at 06:22.
Reply With Quote
  #19  
Old 02 Jan 2009, 06:47
Phaedrus Phaedrus is offline
 
Join Date: Aug 2006
Originally Posted by Brittany View Post
OK I installed this exactly how you said and when I go to disable the censor
it says

"A required field called Enable word censor is missing or has an invalid value."

What am I doing wrong?


eta:
My code


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Go to "User Profile Field Manager" in AdminCP.

Click "Edit" next to the option you created.

Choose "no" for required field.
Reply With Quote
  #20  
Old 02 Jan 2009, 07:07
Brittany Brittany is offline
 
Join Date: Jul 2008
ok did all that and Im not getting an error message anymore but it isnt working.
I added test to the list of curse words, turned it on, and it isnt working still
Reply With Quote
  #21  
Old 02 Jan 2009, 07:10
Brittany Brittany is offline
 
Join Date: Jul 2008
nvm i got it working that you sooooo much.
Reply With Quote
  #22  
Old 02 Jan 2009, 07:42
Brittany Brittany is offline
 
Join Date: Jul 2008
ok now when I go to enable it, it works fine, when I go to disable it all the words remain with stars
Reply With Quote
  #23  
Old 02 Jan 2009, 12:43
Brittany Brittany is offline
 
Join Date: Jul 2008
It works just fine now.
Reply With Quote
  #24  
Old 02 Jan 2009, 16:13
Phaedrus Phaedrus is offline
 
Join Date: Aug 2006
Any user who has the option selected will have their words turned into asterisk if they use one of the words they chose to have edited, that will go into the database exactly that way and all users will see it that way.

However those who do not have it on, their words will remain and everybody will see them except those tender souls with the option turned on.
Reply With Quote
  #25  
Old 04 Jan 2009, 21:36
beansbaxter's Avatar
beansbaxter beansbaxter is offline
 
Join Date: May 2005
For a super large big forum with a ton of traffic, how much server load will this add?
__________________
PNW Moto - Motorcycle riders in Washington, Oregon, Idaho
Reply With Quote
  #26  
Old 07 Jan 2009, 01:12
Phaedrus Phaedrus is offline
 
Join Date: Aug 2006
Originally Posted by beansbaxter View Post
For a super large big forum with a ton of traffic, how much server load will this add?
It would add one query per page.
Reply With Quote
  #27  
Old 10 Jan 2009, 03:19
asailorsanchor asailorsanchor is offline
 
Join Date: Jan 2009
When I unclick enable it still censors my words.. anyone know how i can fix this?
Reply With Quote
  #28  
Old 12 Jan 2009, 05:04
asailorsanchor asailorsanchor is offline
 
Join Date: Jan 2009
anyone?
Reply With Quote
  #29  
Old 15 Jan 2009, 03:38
asailorsanchor asailorsanchor is offline
 
Join Date: Jan 2009
one more try, anyone know how to make this work?
Reply With Quote
  #30  
Old 18 Jan 2009, 05:15
asailorsanchor asailorsanchor is offline
 
Join Date: Jan 2009
anyone know how I click install?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 10:12.

Layout Options | Width: Wide Color: