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 - Most elegant Spoiler-Tag [BB-Code] (https://vborg.vbsupport.ru/showthread.php?t=279069)

Grazu 02-22-2012 11:00 PM

Most elegant Spoiler-Tag [BB-Code]
 
1 Attachment(s)
This mod is automatically compatible with vB3.6.x, vB3.7.x, vB3.8.x and vB4.x.x



Demo: http://Uniquecrew.net/Spoiler.php
Demo-Mirror: http://hrkleZ.bplaced.net/Files/Spoiler.html (as you can see in the source, images are base64 encoded in the Demo-Mirror)


Installation Instructions:
  1. Open your AdminCP Custom BB Codes => Add New BB Code
  2. Title: Spoiler
  3. BB Code Tag Name: Spoiler
  4. Replacement:
    HTML Code:

    <div style="padding: 0px 5px 0px 5px;  border: 1px solid #DF7401; margin-left: 20px; width: 40%"><div align="center" style="text-transform: none; border-bottom: none; display: block; padding: 3px 0px 3px 0px;">
    <span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
      if (spoiler.style.display != ''){
        this.parentNode.parentNode.style.width = '80%'
        this.parentNode.style.borderBottom = '1px solid #CCCCCC';
        spoiler.style.display = '';
        this.getElementsByTagName('a')[0].innerHTML = '->Close Spoiler<-';
      }else{
        this.parentNode.parentNode.style.width = '40%'
        this.parentNode.style.borderBottom = 'none';
        spoiler.style.display = 'none';
        this.getElementsByTagName('a')[0].innerHTML = '->Open Spoiler<-';
      }"
    />

    <a rel="nofollow" href="#" onClick="return false;" style="text-decoration: none;"><b style="font-size: 0.8em;">->Spoiler ?ffnen<-</b></a>
    </span>
    </div>
    <div class="quotecontent">
    <div align="center" style="display: none; padding: 5px 0px 5px 0px;"><br> {param}</div>
    </div>
    </div><br />

  5. Example: [SPOILER]Hidden Text Here[/SPOILER]
  6. Description: The [SPOILER]-Tag allows you to hidden or hide your text.
  7. Use {option}: No
  8. Button Image (Optional) => Upload this https://vborg.vbsupport.ru/attachmen...1&d=1330032950 Picture on you Server and enter the exact Address of it (/images/ is recommended).
  9. Remove Tag If Empty: Yes
  10. Disable BB Code Within This BB Code: No
  11. Disable Smilies Within This BB Code: No
  12. Disable Word Wrapping Within This BB Code: No
  13. Disable Automatic Link Parsing Within This BB Code: No
After you finished, you can compare your Settings with this Screenshot. ;)


I hope you like it! (:

This mod is automatically compatible with vB3.6.x, vB3.7.x, vB3.8.x and vB4.x.x

clutchthese 02-26-2012 06:58 AM

When viewing on mobile device, it crashes app and when in mobile browser, redirects to homepage.... Anything to fix this?

Grazu 02-27-2012 03:10 PM

Your mobile have to support JavaScript, all iPhones & Android-Devices are compatible with this. ;)

ceho 02-28-2012 06:06 PM

Hi, a very nice addon, thanks a lot :). There is just one thing that I don't get managed: I would like to have the font inside of the spoiler box that's saying Open/Close Spoiler in the same font style like the one that's displayed before opening the box for the first time. So I would like to add
Code:

style="text-decoration: none;"><b style="font-size: 0.8em;"
into the span tag that contains the onClick stuff etc. But I don't get it. Would you mind helping me that the fonts are displayed all the same? Thanks a lot :).

clutchthese 02-28-2012 08:27 PM

Quote:

Originally Posted by Grazu (Post 2303886)
Your mobile have to support JavaScript, all iPhones & Android-Devices are compatible with this. ;)

I'm talking the iphone app... via mobile suite.

It is on an iphone. you can open the spoiler, but to select the pic for a bigger view results in a crash.

Grazu 02-29-2012 02:03 PM

@ceho:
Maybe this could help you ;)
HTML Code:

<div style="padding: 0px 5px 0px 5px;  border: 1px solid #DF7401; margin-left: 20px; width: 40%">
<div align="center" style="text-transform: none; border-bottom: none; display: block; padding: 3px 0px 3px 0px;">
<span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
  if (spoiler.style.display != ''){
    this.parentNode.parentNode.style.width = '80%'
    this.parentNode.style.borderBottom = '1px solid #CCCCCC';
    spoiler.style.display = '';
    this.getElementsByTagName('a')[0].innerHTML = '->Spoiler schlie?en<-';
  }else{
    this.parentNode.parentNode.style.width = '40%'
    this.parentNode.style.borderBottom = 'none';
    spoiler.style.display = 'none';
    this.getElementsByTagName('a')[0].innerHTML = '->Spoiler ?ffnen<-';
  }"
/>

<a rel="nofollow" href="#" onClick="return false;" style="text-decoration: none;"><b style="font-size: 0.8em;">->Spoiler ?ffnen<-</b></a>
</span>
</div>
<div class="quotecontent">
<div align="center" style="display: none; padding: 5px 0px 5px 0px;"><br> <b style="font-size: 0.8em;">{param}</b></div>
</div>
</div><br />

Quote:

Originally Posted by clutchthese (Post 2304387)
I'm talking the iphone app... via mobile suite.

It is on an iphone. you can open the spoiler, but to select the pic for a bigger view results in a crash.

I'm using Safari, without problems. (:

ceho 02-29-2012 05:16 PM

Hi Grazu, thanks very much. That's part of it :). Actually I want to change the font inside of this bit:

Code:

