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 - Spoiler BBCode (auto-created and configurable) (https://vborg.vbsupport.ru/showthread.php?t=320557)

Outlaw Mantis 08-21-2016 12:22 PM

Does this code support a title option? When I had a MyBB forum before I transferred, there was a great spoiler code that allowed [spoiler=Spoilers about Half-Life 3]It will never happen[/spoiler] for example. Then the title option text would appear next to the reveal button and be easy to see.

It made it really handy for seeing what the spoiler is, but with the current spoiler code I'm using (not yours, though yours looks better already) you have no clue about that unless the person types that outside of the code. Which is only a small inconvenience but the option was great on MyBB. Plus, a lot of the old posts before the transfer have broken spoiler code because my current spoiler code doesn't have the option.

MarkFL 08-21-2016 12:40 PM

What you can do is once you install this product, you can edit the BB Code whereby the "Replacement" is:

HTML Code:

<div class="spoiler_wrapper"><div class="spoiler_button_wrapper"><input type="button" value="Show" class="spoiler_button" title="Reveal Contents" onclick="var el = this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0];if(el.style.visibility == 'hidden')
{el.style.visibility = 'visible'; el.style.maxHeight = 'none'; this.value = 'Hide'; this.title='Conceal Contents';} else {el.style.visibility = 'hidden'; el.style.maxHeight = '0'; this.value='Show'; this.title='Reveal Contents'}"
>
<span style="margin-left: 1em">{option}</span></div><div class="spoiler_text"><div name="spoiler" style="visibility: hidden; overflow: hidden; max-height: 0">{param}</div></div></div>

And set "Use {option}" to "Yes" and save the BB Code.

Outlaw Mantis 08-21-2016 01:48 PM

Thank you, but it isn't working. It just displays [spoiler]what is in-between[/spoiler]. And yes, I replaced the replacement, enabled {option} and updated it all to use "spoiler" instead of "sp". I changed the old code to "spoiler2" beforehand. See the screenshot. Where have I gone wrong?

https://vborg.vbsupport.ru/external/2016/08/5.jpg

Thanks.

MarkFL 08-21-2016 01:58 PM

Once you enable the option, then you need to enter in your post something like:

[spoiler=Title]Hidden text.[/spoiler]

Outlaw Mantis 08-21-2016 02:11 PM

Is it not possible to have it work with both [spoiler] and [spoiler=text]? If I defined both codes—your suggested update and the original—but both using the "spoiler" as the code name, would this break it? There are hundreds of posts on the board where people have just written [spoiler] alone.

MarkFL 08-21-2016 02:46 PM

Yes, you can define one to use the option and one not to use the option, with both having the same tag name. :)

MarkFL 01-06-2017 02:07 PM

Update - Version 1.4:

MarkFL 02-20-2017 04:33 AM

Update - Version 1.5:
  • Added option to mask spoiler content in threadbit previews (forumdisplay and search).


All times are GMT. The time now is 01:27 PM.

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.03930 seconds
  • Memory Usage 1,737KB
  • 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
  • (1)bbcode_html_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
  • (8)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