MyBB Community Forums

Full Version: Spoiler MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can anyone give me a custom spoiler MyCode that would suit the theme of my website? +1 to anyone who can.

http://theauthoringbay.com/index.php
Why use a plugin when it can be handled in the MyCode section of the admin cp?

Regular Expression
\[spoiler\](.*?)\[/spoiler\]

Replacement
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><input type="button" value="Show Spoiler" style="width:100px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Spoiler'; }" />
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">$1</div>
</div>
</div>
(2012-11-09, 12:47 AM)dragonexpert Wrote: [ -> ]Why use a plugin when it can be handled in the MyCode section of the admin cp?

A MyCode spoiler can't nest.
(2012-11-09, 01:24 AM)Wildcard Wrote: [ -> ]
(2012-11-09, 12:47 AM)dragonexpert Wrote: [ -> ]Why use a plugin when it can be handled in the MyCode section of the admin cp?

A MyCode spoiler can't nest.

This. This is why I use a plugin spoiler.
The only thing my replacement doesn't support is a spoiler within a spoiler. It supports all other code I've tried, including my own custom codes. I can't see why you'd need to do a spoiler within a spoiler.
(2012-11-09, 11:58 AM)dragonexpert Wrote: [ -> ]The only thing my replacement doesn't support is a spoiler within a spoiler. It supports all other code I've tried, including my own custom codes. I can't see why you'd need to do a spoiler within a spoiler.

A spoiler within a spoiler is called 'nested' spoilers.

They can be used for many different things. On RC we use them for tutorials and to clean up our FAQ.

I even have members that have created interactive text adventure games using spoilers.
Got this fixed. Thanks.
(2012-11-09, 11:40 AM)Leefish Wrote: [ -> ]
(2012-11-09, 01:24 AM)Wildcard Wrote: [ -> ]
(2012-11-09, 12:47 AM)dragonexpert Wrote: [ -> ]Why use a plugin when it can be handled in the MyCode section of the admin cp?

A MyCode spoiler can't nest.

This. This is why I use a plugin spoiler.

I wonder when you would need to use a nest of spoilers.

I've seen people use nest to piss others off.

But yea, plugin spoiler is preferred more.
(2012-11-10, 10:29 PM)iHydra Wrote: [ -> ]
(2012-11-09, 11:40 AM)Leefish Wrote: [ -> ]
(2012-11-09, 01:24 AM)Wildcard Wrote: [ -> ]
(2012-11-09, 12:47 AM)dragonexpert Wrote: [ -> ]Why use a plugin when it can be handled in the MyCode section of the admin cp?

A MyCode spoiler can't nest.

This. This is why I use a plugin spoiler.

I wonder when you would need to use a nest of spoilers.

I've seen people use nest to piss others off.

But yea, plugin spoiler is preferred more.

Spoiler Nesting is used for informational posts.
Like thread: Existing groups on forums (over 5k characters, multiple infoblocks) or any other FAQ post, or instruction set. Very hard to read such long posts.
Pages: 1 2