Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
LAM - Profanity Filter Details »»
LAM - Profanity Filter
Version: 4.1.4.0, by mawby mawby is offline
Developer Last Online: Jul 2020 Show Printable Version Email this Page

Category: End-User Options - Version: 4.1.4 Rating:
Released: 11-01-2010 Last Update: 07-04-2011 Installs: 44
Uses Plugins
Re-useable Code Translations  
No support by the author.

This product will mask out rude words on your forum, but with an option that allows the filter to be turned off by the user.

The filter works on all forum posts, threads, titles, search results and emails. There is also a BLOGs version of this product which I've extended to also filter the built-in blogs, comments, latest bits and titles. Blog support is not 100% complete yet. There are some places where no suitable hooks exist for the filter to work; blog search results being an example. Hopefully these will be fixed as and when more hooks become available. (I'd rather wait for the hooks then start giving instructions on hacking the files)

As of version 4.0.8.2 it is now possible to set a minimum age required before a user is allowed to turn off the profanity filter.

Installation
  1. Download the required .xml file
    product-LAM_product-LAM_ProfanityFilter.xml or product-LAM_ProfanityFilterBLOG.xml
  2. Install the product
    AdminCP -> Plugins & Products -> Add/Import Product -> Import Product
  3. Create the required User Profile Field
    A picture speak a thousand words....

    ...but here are the words as well!
    Code:
    In your Admin Control Panel (ACP), please do the following:
    
    ACP -> User Profile Fields -> Add New User Profile Field
    
    Change the "Profile Field Type" to "Single-Selection Radio Buttons" and press "Continue"
    
    Now enter the following values into the following fields...
    
    User Profile Field
    ------------------
    
    Title = Profanity Filter
    Description = The profanity filter will mask out mature language from forum posts
    Profile Field Category = (Uncategorized)
    Options = {Copy and paste in the two lines below}
    Turn On
    Turn Off
    Set Default = Yes
    Display Order = You Select this (dependant on how many you already have)
    Field Required = No
    Field Editable by User = Yes
    Private Field = Yes
    Field Searchable on Members List = No
    Show on Members List = No
    
    Optional Input
    --------------
    
    Allow user to input their own value for this option = No
    Max length of allowed user input = 100
    Field Length = 25
    Regular Expression = {Leave this Blank}
    
    
    Display Page
    ------------
    
    Which page displays this option? = Edit Profile
    
    Make a note of the FieldID at the top of the page because you will need to use it to configure this product.
    
    Press Save
  4. Configure the product

Configuration

You need to configure the product to specify the Profile Field ID to use (the one created during installation). If you want to change the "Turn On" "Turn Off" labels in the profile field (e.g. for translations) then you need to change the default "Turned Off" Selection option. This product works on the basis that the filter is always on unless the user chooses to turn it off. Therefore it needs to know what to look for to determine the user has turned it off. Next is the filter mask. This is the replacement for any words which have been filtered. And finally is the list of words to filter. I've masked them out in the picture below just in case vB.org get upset.



Each user can then turn the filter off in their user cp...




Example

A user who has the profanity filter turned off can create and view posts without any alterations being made to them. For users with the profanity filter turned on this product should mask out the configured words where ever they may appear on your forum.

Here are some examples of the filter at work...










Known Issues
  • Blog search results are not filtered
  • Latest blog/comments AJAX results are not filtered

Version History

4.1.4.0 - Fixed bug which could display a no permission error when trying to create a new blog post (2011/07/05)
4.1.1.0 - Fixed HTML clobbering when filtering the word "ass" again (2011/01/17)
4.1.0.2 - Fixed vB4.0.1 not filtering search results post titles (2010/12/11)
4.1.0.1 - Fixed vB4.0.1 not filtering posts at all (2010/12/11)
4.0.8.3 - Fixed HTML clobbering when filtering the word "ass", plus optimised Blog filtering (2010/11/09)
4.0.8.2 - Added minimum age required to turn off the profanity filter
4.0.8.1 - Fix to prevent over filtering if a trailing comma is put in the filtered words list (2010/11/03)
4.0.8.0 - Initial release (2010/11/02)

Download Now

File Type: xml product-LAM_ProfanityFilter.xml (12.7 KB, 116 views)
File Type: xml product-LAM_ProfanityFilterBLOG.xml (19.6 KB, 37 views)

Screenshots

File Type: jpg ProfileField.jpg (74.3 KB, 0 views)
File Type: png Admin.png (56.6 KB, 0 views)
File Type: png UserCP.png (8.7 KB, 0 views)
File Type: png 1.png (64.7 KB, 0 views)
File Type: png NewPosts.png (15.3 KB, 0 views)
File Type: png Quotes.png (14.4 KB, 0 views)
File Type: png Blog.png (43.3 KB, 0 views)

Show Your Support

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

Comments
  #22  
Old 11-09-2010, 01:10 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by inshooter View Post
PM inbound, and boy is it awful - the mask is the default $#@!
I've traced this problem to having the word "ass" in the profanity filter list. The filter works by doing search and replaces on text before it is sent to the browser. In most cases this is done before vB has rendered it (.i.e the plain text is changed) but there are a couple of places where this is not possible and the replacement is done after it has been rendered (i.e. is has the HTML tags place). The last post column is one place where the replacement is done after rendering, and the inclusion of "ass" in the list was resulting in <p class="lastposttitle"> being turned into <p cl$#@!="lastposttitle">!

Whoops. I'll look into fixing that now.
Reply With Quote
  #23  
Old 11-09-2010, 02:28 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This mod is %^#$%$# awesome!
Reply With Quote
  #24  
Old 11-09-2010, 03:42 PM
inshooter inshooter is offline
 
Join Date: Oct 2010
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just wanted to let everyone know that mawby stepped up and took my issue by the horns and squared it away on my forum. That is a stand-up developer.

I will be voting this Mod every way I can.

Thanks again mawby!

P.S. - I sent a little something your way.
Reply With Quote
  #25  
Old 11-09-2010, 04:01 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mawby View Post
Whoops. I'll look into fixing that now.
I've uploaded a new version of both files which will fix this problem. As a result I also had to review the Blogs specific filters as these had the same problem, and I've made major improvements to those so I would recommend upgrading. One plugin I couldn't fix properly so instead it will simply ignore the word "ass"; it's a bit naff but I have raised a few enhancement requests on Vb.com for some new hooks which will allow me to fix this properly in the future.

Quote:
Originally Posted by inshooter View Post
Just wanted to let everyone know that mawby stepped up and took my issue by the horns and squared it away on my forum. That is a stand-up developer.

I will be voting this Mod every way I can.

Thanks again mawby!

P.S. - I sent a little something your way.
I'm glad it's fixed. I'm a bit of a perfectionist when it comes to my code so if it doesn't work I get most annoyed! Thanks for the donation, it's most appreciated. :up:
Reply With Quote
  #26  
Old 11-10-2010, 03:08 AM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mawby View Post
I like the age option, so I've added it.

You can now set the age in the settings...



And if the user is not old enough they will see this in their user cp...

does this mean that if I use 1000, nobody can turn it off ? :-)
Reply With Quote
  #27  
Old 11-10-2010, 11:16 AM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It does, but you could also set Field Editable by User = No in the user profile field.
Reply With Quote
  #28  
Old 12-11-2010, 12:50 AM
misuse misuse is offline
 
Join Date: Apr 2003
Location: San Diego, CA USA
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not working in 4.1.0 Patch 2.

The main thread titles are censored but the post title and posts are not.

Thanks a ton mawby. I was going to get this developed. I'll just send you the $ instead.
Reply With Quote
  #29  
Old 12-11-2010, 12:10 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by misuse View Post
Not working in 4.1.0 Patch 2.
I've updated the products with a fix for this.
Reply With Quote
  #30  
Old 12-11-2010, 12:39 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've just spotted the post titles of search results when searching by posts had also stopped being filtered. I've updated the products again to fix this issue.
Reply With Quote
  #31  
Old 12-13-2010, 05:34 AM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will it work with older versions?
Reply With Quote
Reply

Thread Tools

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 05:38 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.04873 seconds
  • Memory Usage 2,350KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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
  • (9)postbit_attachment
  • (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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete