vBulletin - where does this code go?

Soldato
Joined
2 Jun 2004
Posts
18,423
I need a spoiler tag for my board, and I read somewhere that this works...

Replacement:
Code:
<div id="spoiler"><div><font size="4"></font><input type="button" value="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'; } 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="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>

But I have no idea where to put it? :confused:
 
You would create a custom BBCode.
for the tag, then for the 'content' you would add your above code.

Haven't used vBulletin probably in about a year, but that's how it's done on IPB :)

EDIT:

Just looking on one of my vBulletin forums. Log into AdminCP -> Custom BB Code (on the side) -> Add New BB Code

Title: Spoiler
Tag: spoiler
Replacement: (your code here)
Example: Can leave blank, but
blah blah
Description: Can leave blank, but explain how it works perhaps...
Use {option}: No

Hope that helps :)
 
Last edited:
Back
Top Bottom