Problem with a BBcode

Get help developing custom BBCodes or request one.
zorni
Registered User
Posts: 119
Joined: Mon Mar 23, 2009 10:29 pm

Problem with a BBcode

Post by zorni »

Hi,

in our current, running board (3.0.12) we're using 2 custom BBcodes for hiding some special informations.

Let's call it MI.

We're upgrading the forum to 3.2 soonish, but one of the left problems ist that BBcode.

We're using 2 versions of this BBcode:

Code: Select all

[MI]{TEXT}[/MI]

Code: Select all

<span style="color:red;">MI:</span> <span style="color:#F6EFE2;">{TEXT}</span>
and

Code: Select all

[MI={TEXT2}]{TEXT1}[/MI]

Code: Select all

<span style="color:red;">MI for: "{TEXT2}":</span> <span style="color:#F6EFE2;">{TEXT1}</span>
The problem is, in 3.2 they're both pictured identical without that TEXT2 identifier. What's wrong with that code?

https://imgur.com/a/eQCwO

Thanks for your support!
zorni
Registered User
Posts: 119
Joined: Mon Mar 23, 2009 10:29 pm

Re: Problem with a BBcode

Post by zorni »

It's a 3.2 problem ... with the older versions it works fine. So pls re-move it to the 3.2 support forum :)
User avatar
Toxyy
Registered User
Posts: 961
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

Re: Problem with a BBcode

Post by Toxyy »

How are you adding the TEXT2 variable to the board?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
User avatar
JoshyPHP
Code Contributor
Posts: 1291
Joined: Mon Jul 11, 2011 12:28 am

Re: Problem with a BBcode

Post by JoshyPHP »

It's a known issue with multiple BBCode definitions for the same name. There's a ticket describing it but I can't find it atm.

You'd need to remove the second definition and replace the first one with this, preferably before upgrading:

Code: Select all

[MI for={TEXT2;optional}]{TEXT1}[/MI]

Code: Select all

<span style="color:red;">MI<xsl:if test="@for"> for: "{TEXT2}"</xsl:if>:</span> <span style="color:#F6EFE2;">{TEXT1}</span>
I wrote the library that handles markup in phpBB 3.2+.
zorni
Registered User
Posts: 119
Joined: Mon Mar 23, 2009 10:29 pm

Re: Problem with a BBcode

Post by zorni »

Thanks Joshy!

Return to “Custom BBCode Development and Requests”