vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   End-User Options - LAM - Profanity Filter (https://vborg.vbsupport.ru/showthread.php?t=253026)

mawby 11-01-2010 10:00 PM

LAM - Profanity Filter
 
1 Attachment(s)
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....
    https://vborg.vbsupport.ru/external/2010/11/43.jpg
    ...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. :)

https://vborg.vbsupport.ru/external/2010/11/33.jpg

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

https://vborg.vbsupport.ru/attachmen...1&d=1288703136


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...

https://vborg.vbsupport.ru/attachmen...1&d=1288703398

https://vborg.vbsupport.ru/attachmen...1&d=1288703478

https://vborg.vbsupport.ru/attachmen...1&d=1288703478

https://vborg.vbsupport.ru/attachmen...1&d=1288703544


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)

sulasno 11-02-2010 12:52 PM

tagged and thanks

is it possible for the Admin to turn on the filter instead of allowing the users ?

mawby 11-02-2010 12:59 PM

As it works at the moment, the filter is always on unless turned off by a user. It would require a few changes to make it work the other way around, but I'd look into it if there was enough demand.

If you only want the admin to change the setting then you can set the profile field to not be user editable.

sulasno 11-02-2010 02:06 PM

thanks for the tip

x9751 11-02-2010 02:21 PM

Pretty cool Will probably install I wanted to turn my filter on but people complained saying they are "mature" enough for it to be turned off... anyway thanks. taged

tafreeh 11-02-2010 09:12 PM

nice one.. but can you give an option where we can define filter what word to what?

for example:

right now its gonna convert all the bad words to whatever is in filter mask field. What I want is an option where we can define; convert what word to what.
eg: apple will convert to orange or blue will convert to black

The reason I am asking this is to reduce the amount of wyrd typos I get to see at my forum.

Thanks

inshooter 11-03-2010 12:55 AM

I get this when it is turned on...all throughout the forum links

$#@!p$#@! $#@!cl$#@!$#@!="$#@!lastposttitle$#@!"> <$#@!a$#@! $#@!href$#@!="$#@!showthread$#@!.$#@!php$#@!?$#@!4 0$#@!-$#@!I$#@!-$#@!read$#@!-$#@!the$#@!-$#@!rules$#@!...&$#@!amp$#@!;$#@!goto$#@!=$#@!newp ost$#@!" $#@!cl$#@!$#@!="$#@!threadtitle$#@!" $#@!$#@!le$#@!="$#@!Go$#@! $#@!to$#@! $#@!first$#@! $#@!unread$#@! $#@!post$#@! $#@!in$#@! $#@!thread$#@! '$#@!I$#@! $#@!read$#@! $#@!the$#@! $#@!rules$#@!...'">$#@!I$#@! $#@!read$#@! $#@!the$#@! $#@!rules$#@!... <$#@!a$#@! $#@!href$#@!="$#@!showthread$#@!.$#@!php$#@!?$#@!4 0$#@!-$#@!I$#@!-$#@!read$#@!-$#@!the$#@!-$#@!rules$#@!...&$#@!amp$#@!;$#@!p$#@!=$#@!316$#@! #$#@!post316$#@!"><$#@!img$#@! $#@!src$#@!="$#@!images$#@!/$#@!shades_of_green$#@!/$#@!buttons$#@!/$#@!lastpost$#@!-$#@!right$#@!.$#@!png$#@!" $#@!alt$#@!="$#@!Go$#@! $#@!to$#@! $#@!last$#@! $#@!post$#@!" /> <$#@!div$#@! $#@!cl$#@!$#@!="$#@!lastpostby$#@!"> $#@!by$#@! <$#@!div$#@! $#@!cl$#@!$#@!="$#@!popupmenu$#@! $#@!memberaction$#@!"> <$#@!a$#@! $#@!cl$#@!$#@!="$#@!username$#@! $#@!offline$#@! $#@!popupctrl$#@!" $#@!href$#@!="$#@!member$#@!.$#@!php$#@!?$#@!11$#@ !-$#@!Que$#@!" $#@!$#@!le$#@!="$#@!Que$#@! $#@!is$#@! $#@!offline$#@!"><$#@!strong$#@!>$#@!Que$#@! <$#@!ul$#@! $#@!cl$#@!$#@!="$#@!popupbody$#@! $#@!popuphover$#@! $#@!memberaction_body$#@!"> <$#@!li$#@! $#@!cl$#@!$#@!="$#@!left$#@!"> <$#@!img$#@! $#@!src$#@!="$#@!images$#@!/$#@!shades_of_green$#@!/$#@!site_icons$#@!/$#@!profile$#@!.$#@!png$#@!" $#@!alt$#@!="" /> <$#@!a$#@! $#@!href$#@!="$#@!member$#@!.$#@!php$#@!?$#@!11$#@ !-$#@!Que$#@!"> $#@!View$#@! $#@!Profile$#@! <$#@!li$#@! $#@!cl$#@!$#@!="$#@!right$#@!"> <$#@!img$#@! $#@!src$#@!="$#@!images$#@!/$#@!shades_of_green$#@!/$#@!site_icons$#@!/$#@!forum$#@!.$#@!png$#@!" $#@!alt$#@!="" /> <$#@!a$#@! $#@!href$#@!="$#@!search$#@!.$#@!php$#@!?$#@!do$#@ !=$#@!finduser$#@!&$#@!amp$#@! ;$#@!userid$#@!=$#@!11$#@!&$#@!amp$#@!;$#@!content type$#@!=$#@!vBForum_Post$#@!& $#@!amp$#@!;$#@!showposts$#@!=$#@!1$#@!" $#@!rel$#@!='$#@!nofollow$#@!'> $#@!View$#@! $#@!Forum$#@! $#@!Posts$#@! <$#@!li$#@! $#@!cl$#@!$#@!="$#@!left$#@!"> <$#@!img$#@! $#@!src$#@!="$#@!images$#@!/$#@!shades_of_green$#@!/$#@!site_icons$#@!/$#@!message$#@!.$#@!png$#@!" $#@!alt$#@!="" /> <$#@!a$#@! $#@!href$#@!="$#@!private$#@!.$#@!php$#@!?$#@!do$# @!=$#@!newpm$#@!&$#@!amp$#@!;$ #@!u$#@!=$#@!11$#@!" $#@!rel$#@!='$#@!nofollow$#@!'> $#@!Private$#@! $#@!Message$#@! <$#@!li$#@! $#@!cl$#@!$#@!="$#@!left$#@!"> <$#@!img$#@! $#@!src$#@!="$#@!images$#@!/$#@!shades_of_green$#@!/$#@!site_icons$#@!/$#@!add$#@!.$#@!png$#@!" $#@!alt$#@!="" /> <$#@!a$#@! $#@!href$#@!="$#@!profile$#@!.$#@!php$#@!?$#@!do$# @!=$#@!addlist$#@!&$#@!amp$#@! ;$#@!userlist$#@!=$#@!buddy$#@!&$#@!amp$#@!;$#@!u$ #@!=$#@!11$#@!"> $#@!Add$#@! $#@!as$#@! $#@!Contact$#@! <$#@!p$#@! $#@!cl$#@!$#@!="$#@!lastpostdate$#@!">$#@!October$ #@! $#@!29th$#@!, $#@!2010$#@!, <$#@!span$#@! $#@!cl$#@!$#@!="$#@!time$#@!">$#@!21$#@!:$#@

