XF 2.3 Creating a bbcode with callback

Codelizard

Member
Licensed customer
Hey folks,

I need to make a new bbcode to emulate functionality we had in a bbcode back in 1.5. This bbcode is a little involved, so its going to need a callback. For example:

[PTABLE="width:25%,color:#eeff00,bgcolor:green"]

would be rendered as:

<table style="width:25%;color:$eeff00;background-color:green">

I need to take everything past the "=" and change all commas to semicolons, and write style="results" into the tag. Its a little too much for a simple html replacement, so i need to use a callback. Theres a few other replacements for shortcuts, like bgcolor gets replaced with background-color, etc.

Is there some tutorial or example code somewhere I could look at? Ive thumbed through the documentation, but its not very newcomer-friendly when all I am trying to do right now is make several hundred posts of our xf 1.5 work again.

What i want is basically search and replace, with a little extra logic. Any advice would be appreciated.
 
Back
Top Bottom