Parse the replacement text for a censored word.

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
Locked
User avatar
Blue Blood
Registered User
Posts: 762
Joined: Sat Apr 11, 2009 7:09 am
Location: U§A
Name: Blue Blood
Contact:

Parse the replacement text for a censored word.

Post by Blue Blood » Sun Jan 31, 2010 3:35 am

I'm in need of a mod to parse the replacement text for a censored word.
In phpBB3 if you set the replacement text with any BBCode with will display as is.

This worked in phpBB2....

If you don't under stand what I mean read this
http://www.phpbb.com/community/viewtopi ... &t=1962375

Thanks

Skinny Vinny
Registered User
Posts: 230
Joined: Tue Dec 01, 2009 7:10 pm

Re: Parse the replacement text for a censored word.

Post by Skinny Vinny » Sun Jan 31, 2010 10:22 pm

I don't know that you're going to find a 'reasonable' way to do this in phpbb3. The bbcode in post and sigs have identifiers. It's not as simple as calling a function/method.

Out of the box, any html you enter into the word censor in html character encoded and displays as the characters, does not render. This is a very easy fix.

As of 3.0.6
Open cache.php, at or around line 96, find:

Code: Select all

                $censors['replace'][] = $row['replacement'];  
Replace with :

Code: Select all

                $censors['replace'][] = html_entity_decode($row['replacement']);  

Now here's the problem:
Yes, your html in the replacement text will now render.
This will also render within linked topic titles, which is going to cause a mess. Can see problems with censors within post bbcode, etc. Most of the time, this should just create validation issues, which so long as they don't interfere with your users experience... who cares. But, depending on how you're using this, I could see potential to create a mess.

The simple fix for topic/subject links is to simply add strip_tags when the censor_text function is called on them. I would imagine that there are a ton of places that would need to be updated for this. I may look into it more later.

Skinny Vinny
Registered User
Posts: 230
Joined: Tue Dec 01, 2009 7:10 pm

Re: Parse the replacement text for a censored word.

Post by Skinny Vinny » Sun Jan 31, 2010 11:03 pm

This is still rolling around in the back of my head. lol
There are just so many potential uses.

There are a few horrible uses I can think of, too...
but to each their own I suppose.

I absolutely hate the idea of editing so much to resolve the topic titles issue. I really only see one way to avoid it.

Have a feeling I'm going to be back on this one later tonight.
I should have a reasonable solution together this week.

User avatar
Blue Blood
Registered User
Posts: 762
Joined: Sat Apr 11, 2009 7:09 am
Location: U§A
Name: Blue Blood
Contact:

Re: Parse the replacement text for a censored word.

Post by Blue Blood » Fri Feb 12, 2010 6:53 am

Cool thanks man...
I hope you or someone can make a mod!!! :)

User avatar
Blue Blood
Registered User
Posts: 762
Joined: Sat Apr 11, 2009 7:09 am
Location: U§A
Name: Blue Blood
Contact:

Re: Parse the replacement text for a censored word.

Post by Blue Blood » Tue Aug 24, 2010 5:53 am

Has anyone found a solution!!
PLEASE!!!!

Movie
Registered User
Posts: 127
Joined: Sun Nov 02, 2014 2:54 pm
Location: Chicago Illinois Area.

Re: Parse the replacement text for a censored word.

Post by Movie » Sat Apr 11, 2015 3:05 pm

Any updates on this?

Having the ability for common words that newbies needed more details on so they could simply click on the word they did not understand and the link took them to more details on the word or term they did not understand would be a time saver and educational.


FoulFoot
Registered User
Posts: 261
Joined: Mon Jun 23, 2003 1:04 am
Location: Honolulu, HI
Contact:

Re: Parse the replacement text for a censored word.

Post by FoulFoot » Sat Apr 18, 2015 1:27 am


Locked

Return to “[3.0.x] MOD Requests”