sulasno 11-03-2010 03:38 AM

Quote:

Originally Posted by tafreeh (Post 2117261)
nice one.. but can you give an option where we can define filter what word to what?

for example:

right now its gonna convert all the bad words to whatever is in filter mask field. What I want is an option where we can define; convert what word to what.
eg: apple will convert to orange or blue will convert to black

The reason I am asking this is to reduce the amount of wyrd typos I get to see at my forum.

Thanks

good idea

I did not use the built in censor since all the words will be converted to ****
but this mod allows me to select the mask

the ability to select the mask for different words would be a winner !

mawby 11-03-2010 07:17 AM

Quote:

Originally Posted by tafreeh (Post 2117261)
nice one.. but can you give an option where we can define filter what word to what?

That wouldn't be too difficult, I'll add it to the to-do list for now though as first I need to fix...

Quote:

Originally Posted by inshooter (Post 2117307)
I get this when it is turned on...all throughout the forum links

What words do you have in the "filter words" list? Thinking about it, does your "Filter Words" have a trailing comma by any chance?

mawby 11-03-2010 07:40 AM

Quote:

Originally Posted by inshooter (Post 2117307)
I get this when it is turned on...all throughout the forum links

Quote:

Originally Posted by mawby (Post 2117385)
Thinking about it, does your "Filter Words" have a trailing comma by any chance?

I've tested this and having a filtered words list like "word1,word2,word3," or "word1,word2,,word3" would cause the problem you've described. I've updated to product to stop this from happening. Can you try the update and let me know if it fixes your problem please?

You will, however, still get a problem if your filtered words list contains a space like "word1,word2, ,word3" but in this situation I think it quite reasonable for the filter to start replacing all spaces as that's what its been configured to do - so I'm not going to fix that one. :)

x9751 11-03-2010 10:27 AM

Would be cool if their was an age option where they could only turn it off if they where a certain age or in a certain usergroup.

mawby 11-03-2010 11:52 AM

1 Attachment(s)
Quote:

Originally Posted by x9751 (Post 2117411)
Would be cool if their was an age option where they could only turn it off if they where a certain age or in a certain usergroup.

I like the age option, so I've added it. :)

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

https://vborg.vbsupport.ru/external/2010/11/33.jpg

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

https://vborg.vbsupport.ru/external/2010/11/33.jpg

ProFifaLeagues 11-03-2010 01:23 PM

Top mod yet again Mawby!Thanks

x9751 11-03-2010 07:56 PM

Quote:

Originally Posted by mawby (Post 2117429)
I like the age option, so I've added it. :)

Niiiice Thank you :D

inshooter 11-03-2010 08:25 PM

Quote:

