Extension: Banned Phrases
Posted: 05 February 2010 07:55 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi,

Banned Phrases extension allows you to forbid to use in the website certain words or phrases and to specify how those words or phrases should be replaced.

E.g. you may want to forbid using the word “sucks” on your website. Using Banned Phrases extension you can specify the rule that the word “sucks” should be replaced with some other phrase, such as “is bad”.

Banned Phrases extension allows to specify unconditional and conditional rules. The former example is one of unconditional rule. Conditional rules are applied when some condition is met.

E.g. you may specify than on condition the string “suck” is found two rules should be applied:
1) the rule that the word “sucks” should be replaced with the phrase “is bad” and
2) the rule that the word “sucker” should be replaced with the phrase “bad guy”.

File Attachments
banned_phrases_v1.0.2.zip  (File Size: 12KB - Downloads: 11)
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 05 February 2010 09:55 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hiya,

Looks like a great idea. I just tried it on a 1.6.8 install though and it didn’t seem to do anything. By that I mean that I added a rule and then posted a comment to an entry with a word that should have changed but when viewing the post that had gone in it still had the same word in there.

I thought it may have been because I was logged in as a Super Admin so tried it as a guest but still the same thing unfortunately.

I’m probably just missing something obvious somewhere I guess?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 05 February 2010 09:59 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi Mark,

What kind of rule it was, i.e unconditional/conditional, find, regex, replace?

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 05 February 2010 10:11 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Laisvunas - 05 February 2010 09:59 AM

Hi Mark,

What kind of rule it was, i.e unconditional/conditional, find, regex, replace?

It was an unconditional rule set to replace. I put the word poodle (lowercase) into the Find box and then dog into the Replace box but it didn’t seem to do anything?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 05 February 2010 12:26 PM   [ Ignore ]   [ # 4 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Just wondering if you’d had any thoughts on this yet?

Probably just me being a doozy somewhere along the line but just wanted to check wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 06 February 2010 06:39 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi Marak,

Grab the version 1.0.1 - in it I fixed the bug.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 06 February 2010 07:31 AM   [ Ignore ]   [ # 6 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Laisvunas - 06 February 2010 06:39 AM

Hi Marak,

Isn’t Marak a character from Star Trek or something? wink

Laisvunas - 06 February 2010 06:39 AM

Grab the version 1.0.1 - in it I fixed the bug.

Thanks, will give this a try now.

Also many thanks for what looks set to be an excellent add-on.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 06 February 2010 07:36 AM   [ Ignore ]   [ # 7 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Excellent seems to be working now grin

Just out of interest as my Regex isn’t very good, how would you say create a rule that says if the word Poodle in either uppercase (Poodle) or lowercase (poodle) or maybe even just the word itself no matter what the case (PoOdLe) is to be converted into the word dog instead?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 06 February 2010 08:17 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi Mark,

Put in the Find box this regex (letter “i” means case-insensitive):

/poodle/i
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 06 February 2010 08:25 AM   [ Ignore ]   [ # 9 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Laisvunas - 06 February 2010 08:17 AM

Hi Mark,

Put in the Find box this regex (letter “i” means case-insensitive):

/poodle/i

Absolutely perfect, thanks.

Just as a quick aside I noticed that this extension only works on any new posts as opposed to working on existing posts. Would there ever be any way of it working on existing posts too or perhaps better still instead of changing the words as they go in just change them on displaying the post instead?

No matter if it’s not possible but just a thought.

Once again, thanks for such a great add-on.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 06 February 2010 10:37 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi Mark,

Just as a quick aside I noticed that this extension only works on any new posts as opposed to working on existing posts. Would there ever be any way of it working on existing posts too or perhaps better still instead of changing the words as they go in just change them on displaying the post instead?

For this extension to work on existing content that content must be resubmitted.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 06 February 2010 10:47 AM   [ Ignore ]   [ # 11 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Laisvunas - 06 February 2010 10:37 AM

For this extension to work on existing content that content must be resubmitted.

Aha right I hadn’t thought of that, thanks.

Would it be at all possible to perhaps get the extension to only mask the output instead of actually changing it though?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 06 February 2010 11:04 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi Mark,

Would it be at all possible to perhaps get the extension to only mask the output instead of actually changing it though?

I doubt it is possible because it would involve parsing of result of the Weblog module’s query and that parsing can be very resource consuming.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 06 February 2010 11:46 AM   [ Ignore ]   [ # 13 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Laisvunas - 06 February 2010 11:04 AM

I doubt it is possible because it would involve parsing of result of the Weblog module’s query and that parsing can be very resource consuming.

Ah okay. Never-mind. I was just thinking of something like an Acronym module or something like that. This extension is great though so not a worry.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 09 February 2010 10:37 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  884
Joined  02-02-2007

Hi,

I released version 1.0.2 of Banned Phrases extension.

In this release a bug was fixed - whitepace character in “Find” field causing PHP error.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120534 Total Logged-in Users: 71
Total Topics: 126597 Total Anonymous Users: 44
Total Replies: 665548 Total Guests: 371
Total Posts: 792145    
Members ( View Memberlist )
Newest Members:  suntroprachel123Rach123Glenn StavaImfaelSMS!persanulandrewknightKittx77Amity