MyBB Community Forums
Spoiler MyCode - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: Spoiler MyCode (/thread-128663.html)

Pages: 1 2


Spoiler MyCode - TheAuthoringBay - 2012-11-03

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


RE: Spoiler MyCode - Destroy666 - 2012-11-07

http://mods.mybb.com/view/spoiler-bbcode
Edit CSS as you wish.


RE: Spoiler MyCode - dragonexpert - 2012-11-09

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>



RE: Spoiler MyCode - Wildcard - 2012-11-09

(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.


RE: Spoiler MyCode - Leefish - 2012-11-09

(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.


RE: Spoiler MyCode - dragonexpert - 2012-11-09

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.


RE: Spoiler MyCode - Wildcard - 2012-11-09

(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.


RE: Spoiler MyCode - TheAuthoringBay - 2012-11-10

Got this fixed. Thanks.


RE: Spoiler MyCode - iHydra - 2012-11-10

(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.


RE: Spoiler MyCode - happyyasu09 - 2014-03-07

(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.