2017-02-14, 07:43 AM
2017-02-14, 08:55 AM
Go to ACP> Configuration and on the left hand side of the screen click on 'MyCode'
Once in there go to 'Add new code' and enter this into the fields:
Regular expression:
Replacement:
Once in there go to 'Add new code' and enter this into the fields:
Regular expression:
\[spoiler\](.*?)\[/spoiler\]
Replacement:
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input class="button2 btnlite" type="button" value="View Spoiler" style="text-align:center;width:115px;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 = 'View Spoiler'; }" /></div><div class="quotecontent"><div style="display: none;">$1</div></div></div>
2017-02-14, 10:59 AM
(2017-02-14, 08:55 AM)Nemus Wrote: [ -> ]Go to ACP> Configuration and on the left hand side of the screen click on 'MyCode'I've done it like that, but not running
Once in there go to 'Add new code' and enter this into the fields:
Regular expression:
\[spoiler\](.*?)\[/spoiler\]
Replacement:
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input class="button2 btnlite" type="button" value="View Spoiler" style="text-align:center;width:115px;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 = 'View Spoiler'; }" /></div><div class="quotecontent"><div style="display: none;">$1</div></div></div>
This is the result when I add the code
2017-02-14, 12:55 PM
Looks like you use the [ code ] tag, not [ spoiler ]
2017-02-14, 04:04 PM
I've tried the code, only the result as Tag, I mean spoiler can be opened and closed
2017-02-14, 04:05 PM
You can also try spoiler plugin instead of using Mycode :-
https://community.mybb.com/mods.php?action=view&pid=143
Though Mycode is also okay.
Regards
WallBB
https://community.mybb.com/mods.php?action=view&pid=143
Though Mycode is also okay.
Regards
WallBB
2017-02-14, 06:35 PM
You have used the code tag, not [spoiler] text here [/spoiler]
To use it, you have to use the spoiler code which is:
To use it, you have to use the spoiler code which is:
[spoiler]ENTER TEXT HERE[/spoiler]
2017-04-07, 10:12 PM
Try this one:
https://community.mybb.com/mods.php?action=view&pid=614
Others have to work too, but this add button to sceditor and stylesheet to customize spoilers.
And finally texts to multilang support, eable three types of spoilers.
So this oe should work i have it into localhost with 1.8.11 and on my site with another lesser version of m ybb but it works in all mybb 1.8.x series of mybb.
https://community.mybb.com/mods.php?action=view&pid=614
Others have to work too, but this add button to sceditor and stylesheet to customize spoilers.
And finally texts to multilang support, eable three types of spoilers.
So this oe should work i have it into localhost with 1.8.11 and on my site with another lesser version of m ybb but it works in all mybb 1.8.x series of mybb.
2017-07-10, 08:13 PM
Iv'e got this working great but having trouble adding it to the editor bar were the other codes and smiles are. (I'm a pure noob to Mybb)