Create unclosed BBcodes

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Create unclosed BBcodes

Post by TB54 »

PhpBB version : 3.3.4
PHP version : 7.3.29
Installed extensions : Change Post Time, Sortables Captcha, Online Status, phpBB Media Embed PlugIn, Empty Post Subjects, VigLink
Installed style : Prosilver (modified)

Hello everyone,

I would like to know if there is a way to create unclosed BBcodes only by modifying templates, and not the core?

I'm interested in creating a variant of the BBcode [ * ], used for the objects of a list.

I would like to create another open BBcode (for instance [**]) which would add a margin below each object of the list, for when those lists are made of big blocks of texts. Without having to close the BBcode for each line, like for [ * ] (i try to simplify the message writing as much as I can, as much users are not used to BBcode, and that it's hard to deal with multiples tags lost in big blocks of text in the editor).

To sum up, that:

Code: Select all

[**]{TEXT}
would mean that:

Code: Select all

<li style="margin-bottom:6px">{TEXT}</li>
But the admin BBcode creator doesn't accept open BBcode (nor BBcode named with just ** in it).

Is their a simple way to create this BBcode manually, or to deactivate the interdiction which doesn't accept open bbcodes (and * in them)?

Or does it means touching to the core and needing an extension?
User avatar
JoshyPHP
Code Contributor
Posts: 1288
Joined: Mon Jul 11, 2011 12:28 am

Re: Create unclosed BBcodes

Post by JoshyPHP »

** isn't accepted as a valid BBCode name but if you name it anything else, it should work as expected. Note that both * and li already taken.

The definition requires an end tag, but in posts you can skip it like the default [*] BBCode. You can try this definition for example: [bigli]{TEXT}[/bigli]

None of that requires any extension or custom coding. You may be able to create an extension to use your own [**] markup inside of posts; You'd have to learn how to write an extension and execute the following line via the core.text_formatter_s9e_configure_after event: $configurator->Preg->match('/\\[\\*\\*\\]/', 'BIGLI'); Or maybe via a custom parser of sorts.
I wrote the library that handles markup in phpBB 3.2+.
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Create unclosed BBcodes

Post by TB54 »

Oh, I never thought it would work with just one opened!

Thanks a lot.

I would be tempted for the extension solution in order to use [**], but my javascript skills are really too non-existent to try that for the moment. But I keep the links that for later, thanks!
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26546
Joined: Fri Aug 29, 2008 9:49 am

Re: Create unclosed BBcodes

Post by Mick »

You could make an extension request, you have most of the code for it maybe someone will build it for you.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Create unclosed BBcodes

Post by TB54 »

I didn't thought to ask it for a so little thing, but you're right, I will try!
Post Reply

Return to “phpBB Custom Coding”