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

theFM 04-14-2010 10:00 PM

[BB Code] Spoiler Tag
 
1 Attachment(s)
PLEASE CLICK ON INSTALL , IF YOU ARE INSTALLING IT , TO RECEIVE MORE UPDATES ON THIS.

This is is Without option code , with option , check posts below

As Many People PMed Me about to upgrade my Spoiler Tag code to vb4 , so I added this ,
The tag is:

[spoiler]Text you want to hide[/spoiler].

Now a guide to add it:


1. Upload the files of the attachment.
2. Log in at Admin Panel
3. Go to Style manager > All Style Options > Edit Models > headinclude.
4. Find:

Code:

<script type="text/javascript" src="{vb:stylevar  yuipath}/connection/connection-min.js?v={vb:raw  vboptions.simpleversion}"></script>
After this, add:

Code:

<script type="text/javascript" src="clientscript/spoiler.js"></script>
5. Go to the BBCode option and then select to Add a new one.
6. Enter the data:

--- Title: Spoiler
--- Tag Name: spoiler
--- Replacement:

Code:

<blockquote class="postcontent restore ">
<div class="bbcode_container">
<div class="bbcode_quote">
<div class="quote_container">
<div class="bbcode_quote_container"></div>
<div class="bbcode_postedby">
<div style="margin: 5px 20px 20px;">
<div class="alt2" style="text-align: right; margin: 0px; padding: 6px;">
    <span style="float: left; padding-top: 2px;">        <img src="images/icons/icon-spoiler.png" alt="Spoiler" />
<b>Spoiler: </b></span>
        <input value="Mostrar" style="margin: 0px; padding: 0px; width: 80px; font-size: 10px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Ocultar'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Mostrar';}" type="button">
</div>

<div style="padding-top: 4px;">
        <div class="alt2" style="display:none; margin: 0px; padding: 6px;">
                {param}
        </div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>

--- Example: [spoiler=Example]This is a spoiler tag![/spoiler]

--- Description: Tag to hide spoilers.
--- Use Option? NO
--- Bottom image: images/spoiler.gif
--- Remove Tag if Empty? Yes.
--- The other 3 options, set to No.

7 - Click to add and you are done!

It should look like this:

http://img199.imageshack.us/img199/7941/capturarqs.png

Note : - I have added this as a free source , you are free to edit it and help yourself , but add your modification in here aswel , so that you will help others ,
Users please browse through more posts to see more modification of this mod , please Click Install and Rate the Mod :)

dhemitz 04-15-2010 11:56 AM

Thanks theFM ........ i will to try...

Oyabun 04-15-2010 05:18 PM

Can you make it slide?

vicelover 04-16-2010 06:14 AM

Any screenshots? Thanks

Mukashi 04-16-2010 11:22 AM

Getting a few errors with this on my test board

If the spoiler is in the format
[spoiler=Example]This is a spoiler tag![/spoiler]
it just shows up as text

If it's in the format
[spoiler]This is a spoiler tag![/spoiler]
it displays fine, but if there are multiple spoilers in the post and you click to open any of them, they only open the first one. Also, if you click the image in the spoiler thing, it opens a new page displaying just that image, rather than opening the spoiler.

theFM 04-26-2010 08:40 PM

Thanks for saying , Fixed the Things ...

Try Now , it was doing alright now

jeremyricci 05-06-2010 07:18 PM

Quote:

Originally Posted by theFM (Post 2027797)
Thanks for saying , Fixed the Things ...

Try Now , it was doing alright now

I've tried it as well, and I'm getting the same error. Perhaps I made an installation error? When I have multiple spoiler tags in 1 thread, only the first spoiler tag is revealed when clicked, the others all revert back to the original tag.

Also, would it be possible to make the "Spoiler" text a button to click, rather than selectable text? I suppose I could look into the HTML for that.

obmob 05-06-2010 09:13 PM

This is a nice addon, thanks :)

ddaybofb 05-11-2010 04:23 PM

Quote:

Originally Posted by jeremyricci (Post 2032744)
I've tried it as well, and I'm getting the same error. Perhaps I made an installation error? When I have multiple spoiler tags in 1 thread, only the first spoiler tag is revealed when clicked, the others all revert back to the original tag.

Also, would it be possible to make the "Spoiler" text a button to click, rather than selectable text? I suppose I could look into the HTML for that.

Im having the same problem

Pangramma 05-14-2010 03:13 PM

I've figured out a workaround by other codes found on google...

HTML Code:

<blockquote class="postcontent restore ">
<div class="bbcode_container">
<div class="bbcode_quote">
<div class="quote_container">
<div class="bbcode_quote_container"></div>
<div class="bbcode_postedby">
<div style="margin: 5px 20px 20px;">
<div class="alt2" style="text-align: right; margin: 0px; padding: 6px;">
    <span style="float: left; padding-top: 2px;">        <img src="images/icons/icon-spoiler.png" alt="Spoiler" />
<b>Spoiler: <i>{option}</i></b></span>
        <input value="Mostrar" style="margin: 0px; padding: 0px; width: 80px; font-size: 10px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Ocultar'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Mostrar';}" type="button">
</div>

<div style="padding-top: 4px;">
        <div class="alt2" style="display:none; margin: 0px; padding: 6px;">
                {param}
        </div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>


Notice i'm using the OPTION tag, so be carefull


This will work for those threads with more than one spoiler, avoiding the load of the javascript (so if you do this, remove the code in headinclude)


All times are GMT. The time now is 04:46 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.01062 seconds
  • Memory Usage 1,752KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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