vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Better Spoiler bb code (https://vborg.vbsupport.ru/showthread.php?t=162449)

Ezo 11-10-2007 10:00 PM

Better Spoiler bb code
 
Hello, i had to post this for a friend,
Enjoy it.


Code made by ilT

My site:
http://somewhereyoubelong.com

No Title
Title: Spoiler (No Title)
Tag: spoil
Replacement:

Code:

<div id="spoiler"><div><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" />
<div id="show" style="background-image:url(http://img37.picoodle.com/img/img37/5/11/7/f_backgroundm_872c796.png); display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
{param}</div>
<div id="hide"></div></div></div>

Example: [spoil]Some text[/spoil]
Use Option: No

With Title
Title: Spoiler (With Title)
Tag: spoil
Replacement:
Code:

<div id="spoiler"><div><font size="4">{option}</font><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin-left:10px;margin-bottom:3px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" />
<div id="show" style="background-image:url(http://img37.picoodle.com/img/img37/5/11/7/f_backgroundm_872c796.png); display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
{param}</div>
<div id="hide"></div></div></div>

Example: [spoil=Title Text]Some Text[/spoil]
Use Option: Yes

Screenshot
https://vborg.vbsupport.ru/external/2007/11/9.png

yoyoyoyo 11-11-2007 04:32 PM

thanks much - here is the image so people can upload it to their own server. Can the hidden text be viewed in archive mode?

Magnumutz 11-11-2007 04:35 PM

Just change the image with anything you want...
All i can say is that it's pretty nasty from him to add such a background.

puertoblack2003 11-11-2007 07:24 PM

no go error

Warning: sprintf() [function.sprintf]: Too few arguments in includes\class_bbcode.php on line 1115

LlanMan 11-12-2007 07:25 AM

I get this error also.

Other than that it looks good.

projectego 11-12-2007 07:43 AM

Very, very cool. I like it. :)

[high]* projectego clicks install[/high]

TWTCommish 11-12-2007 02:10 PM

Does this function properly with multiple spoilers in a single post? I hacked my own board for somethign similar, but ran into that particular hurdle.

liquidrage 11-16-2007 05:25 PM

The problem with this is the spoilers are shown in the mouse over even since the replacement doesn't take effect until they view the thread.

superthang 11-30-2007 12:24 PM

can someone tweak this into so that we can use our own images?
like we can supply our own little thumbnail for each spoiler ?

thanks

techgsmnet 11-30-2007 04:11 PM

Quote:

Originally Posted by superthang (Post 1392320)
can someone tweak this into so that we can use our own images?
like we can supply our own little thumbnail for each spoiler ?

thanks

you about backgrount picture?
Just change picture link to you.

SamuraiNigel 12-01-2007 02:15 AM

So, this looks like something I want, but I don't know what to do with the code. Do I throw this into a template? Which one? Do I replace what's in the template or add to it? There aren't any instructions here that i can see...

Edit: Nevermind, I figured it out.

superthang 12-01-2007 11:14 AM

Quote:

Originally Posted by techgsmnet (Post 1392414)
you about backgrount picture?
Just change picture link to you.

no, i mean like can we supply each with different image so user can click on that image and it show something related to that image

example
[spoiler=http://vbulletin.com/car.gif]content content content about car[/spoiler]

[spoiler=http://vbulletin.com/boat.gif]content content content about boat[/spoiler]

and so on.

also got this error: style is not "null" or an object

vasek 01-02-2008 05:43 PM

added custom title on button:
add new BB code:

Title: Spoiler with custom text on button
Tag: spoiler2
Code:

<div id="spoiler"><div><input type="button" value="{option}" style="width:160px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '')
{
 this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = '';
 this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none';
 this.innerText = '';
} else
{
 this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none';
 this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = '';
 this.innerText = '';
}" />
<div id="show" style="display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
{param}</div>
<div id="hide"></div></div></div>

sample: [spoiler2=text on button]hidden text[/spoiler2]
use option: On

steve1966 01-03-2008 07:30 AM

ok i managed to figure out how to install but when i click on my custom button on the tool bar I a get a pop up same as insert an image

and when i post the what i have inserted into the box i cannot get the hid show to show up
please can someone tell me what i have done wrong

tintructo 01-03-2008 09:40 AM

Quote:

Originally Posted by steve1966 (Post 1414464)
hi can someone tell me what template to add this code to thanks

or if i have to add this mod code somewhere else please can you give me a an instruction how to install

thanks

AdminCP -> Custom BB Codes -> Add New BB Code

in the title input , put something like "Spoiler"
in the tag input, put something like "spoiler" so you will have the bbcode like this : [spoiler]text[/spoiler]
in the replacement textarea, put the code of the spoiler that you can see on the thread

and that's all :)

steve1966 01-03-2008 10:25 AM

its ok i have sorted it now and got it working

mikkitine 03-28-2008 12:15 PM

Multiple spoiler tags won't open after the first spoiler tag has been open regardless of whether they were used in the same post or not. This happens on IE/Safari browsers afaik.

tjsrachel 04-04-2008 01:07 AM

Quote:

Originally Posted by vasek (Post 1413994)
added custom title on button:
add new BB code:

Title: Spoiler with custom text on button
Tag: spoiler2
Code:

<div id="spoiler"><div><input type="button" value="{option}" style="width:160px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '')
{
 this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = '';
 this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none';
 this.innerText = '';
} else
{
 this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none';
 this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = '';
 this.innerText = '';
}" />
<div id="show" style="display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
{param}</div>
<div id="hide"></div></div></div>



sample: [spoiler2=text on button]hidden text[/spoiler2]
use option: On

I am using this one for the custom text on the button but after you press the button the text disappears and does not come back. Anyone have any ideas how I can get the text to stay after selected?

gibigbig 04-22-2008 09:06 AM

works nicely
i customized it for my site

Coldhands 05-05-2008 06:45 PM

Found a bug!


Spoilers can be used to lure people to phishing sites.

Allow me to demonstrate:

If you have spoilers on your forum, post this and click on the spoiler.

PHP Code:

[B]Ohhh WowsCheck this out yous guys!!1[/B]
[
spoiler]Okaynow click it and watch [URL="http://www.vbulletin.org.forum.google.com/omgwhatisurpword"][COLOR=Black][spoiler]j/k! :)[/spoiler][/COLOR][/URL][/spoiler


Any suggestions on how to fix this lil bug?

Coldhands 05-20-2008 07:36 PM

Bump.

This hack does make vB vulnerable to steal passwords via phishing. At the minimum, people should know that clicking on a spoiler button shouldn't open a new window. On a fast enough phishing server, the user may not even notice (assuming the phishing server served up already cached images).

tick tock

Also, you can't nest the spoilers in IE. If you put a spoiler inside of a spoiler it just craps out.

MonkYZ 07-12-2008 07:40 PM

Quote:

Originally Posted by tjsrachel (Post 1482456)
I am using this one for the custom text on the button but after you press the button the text disappears and does not come back. Anyone have any ideas how I can get the text to stay after selected?

Same here. The title text usually dissapears... How can we fix it ?

dimitrisvb 10-26-2008 08:59 PM

by far the best spoiler tag i've seen up to now...
thanx :D

dimitrisvb 01-27-2010 04:38 PM

is this going to work with vb 4.0 ? :confused:

Per1213 03-16-2010 04:45 PM

This doesn't work in Chrome. Any plans to fix that?


All times are GMT. The time now is 03:28 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.01134 seconds
  • Memory Usage 1,797KB
  • 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_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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