vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - Multiple Options BBCode (https://vborg.vbsupport.ru/showthread.php?t=326102)

Master Of Unive 02-12-2018 10:00 PM

Multiple Options BBCode
 
1 Attachment(s)
Multiple Option BBCode 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}
PHP Code:

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


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

<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
PHP Code:

<span style="color: {option1}; font-size: {option2}; font-family: {option3}">{param}</span>
[
BBCODE=red|20|Arial]something here[/BBCODE



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

[BBCODE=red||]Something here[/BBCODE



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

Quote:

Originally Posted by IggyP (Post 2592866)
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...
HTML Code:

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

<span style="background-color: {option1}; color: {option2}!important; color:black">{param}</span>
HTML Code:

<span class="highlight" style="background-color: {option1}; color: {option2}">{param}</span>
with the css in the last example being:
HTML Code:

.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

Quote:

Originally Posted by Alan_SP (Post 2592885)
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

Quote:

Originally Posted by IggyP (Post 2592887)
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

Quote:

Originally Posted by IggyP (Post 2592891)
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

PHP Code:

[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:


All times are GMT. The time now is 07:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02525 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_html_printable
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete