Exposing bbcode to the plugin manager

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Exposing bbcode to the plugin manager
« on January 11th, 2012, 01:44 PM »
I've been thinking a bit about the bbcode management side of things, and in particular ways that users can extend bbcode.

Yes, I want to make a custom bbcode interface part of the core, but I can also see the validity of plugins that provide bbcode either through conventional means or custom means (if they need to do things that aren't supported in the core, or some preparsing for example)

What I'm envisaging, then, is that the bbcode table might grow an id column to indicate where a bbcode has come from, and that there might be a direct interface in the plugin-info.xml file to actually add a bbcode that way.

Having the id in the table would allow cleanly removing bbcode from the table when disabling a plugin (something that is currently not entirely reliable), and it would certainly make it easier to package up new bbcode, even if users would otherwise just be able to insert bbcode themselves... some users really are lazy in that respect. :P
Re: Exposing bbcode to the plugin manager
« Reply #1, on January 12th, 2012, 02:52 AM »
* Lurker is working on this right now.

The id in the column is also not a performance concern because it won't materially affect the query to actually load it.
Posted: January 12th, 2012, 02:40 AM

Holy monkey bladders is there a lot of rules for the XML for this, just for validity checking (that's even before I get into the full code for the plugin manager, but it'll be worth it)
Re: Exposing bbcode to the plugin manager
« Reply #2, on January 12th, 2012, 03:37 AM »
Note to self: this will be greatly helped if the internal bbcode editor also provides for showing the XML block, meaning that mod authors can build it in the normal editor, test it on their forums, and package it very, very quickly.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Exposing bbcode to the plugin manager
« Reply #3, on January 12th, 2012, 08:18 AM »
Well that seems to be a good idea.
However I'm more interesting right now to see a bbcode editor in action... Last time I removed the Opera-specific code, it was a bit painful to debug :P

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #4, on January 12th, 2012, 09:01 AM »
Ah, patience, patience! It's all inter-related in my head!

I'm still trying to decide whether the enable/disable bbcode needs to work per tag (like it does currently, that disabling 'quote' disables all the variants of 'quote') or per individual bbcode.
Re: Exposing bbcode to the plugin manager
« Reply #5, on January 12th, 2012, 09:36 AM »
Hmm, if users don't like a particular tag they'll probably just remove it anyway.

Might as well just leave it structurally as it is (disabling overall tags)

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Exposing bbcode to the plugin manager
« Reply #6, on January 12th, 2012, 10:10 AM »
Sure. It's mostly a matter of taste -- just like my latest addition, which had me stumbled for a while on whether the file should be called 'custom.template.php' or 'Custom.template.php', or even if I should test for both... Ended up deciding I should follow SMF's guidelines for filenames, and index.template.php is just an 'odd' exception.

MultiformeIngegno

  • Posts: 1,337
Re: Exposing bbcode to the plugin manager
« Reply #7, on January 12th, 2012, 03:34 PM »
What about an interface where users can easily add new BBCode tags?


There is a box where admin choose the tag (for example: [wiki]) and in another he can choose the "behavior" of the tag (there can be variables, for example if a user write [wiki]The Rolling Stones[/wiki] the admin should indicate something like: "http://$1/$2" where $1 is the path to the wiki he wants to use and $2 is the phrase within the [wiki] tags).

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Exposing bbcode to the plugin manager
« Reply #8, on January 12th, 2012, 03:47 PM »
Quote from MultiformeIngegno on January 12th, 2012, 03:34 PM
What about an interface where users can easily add new BBCode tags?
That was Pete's point (allowing plugins to modify bbcodes, and on the other hand allowing users to edit them, and add more, through a UI.)
But it was never done...
Quote
There is a box where admin choose the tag (for example: [wiki]) and in another he can choose the "behavior" of the tag (there can be variables, for example if a user write [wiki]The Rolling Stones[/wiki] the admin should indicate something like: "http://$1/$2" where $1 is the path to the wiki he wants to use and $2 is the phrase within the [wiki] tags).
Invision or vBulletin do that, IIRC...?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #9, on January 12th, 2012, 03:55 PM »
-sigh- I'm not being funny but I really wish people would read the entire thread before posting.

Right up there in my first post.
Quote
Yes, I want to make a custom bbcode interface part of the core,
It's going to happen. Just after I do this bit because some of the code will be reliant on the things I'm doing right now (not a lot, mind, but enough to make me want to be sure I have this part working before I do that)

MultiformeIngegno

  • Posts: 1,337

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #11, on January 13th, 2012, 02:56 AM »
OK, so the core functionality is now supported, plugins can add their own bbcode and have it cleaned up on disable. More reliable than doing manual DB queries, anyway.

Now, for my next trick, some kind of UI...
Posted: January 13th, 2012, 02:54 AM

I bet most people here do not realise how complex bbcode actually is. There are, for example, 8 different internal types of bbcode all for different purposes.

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Exposing bbcode to the plugin manager
« Reply #12, on January 13th, 2012, 03:22 AM »
Kick ass! (And yes, BB codes are a complex beast. I bet this holds true even in other platforms, like ipb, vb, etc.)
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #13, on January 13th, 2012, 03:42 AM »
Actually, in the other platforms they're a fair bit simpler, because they don't have the same flexibility. You just don't see the variations, IIRC in vB at least they're always [bbcode=something] format, never anything else.

Even their quote code is really dull, it's simply [quote=author;postid].

Nao

  • Dadman with a boy
  • Posts: 16,079