Log in

View Full Version : BB Code Enhancements - Button spoiler


godkillah
07-14-2008, 10:00 PM
I have written a spoiler bbcode for vBdeals and i decided to also release it for other vB users to use.
it should work on any version.

Name: Spoiler bbcode
Example:to create a spoiler use:message
Description: This adds a spoiler bbtag to your forum familiar to the SMF spoiler tag,
spoiled messages are hidden with buttons, once the button it clicked the message shows/hides
Author: Godkillah
Copyright to: http://www.vbdeals.com
-----------------------------------
How to install?

Step 1.
Go to the 'Custom BB Codes' in the ACP and click 'Add New BB Code'

Step 2.
Set the Title to: Spoiler

Step 3.
Set the BB Code Tag Name to: spoiler

Step 4.
Set the Replacement to: <!--Vbdeals.com-->
<div class="spoiler"><script>
function showHide(what){
a=what.getElementsByTagName("div")[0];
if(a.style.display=='none'){
a.style.display='block';
}else{
a.style.display='none';
}}
</script>
<input type="button" onclick="showHide(this.parentNode)" value="Spoiler"><b><small>( Click to show/hide )</small></b><div style="display:none">{param}</div></div>
<!--Vbdeals.com-->

Step 3.
add a example and description if you like

Step 6.
Set all of the radio buttons to 'No'

Step 7.
press the save button


Congratulations, the spoiler bbcode has now been installed

rolfw1
07-15-2008, 08:53 AM
Nice one, thanks. :)

projectego
07-16-2008, 08:03 AM
* projectego clicks install :)

theforumist
07-16-2008, 02:51 PM
Good code but I went with another spoiler code. I'll use it if someone can tell me how to add a border and a gray shading to the spoiler box/contents.

godkillah
07-16-2008, 06:59 PM
that can be done with css i suppose :)
a simple example is<style>
.spoiler div{
border:ridge;
border-bottom-color:#999999;
border-top-color:#999999;
border-left-color:#999999;
border-right-color:#999999;
border-bottom-width:thin;
border-top-width:thin;
border-left-width:thin;
border-right-width:thin;
}
</style>

thank you all for comments

Q-v-n-s-Q
07-16-2008, 09:52 PM
thank you

Jair
07-23-2008, 07:41 PM
Very Nice!!

Installed...

acegames
07-24-2008, 12:11 PM
Works a treat , I used it to replace old bbspoiler hack as that stopped my thread prview working on search

iKuro
07-24-2008, 02:18 PM
any screenshot????

sonokai
11-07-2008, 06:06 PM
very great
thank you very much

Zylantex
04-16-2010, 12:19 PM
That was so simple. Thanks very much.

It hides images and or text so it's useful for boderline nsfw pics etc.

RRCamellini
11-30-2012, 05:01 PM
thx a lot my friend

ScreenShot

https://vborg.vbsupport.ru/external/2012/11/1.png