vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   BB Code Enhancements - Special Spoiler (https://vborg.vbsupport.ru/showthread.php?t=182791)

Derek Chai 06-16-2008 10:00 PM

Special Spoiler
 
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 06-17-2008 08:45 PM

Reserved for future use.

xxalexkimxx 06-17-2008 08:49 PM

What is it for?

Derek Chai 06-17-2008 08:50 PM

It's a spoiler.. Where you can hide text from people and they can choose to view it by clicking on the bar.

Derek Chai 06-17-2008 09:04 PM

I added a demo.

Hornstar 06-18-2008 08:39 AM

yeah very nice work! its good to see this again.

Derek Chai 06-18-2008 09:48 PM

Thanks for the props.

car20 06-23-2008 03:01 PM

i dont underestand ! please explain more
what file i must edit ?
tanks

Derek Chai 06-23-2008 08:57 PM

You add this code into the BBcode manager found in your adminCP.

TimberFloorAu 06-25-2008 09:59 PM

Any chance of putting up a demo, that doesnt require us to see 50 million adverts, messages and popups. Please

Derek Chai 06-26-2008 09:50 PM

Ahh sorry that link was to earn me some revenue I have posted a link to the direct demo.

TimberFloorAu 06-28-2008 03:51 AM

Mate, why would you want to earn revenue from a SPOLIER mod, and have 2 links...

One demo which goes via tons of adverts.
One demo, which states"doesnt earn me revenue" and you have deliberately, made it h ttp so its not clickable ( only by copy and paste )

:down: Lost my interest without a doubt !

Derek Chai 06-28-2008 07:43 PM

It's ok it's your opinion I'm sure my mod has helped other people than you.

arcadian_girl 06-29-2008 05:15 AM

lost my interest as well. You have to earn revenue for making a spoiler bb code?

Derek Chai 06-30-2008 12:40 AM

Yes, I need the money to pay for my internet fees and the website hosting for my main site.

Brandon Sheley 06-30-2008 12:43 AM

interesting idea, so search engines can see it still? it looks like it on the demo

joopster 07-02-2008 02:54 PM

I entered as you said but I cannot get it to work.

lostgirl815 07-02-2008 11:49 PM

I couldn't get it to work either, and I much prefer using text as the show/hide on the spoiler. I hate the clonky Windows button on my current one. I'll keep an eye on this in case someone figures it out. :/

Singularity 07-04-2008 01:56 AM

Unclickable when I tried it.

neopet001 07-11-2008 10:55 AM

Yes, but does it have any difference from the old one?
I love this mod

Derek Chai 01-25-2009 05:42 PM

I have fixed the mod. It should work properly now.

gmerin 01-25-2009 05:57 PM

Quote:

Originally Posted by Derek Chai (Post 1724462)
I have fixed the mod. It should work properly now.

nope

MotoMihalich 06-24-2009 09:35 PM

I have made tuning of this code so the spoilers look now as standard VB floating panels and able to have custom spoiler headers. Here is the demo.

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 = '<img src="/forum/images/buttons/collapse_thead_collapsed.gif" align="absmiddle">&nbsp;{option}';
                        }
                        else
                        {
                            obj.childNodes[i].style.display = 'block';
                            titleRow.innerHTML = '<img src="/forum/images/buttons/collapse_thead.gif" align="absmiddle">&nbsp;{option}';
                        }
                    }
                }
            }
        //-->
</script>
<div align=center onclick="spoiler(this);" style=""><div align=left id="idTitle" style="width: 95%; margin-top: 6px; clear: both; border: solid #0B198C; border-width: 1px 1px 1px 1px; padding: 5px 8px 5px; line-height: 15px; font-weight: bold; background: #5C7099 url(/forum/images/gradients/gradient_thead.gif) repeat-x top left; color: #FFFFFF; font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; cursor: pointer; "><img src="/forum/images/buttons/collapse_thead_collapsed.gif" align="absmiddle">&nbsp;{option}</div><div align=left id="idSpoiler" style="display: none; width: 95%; padding: 5px 8px 5px;  display: none; border-left: 1px solid #0B198C; border-right: 1px solid #0B198C; border-bottom: 1px solid #0B198C; background: #F5F5F5; color: #000000; font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-weight: normal;">{param}</div></div>

Regretefully, the script does not allow to use nested spoilers :(:(:(


All times are GMT. The time now is 07:13 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.01254 seconds
  • Memory Usage 1,771KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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