Log in

View Full Version : End-User Options - LAM - Profanity Filter


mawby
11-01-2010, 10:00 PM
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

Download the required .xml file
product-LAM_product-LAM_ProfanityFilter.xml or product-LAM_ProfanityFilterBLOG.xml
Install the product
AdminCP -> Plugins & Products -> Add/Import Product -> Import Product
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!
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
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/attachment.php?attachmentid=123333&stc=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/attachment.php?attachmentid=123334&stc=1&d=1288703398

https://vborg.vbsupport.ru/attachment.php?attachmentid=123335&stc=1&d=1288703478

https://vborg.vbsupport.ru/attachment.php?attachmentid=123336&stc=1&d=1288703478

https://vborg.vbsupport.ru/attachment.php?attachmentid=123337&stc=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$#@!?$#@!40$#@!-$#@!I$#@!-$#@!read$#@!-$#@!the$#@!-$#@!rules$#@!...&$#@!amp$#@!;$#@!goto$#@!=$#@!newpost$#@!" $#@!cl$#@!$#@!="$#@!threadtitle$#@!" $#@!$#@!le$#@!="$#@!Go$#@! $#@!to$#@! $#@!first$#@! $#@!unread$#@! $#@!post$#@! $#@!in$#@! $#@!thread$#@! '$#@!I$#@! $#@!read$#@! $#@!the$#@! $#@!rules$#@!...'">$#@!I$#@! $#@!read$#@! $#@!the$#@! $#@!rules$#@!... <$#@!a$#@! $#@!href$#@!="$#@!showthread$#@!.$#@!php$#@!?$#@!40$#@!-$#@!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$#@!;$#@!contenttype$#@!=$#@!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
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
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...

I get this when it is turned on...all throughout the forum linksWhat 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
I get this when it is turned on...all throughout the forum links

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
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
I like the age option, so I've added it. :)

Niiiice Thank you :D

inshooter
11-03-2010, 08:25 PM
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
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
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/attachment.php?attachmentid=123332&stc=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
How do I get to that menu?It's in the settings for your forum.

https://vborg.vbsupport.ru/attachment.php?attachmentid=123503&stc=1&d=1289314980

mawby
11-09-2010, 01:10 PM
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
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.

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
I like the age option, so I've added it. :)

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

https://vborg.vbsupport.ru/attachment.php?attachmentid=123369&stc=1&d=1288788707

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

https://vborg.vbsupport.ru/attachment.php?attachmentid=123370&stc=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
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
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
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
I would use this, but it doesn't work with shout boxes.I take it the shout box is another add-on?

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
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
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
Can anyone confirm if this product works with vB 4.1.3?I'm using 4.1.3 myself, no problems reported.

8thos
06-28-2011, 02:19 AM
This modification will kill your blogs for some members in vb4.1.4.

I've just done extensive testing on my forum and narrowed it down to this modification.

So while some members can create blogs, not all of them can.

Just install the one with no blog support.

av8or1
07-03-2011, 04:23 PM
Installed, thanks!

mawby
07-05-2011, 09:53 AM
This modification will kill your blogs for some members in vb4.1.4.This bug has been fixed.

I don't use the blogs on my site so I rely on feedback from this forum if it stops working.

PirateTinman
08-01-2011, 07:28 AM
It would be very nice if you could be able to ban specific words.
Take the word Ass for an example, in its current state all these words will get censored:
Assign, Assistant, Assassin, Lass, Class
So maybe if a word in the filtered list has quotation marks around it it would only censor that word if there is no letter in front or behind it. So if I but "Ass" instead of Ass in the filter it would only ban that word and not all the words containing the letters a s s

Other then that, this mod works perfectly on vB4.1.5

Thanks!

8thos
08-06-2011, 01:26 PM
This bug has been fixed.

I don't use the blogs on my site so I rely on feedback from this forum if it stops working.

Thanks!

River J
08-14-2011, 01:28 AM
Too bad this doesn't work for shoutboxes

Kat-2
01-11-2012, 07:31 PM
I am getting so frustrated. I can't figure out why, but if a word is put in the filter, it is filtered whether it is turned off or on in the Profile. What am I doing wrong here? :(

Kat-2
01-13-2012, 03:45 AM
Got it working.

fungku
03-19-2012, 01:57 AM
Any way to make this mod work with Tapatalk plugin? (http://www.tapatalk.com/)

mawby
03-28-2012, 07:04 AM
Got it working.Sorry for not being around to assit, but at least you got it working. :)

Any way to make this mod work with Tapatalk plugin? (http://www.tapatalk.com/)Unfortunately not. Tapatalk bypasses installed plugins so there is no way to make it work.

wtwest
03-29-2012, 12:59 PM
Any way I could get this to be off by default? I don't want it on globally, but I want users to be able to choose if they want to use it.

also, how would I set this up so it would function for someone who hasn't put a year in for their birthday?

remodel angus
04-23-2012, 12:52 AM
Can this configured to not be able to turn off for certain user groups?

Thanks

CubicWebs
07-23-2012, 05:11 PM
Nice Addon, shame it doesn't work globally so it works on shoutboxes etc PMs etc.

Bounce
01-20-2013, 09:41 PM
hi, will this mod still allow words in links to show even if they are added to the filter?

for example: you can view the whats **** site here www.whatscrap.com with crap being the filtered word!