Originally Posted by mawby (Post 2117387)
I've tested this and having a filtered words list like "word1,word2,word3," or "word1,word2,,word3" would cause the problem you've described. I've updated to product to stop this from happening. Can you try the update and let me know if it fixes your problem please?

You will, however, still get a problem if your filtered words list contains a space like "word1,word2, ,word3" but in this situation I think it quite reasonable for the filter to start replacing all spaces as that's what its been configured to do - so I'm not going to fix that one. :)

No more jibberish like before, but now it does this to all of the posts on the home screen under Last Post:



I read the rules...
by
XXXUSERXXX
View Profile
View Forum Posts
Private Message
Add as Contact
October 29th, 2010, 21:48

mawby 11-04-2010 07:14 AM

Quote:

Originally Posted by inshooter (Post 2117636)
No more jibberish like before, but now it does this to all of the posts on the home screen under Last Post:

Can you PM me the list of words in your filter and the mask you are using please. Either I'm missing something obvious or there is another add-on causing a problem, but I will try to get it sorted for you.

inshooter 11-04-2010 08:33 PM

Quote:

Originally Posted by mawby (Post 2117781)
Can you PM me the list of words in your filter and the mask you are using please. Either I'm missing something obvious or there is another add-on causing a problem, but I will try to get it sorted for you.

PM inbound, and boy is it awful - the mask is the default $#@!

n1x1n 11-08-2010 06:47 PM

https://vborg.vbsupport.ru/attachmen...1&d=1288702448

How do I get to that menu?

saadessa 11-08-2010 07:10 PM

thank you great work

mawby 11-09-2010 01:02 PM

1 Attachment(s)
Quote:

Originally Posted by n1x1n (Post 2119591)
How do I get to that menu?

It's in the settings for your forum.

https://vborg.vbsupport.ru/attachmen...1&d=1289314980

mawby 11-09-2010 01:10 PM

Quote:

Originally Posted by inshooter (Post 2118046)
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. :o I'll look into fixing that now. :)

8thos 11-09-2010 02:28 PM

This mod is %^#$%$# awesome!

inshooter 11-09-2010 03:42 PM

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.

mawby 11-09-2010 04:01 PM

Quote:

Originally Posted by mawby (Post 2119858)
Whoops. :o 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 (Post 2119923)
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. :D 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:

sulasno 11-10-2010 03:08 AM

Quote:

Originally Posted by mawby (Post 2117429)
I like the age option, so I've added it. :)

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

https://vborg.vbsupport.ru/attachmen...1&d=1288788707

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

https://vborg.vbsupport.ru/attachmen...1&d=1288788732

does this mean that if I use 1000, nobody can turn it off ? :-)

mawby 11-10-2010 11:16 AM

It does, but you could also set Field Editable by User = No in the user profile field.

misuse 12-11-2010 12:50 AM

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.

mawby 12-11-2010 12:10 PM

Quote:

Originally Posted by misuse (Post 2132179)
Not working in 4.1.0 Patch 2.

I've updated the products with a fix for this.

mawby 12-11-2010 12:39 PM

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.

sticky 12-13-2010 05:34 AM

Will it work with older versions?

sticky 01-02-2011 08:37 AM

Working great on 4.0.2, thank you!

sticky 01-02-2011 11:19 PM

The filter creates a problem with quoted posts in 4.0.2, does not create the quote box:

https://vborg.vbsupport.ru/external/2011/01/41.png

mawby 01-05-2011 09:17 AM

Quote:

Originally Posted by sticky (Post 2142991)
The filter creates a problem with quoted posts in 4.0.2, does not create the quote box:

I don't have this problem on my site. Can you PM me details of your profanity filter settings so I can see if I can replicate it.

Jeremy8 01-14-2011 10:59 PM

I would use this, but it doesn't work with shout boxes.

sticky 01-15-2011 01:28 AM

Quote:

Originally Posted by mawby (Post 2144334)
I don't have this problem on my site. Can you PM me details of your profanity filter settings so I can see if I can replicate it.

I pm'd you but still unsolved.

mawby 01-16-2011 08:47 AM

Quote:

Originally Posted by Jeremy8 (Post 2149201)
I would use this, but it doesn't work with shout boxes.

I take it the shout box is another add-on?

Quote:

Originally Posted by sticky (Post 2149250)
I pm'd you but still unsolved.

Sorry, real work has kept me away for here for the last week. I've replied now.

mawby 01-17-2011 09:58 AM

Quote:

Originally Posted by sticky (Post 2149250)
I pm'd you but still unsolved.

I've updated the product and this should fix the problem you have.

sticky 01-18-2011 06:05 AM

Quote:

Originally Posted by mawby (Post 2150389)
I've updated the product and this should fix the problem you have.

The update fixed it, thank you!

netpants 05-21-2011 12:27 PM

Can anyone confirm if this product works with vB 4.1.3?

mawby 05-25-2011 11:33 AM

Quote:

Originally Posted by netpants (Post 2198340)
Can anyone confirm if this product works with vB 4.1.3?

I'm using 4.1.3 myself, no problems reported.


All times are GMT. The time now is 06:16 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.01599 seconds
  • Memory Usage 1,861KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete