We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: Banned Phrases

Development and Programming

Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi Mark,

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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 😉

Best wishes,

Mark

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi Marak,

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Hi Marak,

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

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Excellent seems to be working now 😊

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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi Mark,

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

/poodle/i
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

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.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

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.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.