Extensions and phpBB 3.2: you should probably read this topic

Discussion forum for Extension Writers regarding Extension Development.
User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: Extensions and phpBB 3.2: you should probably read this topic

Post by JoshyPHP » Mon Dec 25, 2017 10:16 pm

There's nothing in the library that will let you inject HTML at any point during the parsing or rendering process. What you can do is postprocess the HTML using the core.text_formatter_s9e_render_after event.

Also, template parameters are different from the tokens/placeholders used when defining BBCodes. There's an example at http://s9etextformatter.readthedocs.io/ ... arameters/
I wrote the thing that does BBCodes in 3.2.

User avatar
3Di
Former Team Member
Posts: 14088
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and phpBB 3.2: you should probably read this topic

Post by 3Di » Mon Dec 25, 2017 11:02 pm

Zukero wrote:
Mon Dec 25, 2017 10:02 pm
I'm trying to write an extension for phpbb 3.2 that adds a custom bbcode.
I am using a migration to add a bbcode, the one below is compatible 3.1/3.2
(the 3.2 HTML replacement has been kindly suggested by JoshyPHP)
https://github.com/3D-I/notebbcode/blob ... code_1.php

Hope this helps. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Zukero
Registered User
Posts: 51
Joined: Fri Oct 16, 2015 9:19 am
Contact:

Re: Extensions and phpBB 3.2: you should probably read this topic

Post by Zukero » Tue Dec 26, 2017 6:31 pm

Thanks for your help. The "...render_after" event made it, although I think it is a rather inefficient way of doing it.

I'd like to be able to set an output token's value from php, potentially using output tokens that aren't defined in the input bbcode, for example
BBCode:

Code: Select all

[tag]{TEXT1}[/tag] 
Replacement:

Code: Select all

<a href="{TEXT2}" class="{TEXT3}">{TEXT1}</a>
With TEXT2 and TEXT3 created in php using TEXT1 as parameter.

User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: Extensions and phpBB 3.2: you should probably read this topic

Post by JoshyPHP » Tue Dec 26, 2017 6:41 pm

If the intent is to inject HTML then no, that will almost certainly never be supported. If you want to replace some metadata in the XML you can take a look at phpbb\textformatter\s9e\quote_helper and the quote_extended template.

I don't believe modifying the HTML with string functions is inefficient. It's probably the most efficient way to do it.
I wrote the thing that does BBCodes in 3.2.

Post Reply

Return to “Extension Writers Discussion”