<span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
  if (spoiler.style.display != ''){
    this.parentNode.parentNode.style.width = '98%'
    this.parentNode.style.borderBottom = '1px dotted #000000';
    spoiler.style.display = '';
    this.getElementsByTagName('a')[0].innerHTML = '>> Close Download Links <<';
  }else{
    this.parentNode.parentNode.style.width = '98%'
    this.parentNode.style.borderBottom = 'none';
    spoiler.style.display = 'none';
    this.getElementsByTagName('a')[0].innerHTML = '>> Open Download Links <<';
  }" />

Any idea how to do this?

And would you have an idea if it's possible to always have the spoiler at the bottom of each post, automatically? Thanks and keep up the great work mate.

clutchthese 04-07-2012 11:04 AM

Has anyone else tried this on a mobile? On two of my forums it redirects to homepage (my site.com/#)

benjaminlwells 04-09-2012 02:31 PM

any way to make the spoiler keep hidden text from showing on widgets and blocks?

Amaury 05-06-2012 09:43 PM

Thank you.

Also, before opening it when first visiting said thread, it says "->Spoiler öffnen<-." However, once you open it, it changes to Close / Open Spoiler. What's offnen?

Is there a way to get it to say Open Spoiler when you first go to said thread?

Edit: Never mind, trying another one.

Glockie 05-10-2012 09:14 PM

Thank you for the very instructive guide - clearly written and easy to follow.

Superb! Thank you. :)

Grazu 05-29-2012 03:55 PM

Quote:

Originally Posted by Amaury25 (Post 2326873)
Thank you.

Also, before opening it when first visiting said thread, it says "->Spoiler ?ffnen<-." However, once you open it, it changes to Close / Open Spoiler. What's offnen?

Is there a way to get it to say Open Spoiler when you first go to said thread?

Edit: Never mind, trying another one.

"?ffnen" means open in german. ;)

onealien 07-30-2012 03:25 AM

works great and has a clean look....thx

Snakes18 10-03-2012 05:18 PM

Apparently on 4.2 you can see the hidden text from Google. Is there a way to prevent this?

gsmlover4u 10-20-2012 12:21 PM

dimo links not working

Grazu 11-24-2012 04:58 PM

Quote:

Originally Posted by Snakes18 (Post 2370529)
Apparently on 4.2 you can see the hidden text from Google. Is there a way to prevent this?

You could unescape the {param}. ;)

alzaabi 06-11-2014 06:38 PM

How to centre the spoiler ? and how to make the font
inside the spoiler little bigger ?

ramesh_umk3 06-13-2014 06:26 PM

Suppose if any users used align it will not be applicable for bbcode remember that

Quote:

<center><div style="padding: 0px 5px 0px 5px; border: 1px solid #DF7401; margin-left: 20px; width: 40%"><div align="center" style="text-transform: none; border-bottom: none; display: block; padding: 3px 0px 3px 0px;">
<span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('d iv')[2];
if (spoiler.style.display != ''){
this.parentNode.parentNode.style.width = '80%'
this.parentNode.style.borderBottom = '1px solid #CCCCCC';
spoiler.style.display = '';
this.getElementsByTagName('a')[0].innerHTML = '->Close Spoiler<-';
}else{
this.parentNode.parentNode.style.width = '40%'
this.parentNode.style.borderBottom = 'none';
spoiler.style.display = 'none';
this.getElementsByTagName('a')[0].innerHTML = '->Open Spoiler<-';
}" />
<a rel="nofollow" href="#" onClick="return false;" style="text-decoration: none;"><b style="font-size: 0.8em;">->Spoiler ?ffnen<-</b></a>
</span>
</div>
<div class="quotecontent">
<div align="center" style="display: none; padding: 5px 0px 5px 0px; font-size:18px;"><br> {param}</div>
</div>
</div></center><br />
just increase or decrease of font-size:18px;

Simpler Spoilers are good which takes less space of postbit:
Demo

alzaabi 06-15-2014 04:10 AM

Thanks a lot for all

kiba snowpaw 11-14-2014 10:56 PM

i have VB 3.8.8 and evrytime i ad this i get
Forbidden
You do not have permission to access this document.
Web Server at danskeanimeklub.dk
and then my homepage down for 5 min or so
can someone tell me why and its only when useing this BB Code Code ???

donisgh 11-30-2014 06:05 AM

Thanks a lot... this thread help me :)

fayax 12-14-2014 11:19 PM

Definitely most elegant. Thank you!

Feindbild 12-17-2014 01:06 PM

Why exactly are you using a fraud/hacking board to demonstrate your spoiler?

jkotlowski 06-03-2015 05:23 PM

Is there any way to allow users to define the text that appears on the spoiler tag?

[spoiler=text to appear instead of open spoiler]text to be inside tag[/spoiler]

Something like that?

Scans007 05-04-2016 04:13 PM

Bumping an old thread - works great for me. Just one question - where do I reference the button image in the code to have it show up?

MarkFL 05-04-2016 04:41 PM

1 Attachment(s)
Quote:

Originally Posted by Scans007 (Post 2570130)
Bumping an old thread - works great for me. Just one question - where do I reference the button image in the code to have it show up?

When you define/edit the BBCode, you enter the URL of the image here:

https://vborg.vbsupport.ru/attachmen...1&d=1462387173

Flipfloptrader 04-05-2017 07:42 AM

Is it me or is this in German? Spoiler offnen?

Am I missing something?

Flipfloptrader 04-05-2017 07:44 AM

Ignore, just replaced offnen and schließen to open and close.

Works fine on 4.2.4


All times are GMT. The time now is 07:43 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.01325 seconds
  • Memory Usage 1,811KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete