BBCode problem after upgrade

Get help developing custom BBCodes or request one.
Post Reply
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm

BBCode problem after upgrade

Post by Tarantino »

Hi there, I had this BBCode on phpBB 3.0:
[img=center/left/right]URL[/img]
and
[img]URL[/img]

After upgrade to 3.2.1 I've lose the [img=center/left/right/float-left/float-right].
This was a BBCode from ABBC3 MOD. (I've enabled the ABBC3 extension and delete it, since I prefer to create just the BBCodes I'll use)

I've thought on creating this for the [align=center/left/right]:

BBCode:[align={SIMPLETEXT}]{TEXT}[/align]
HTML:<div style="text-align:{SIMPLETEXT};">{TEXT}</div>

But how about [align=float-left] and [align=float-right]? How can this be included on the same BBCode?

I could create a new BBCode like this:
BBCode: [float={IDENTIFIER}]{TEXT}[/float]
HTML: <div style="float:{IDENTIFIER};padding:0px 10px 0px 0px;">{TEXT}</div>

But I wanted to learn how can I have both HTML working together on the same BBCode, so I would only use the [align=] one
Last edited by Tarantino on Tue Jan 09, 2018 11:16 pm, edited 2 times in total.
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm

Re: BBCode problem after upgrade

Post by Tarantino »

Topic Rewrited! I guess now the request is direct and simple. :)
User avatar
JoshyPHP
Code Contributor
Posts: 1288
Joined: Mon Jul 11, 2011 12:28 am

Re: BBCode problem after upgrade

Post by JoshyPHP »

Tarantino wrote: Tue Jan 09, 2018 12:02 am But how about [align=float-left] and [align=float-right]? How can this be included on the same BBCode?
Yes, with template logic. You can use xsl:choose and xsl:when. You need to give a name to the attributes and do some string comparison in XPath.

You should probably just create an [align BBCode and a [float] BBCode though.

http://s9etextformatter.readthedocs.io/ ... ory/#align
http://s9etextformatter.readthedocs.io/ ... ory/#float
I wrote the library that handles markup in phpBB 3.2+.
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm

Re: BBCode problem after upgrade

Post by Tarantino »

JoshyPHP wrote: Wed Jan 10, 2018 6:21 am
Tarantino wrote: Tue Jan 09, 2018 12:02 am But how about [align=float-left] and [align=float-right]? How can this be included on the same BBCode?
Yes, with template logic. You can use xsl:choose and xsl:when. You need to give a name to the attributes and do some string comparison in XPath.

You should probably just create an [align BBCode and a [float] BBCode though.

http://s9etextformatter.readthedocs.io/ ... ory/#align
http://s9etextformatter.readthedocs.io/ ... ory/#float
Awesome! That docs with bbcodes is awesome help! And the xsl, I've been reading some already created to understand the logic. It would be great to see more examples, tbh. Or a documentation about that xsl. So we could learn how to code.
I saw how to create an xsl:if for example but it had just one argument like if x=0 but I didnt saw any example when we want to have more like x=0 and y=1.

Thanks again! :D

PS: Btw on the docs it says
[HR]
<hr/>

But phpBB doesn't accept only the [hr] it asks for [hr][/hr] :P
Post Reply

Return to “Custom BBCode Development and Requests”