Creating Custom BB Code

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
hexplor
Registered User
Posts: 31
Joined: Sat Feb 16, 2008 3:34 pm
Name: Karol

Creating Custom BB Code

Post by hexplor »

So,
I'm creating a 3.1 extension which besides many other functions needs custom bbcode. I know there's special acp section for managing bbcodes so my question is: Is it possible using 3.1 extension installation system to add bbcodes during extension installation ? if yes, what's the proper syntax for it ? Thanks in advance for reply :)
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5351
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Creating Custom BB Code

Post by MattF »

It's possible, but it ain't easy. The easiest would be to provide instructions to users on what to create themselves.

Otherwise you can do it in a custom function in a migration, by bringing in phpBB's BBcode ACP class and using its functions for adding a BBCode.

I do that, here in this file, but I'm adding several BBcodes.
https://github.com/VSEphpbb/abbc3/blob/ ... l_data.php
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
PayBas
Former Team Member
Posts: 930
Joined: Thu May 25, 2006 12:37 am

Re: Creating Custom BB Code

Post by PayBas »

VSE wrote:It's possible, but it ain't easy. The easiest would be to provide instructions to users on what to create themselves.

Otherwise you can do it in a custom function in a migration, by bringing in phpBB's BBcode ACP class and using its functions for adding a BBCode.

I do that, here in this file, but I'm adding several BBcodes.
https://github.com/VSEphpbb/abbc3/blob/ ... l_data.php
Great for a tutorial. Others will want to use this no doubt.
User avatar
hexplor
Registered User
Posts: 31
Joined: Sat Feb 16, 2008 3:34 pm
Name: Karol

Re: Creating Custom BB Code

Post by hexplor »

VSE wrote: I do that, here in this file, but I'm adding several BBcodes.
https://github.com/VSEphpbb/abbc3/blob/ ... l_data.php
Wonderful ! Thank you very much ! One question tho. I understand that in 3.1 nothing has changed, all bbcode params are required ? There's no easy way to set optional params ? ie

Code: Select all

[bbcode={SOME_PARAM} optional={OPTIONAL_PARAM}]{DESC}[/bbcode]
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5351
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Creating Custom BB Code

Post by MattF »

hexplor wrote:
VSE wrote: I do that, here in this file, but I'm adding several BBcodes.
https://github.com/VSEphpbb/abbc3/blob/ ... l_data.php
Wonderful ! Thank you very much ! One question tho. I understand that in 3.1 nothing has changed, all bbcode params are required ? There's no easy way to set optional params ? ie

Code: Select all

[bbcode={SOME_PARAM} optional={OPTIONAL_PARAM}]{DESC}[/bbcode]
Not really. The core custom BBCode implementation does not support optional params.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
brunoais
Registered User
Posts: 440
Joined: Wed Jun 18, 2008 10:50 am

Re: Creating Custom BB Code

Post by brunoais »

There's a new parser that should appear in phpBB3.2 that is nearly complete. That should allow doing that, at least, it is scheduled to allow doing that. I believe it was initially intended for 3.1 but it was not mature enough on time.
Post Reply

Return to “Extension Writers Discussion”