vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   BB Code Enhancements - Special Spoiler (https://vborg.vbsupport.ru/showthread.php?t=203068)

Derek Chai 01-24-2009 10:00 PM

Special Spoiler
 
1 Attachment(s)
PLEASE CLICK INSTALL




Since nobody would do it for me I have coded it myself. First go add a new BBCode

Title:
Code:

Spoiler
BB Code Tag Name
Code:

Spoiler
Replacement:
HTML Code:

<script language='JavaScript' type='text/javascript'>
        <!--
            function spoiler(obj)
            {
                  for (var i = 0; i < obj.childNodes.length; i++)
                  {
                        if (obj.childNodes[i].id == 'idTitle')
                            titleRow = obj.childNodes[i];
                    if (obj.childNodes[i].id == 'idSpoiler')
                    {
                        if (obj.childNodes[i].style.display != 'none')
                        {
                            obj.childNodes[i].style.display = 'none';
                            titleRow.innerHTML = '&nbsp;<b>Click to show spoiler</b>';
                        }
                        else
                        {
                            obj.childNodes[i].style.display = 'block';
                            titleRow.innerHTML = '&nbsp;<b>Click to hide spoiler</b>';
                        }
                    }
                }
            }
        //-->
</script>
<div width="100%" class="alt1" onclick="spoiler(this);" style="border-collapse: collapse; border: solid thin black;"><div id="idTitle" class="alt2" style="border-collapse: collapse; border: solid thin black; width: 100%;">&nbsp;<b>Click to show spoiler</b></div><div id="idSpoiler" style="display: none;">{param}</div></div><br />

Example:
Code:

[spoiler]Derek rules![/spoiler]
Description:
Code:

Creates and hides text.
Remove Tag If Empty: Yes

DEMO: http://forum.i628.net/showpost.php?p=12&postcount=3 (If it's down it's probably due to host problems. Please look at screenshot instead if down.

Derek Chai 01-25-2009 05:47 PM

*Reserved*

Hornstar 01-25-2009 09:19 PM

Quite a simple spoiler. i'm pretty sure there are many already on the site that have this, but one which has usergroup permissions would be nice.

Derek Chai 01-26-2009 01:57 AM

Trythe bbcode permissions mod?

imaroot 01-30-2009 09:45 AM

installed

sandt38 02-03-2009 02:24 AM

It didn't work for me.

DonHouston 02-03-2009 03:44 AM

how could i make this NWS instead of spoiler, just rename everything?

ottawamom 02-03-2009 03:45 PM

Won't work for me either.

Derek Chai 02-03-2009 10:17 PM

Hmm, I'm sure I fixed it.. Link to one that doesn't work? Also to replace the NWS name you can change "Click to show spoiler" to what you want and "Click to hide spoiler"

Jasem 03-23-2009 08:08 PM

Good, installed

duditas 04-02-2009 12:19 AM

Installed. Thanx :)

odln018 04-15-2009 01:22 PM

Thanks, installed.

marianoblesa 05-04-2009 02:31 AM

Thanks, installed.

vdinh 05-14-2009 05:32 PM

Great spoiler! I like it simple :)
Derek, is there a way to make the NWS name line move all the way to the bottom of the post (instead of on top like now) once somebody clicks on it to open the whole message. That way, once a user reaches the end of the post, he/she can click the NWS line again to hide it.

adnoid 05-21-2009 08:59 PM

Installed, works great.

Made a slightly modified duplicate & edited it for use with NSFW content as well!

viper357 09-03-2010 07:24 AM

edit: nevermind, my stupidity.

Works great, thanks.


All times are GMT. The time now is 01:18 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.04013 seconds
  • Memory Usage 1,745KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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