• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add spoiler tags to your forum [MyBB 1.4 / 1.6 / 1.6.4]
#1
How to add spoiler tags to your forum [MyBB 1.4 / 1.6 / 1.6.4]

A really easy way to add [spoiler] tags to your forum.

1) Go to your Admin CP > Configuration > MyCode > Add new MyCode

Title: Spoiler
Short Description: Spoiler
Regular Expression:
Code:
\[spoiler\](.*?)\[/spoiler\]
Replacement:
Code:
<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>
Enabled: Yes

You could add the replacement to your CSS file and link it that way but this is the easy way.

Result: [spoiler]This is a spoiler[/spoiler]
  Reply


Messages In This Thread
How to add spoiler tags to your forum [MyBB 1.4 / 1.6 / 1.6.4] - by Mark - 25-09-2011, 01:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A few tips on how to secure a MyBB forum Mark 0 19,793 19-11-2014, 03:20 AM
Last Post: Mark
  Large database table mybb_debuglogs MyBB forum Mark 0 10,307 30-09-2014, 03:05 PM
Last Post: Mark
  [HOW TO] Ad placement above the fold on a MyBB Forum - Google Adsense Mark 0 12,738 27-05-2014, 03:24 PM
Last Post: Mark
  How to export / backup a MyBB forum theme Mark 0 11,470 21-02-2011, 11:37 AM
Last Post: Mark
  How to backup and move a MyBB forum Mark 0 31,832 24-10-2010, 04:04 AM
Last Post: Mark

Forum Jump: