PDA

View Full Version : BB Code Enhancements - Multiple Options BBCode


Master Of Unive
02-12-2018, 10:00 PM
Multiple Option BBCode (https://vborg.vbsupport.ru/showthread.php?t=90869) By Andreas

NOTE: I do not own this plugin. I just refactor it a bit to be compatible with PHP 5.5
The original plugin has been archived and there is no vB4 thread so I created one.

That means the plugin works perfectly in vB4. Please see screenshot for example of multiple options for BBCode.

vBulletin gives you two default parameters to create BBCode: {option} and {param}

<span style="color: {option}">{param}</span>
param



But there is only one 'option', thus limits variety of BBCode. You can still do something like this

<span {option}>{param}</span>

However the above can risk your site, and it does not actually work because BBCode system automatically sanitizes {option} and remove malformed data.


Using this Plugin, you have better way

<span style="color: {option1}; font-size: {option2}; font-family: {option3}">{param}</span>
something here




You can also omit one or more options if you don't need them. But remember there must be one left.

Something here




Changelog:
2.0:
- Switch from deprecated /e to preg_replace_callback
- Change version check url

IggyP
02-13-2018, 01:39 AM
wow....really? just when i thought i milked the bbcodes to oblivion :D

eager to test whenever i can find time...

pretty powerful tool for vb, thank you

Master Of Unive
02-13-2018, 01:50 AM
wow....really? just when i thought i milked the bbcodes to oblivion :D

eager to test whenever i can find time...

pretty powerful tool for vb, thank you

The plugin has been there for a long time, provide a powerful feature for BBCode, but not so many notice. It amazes me so I create a thread for vb4.

It is too late as current vB state though :p

IggyP
02-13-2018, 02:09 AM
haha yeah that is why it needs every tool it can get ;P.....by then it is superior in some lights at least....for a few more years then oh oh hmm...

Alan_SP
02-13-2018, 03:36 PM
Andreas has really great mods, thanks for adding this thread.

Maybe if you add simple description in first post, I see it on image, but anyway would like to have it explained with text also.

Anyway, great addition. :up:

IggyP
02-13-2018, 06:45 PM
tested and verified working....i like it to enrich bbcodes i already made and to combine some others....one thing i am not sure is good tho here....

it gives one option prompt, then the second option needs to be manually edited in? i didnt see a second prompt

it is fine for me, but you know these instagramming generation im not so sure about hmm

IggyP
02-13-2018, 10:11 PM
one other limitation i dont like....

if you do not manually edit in the second option it will break the bbcode in the cases i checked....

for example in one case with a highlighter bbcode i wish to let the default text color remain as black, yet give members the option to edit in if they are wanting another...

i tried it basic with a class/css rule to test specificity but noticed not adding that "option2" broke the whole code anyway and wouldnt display at all....so even if the specificity is correct i cant approach it like that....i also tried making a redundant color code with !important applied but also fail...

um if it helps to see the code i mean like this

basic 2 option highlighter bbcode....works unless you do not edit in option 2, which....most people would not do instinctively...
<span style="background-color: {option1}; color: {option2}">{param}</span>

my failed tries...
<span style="background-color: {option1}; color: {option2}!important; color:black">{param}</span>

<span class="highlight" style="background-color: {option1}; color: {option2}">{param}</span>

with the css in the last example being:
.highlight {
color:black;}


trying to avoid adding confusion of more and more and similar buttons in editor hmm..any ideas or its just the limits built with it perhaps?

Master Of Unive
02-14-2018, 09:12 AM
Andreas has really great mods, thanks for adding this thread.

Maybe if you add simple description in first post, I see it on image, but anyway would like to have it explained with text also.

Anyway, great addition. :up:

I have done some text to clarify the feature, but in developer way :p

tested and verified working....i like it to enrich bbcodes i already made and to combine some others....one thing i am not sure is good tho here....

it gives one option prompt, then the second option needs to be manually edited in? i didnt see a second prompt

it is fine for me, but you know these instagramming generation im not so sure about hmm

The logic of this plugin is just simple. What you want requires much more work. It's really worth to dig in if it was 8 years ago. vB has ended their support for forum add-on. vB4 is EOL also.

Master Of Unive
02-14-2018, 09:26 AM
trying to avoid adding confusion of more and more and similar buttons in editor hmm..any ideas or its just the limits built with it perhaps?

I've added description at first post for your case.

If you create a bbcode with 2 options, you have to input 2 options. However you can leave some options blank like this

[bbcode=option1||option3]text[/option]

Otherwise bbcode won't show.

There is better way but it is also more complex.

Alan_SP
02-14-2018, 03:24 PM
Thanks for textual clarification, it is more helpful, especially part that we need to enter all options, even if they remain blank. :up:

sparting
11-28-2019, 06:19 PM
I tried to use in version 5.5 on my bbcodes, but seems to only accept one option?

Will work this mod in a v5.5??