Exposing bbcode to the plugin manager

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #16, on February 8th, 2012, 04:10 PM »
XenForo's facilities in this department are functional but confusing and not that wonderful to work with, IMO. Trying to write a bbcode that has any callback is a PITA of the first water.

I've been thinking about this, though, and the much rumoured bbcode editor and thinking that I might have to up-end how things are done, especially if a user ever wants to edit a bbcode that a plugin has issued (because right now, enabling/disabling a plugin causes it to be added/removed directly from the table)

So I've been thinking about having an 'active' parameter in the table, and querying against that, which would allow removal of the existing 'big list of bbcode' tickboxes and allow for per-code disabling (potentially) but it would also require non-trivial changes to the bbc parser, and I'm not sure I'm up to that right now.
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,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #18, on February 8th, 2012, 08:29 PM »
That said, I don't *have* to gut the existing logic (around what gets set in $disabled), I can make it work by figuring it out from other stuff, I guess.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Exposing bbcode to the plugin manager
« Reply #20, on February 8th, 2012, 11:42 PM »
I'm not thinking it would, generally.

Here's the thing: disabled has 3 uses, all sort of related.

Firstly, it's extracted from the master modSettings entry, and that's done on first entering parse_bbc. Now, it's used once by the print code to turn off certain codes, then it's used to check whether certain codes are active or not, and add other codes (e.g. the mutant list codes) and lastly it's actually used to ignore tags when parsing.

The key point is that it isn't cached, so that the master list of tags is always consistent, even if you switch between normal and print-page within the cache lifetime, you won't get mashed up tags.

Ignoring the master modSetting and rebuilding it from the main tag list should be a one-per-page affair (when the master bbcodes are loaded, after cache retrieval occurs), so the hit should not be that serious at all.

Really, though, a lot more of it is figuring out how the UI should interact so that the loading can handle everything it's supposed to and set disabled appropriately - setting 'url' to disabled takes out all variants on the url bbcode, not just any one particular style.