MyBB Community Forums

Full Version: I can't get any spoiler MyCode to work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been browsing the MyCodes section in hopes of finding a spoiler code but I can't.

http://community.mybb.com/thread-90744.h...ht=spoiler


I've tried that one and about 5 other popular ones. I really want one with CSS so that it looks nicer but none of them work even the ones without css. I don't know if I am doing it wrong or if I am retarded. The replacement and regular expression work but when I go to my forum and try [spoiler]klglj[/spoiler] <- is what it shows. I am on 1.6.8 too and it wasn't working that well on 1.6.7. I don't really want to install a plugin.
This is what I have in my forum and it works.

Title

Spoiler

Regular Expression

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

Replacement

<div style="margin:20px; margin-top:0px; border:#000 1px solid;padding:4px;background: #fff;">
<div><b>Spoiler</b>: <input type="button" value="Mostrar" style="width:55px;font-size:10px;margin:0px;padding:0px; margin-right: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 = 'Esconder'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Mostrar'; }">
</div>
<div style="margin: 0px; padding:0px;">
<div style="display: none;">
$1
</div>
</div>
</div>

Enabled?

Yes
(2012-06-30, 07:24 PM)Irreligious Wrote: [ -> ]This is what I have in my forum and it works.

Title

Spoiler

Regular Expression

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

Replacement

<div style="margin:20px; margin-top:0px; border:#000 1px solid;padding:4px;background: #fff;">
<div><b>Spoiler</b>: <input type="button" value="Mostrar" style="width:55px;font-size:10px;margin:0px;padding:0px; margin-right: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 = 'Esconder'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Mostrar'; }">
</div>
<div style="margin: 0px; padding:0px;">
<div style="display: none;">
$1
</div>
</div>
</div>

Enabled?

Yes

It doesn't work. :/

[Image: 50e818be2b97dee045b391b2e0f3f8b6.png]