MyBB Community Forums

Full Version: Using a spoiler directly on portal page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically what i was trying to do is be able to put a spoiler directly on my portal page and not in a thread. The purpose of this is to be able to show a livestream on the portal page but have it hidden until a user wants to see it so it doesn't take up the whole page. I have the basic spoiler plugin allowing me to use a spoiler with
[spoiler][/spoiler]
in a post but this will not work directly in the theme

'#\[spoiler\](.*?)\[\/spoiler\]#si','<div><div class="shead">Spoiler: <input type="button" value="Show" onclick="if(this.value == \'Show\'){if(this.parentNode.parentNode.getElementsByTagName(\'div\')[1].innerHTML == \'\'){this.parentNode.parentNode.getElementsByTagName(\'div\')[1].innerHTML = \''.str_replace(chr(10),'\\n',str_replace(chr(13),'\\r',str_replace('\\','\\\\',htmlspecialchars(preg_replace('#(.*?)\[spoiler\](.*?)\[\/spoiler\](.*?)#si','$2',$m))))).'\';this.parentNode.parentNode.getElementsByTagName(\'div\')[1].style.display = \'block\';this.value = \'Hide\';}else{this.parentNode.parentNode.getElementsByTagName(\'div\')[1].style.display = \'block\';this.value = \'Hide\';}}else{this.parentNode.parentNode.getElementsByTagName(\'div\')[1].style.display = \'none\';this.value = \'Show\';}" /></div><div class="sbody" style="display: none;"></div></div>',$m);

When i add this code to the template it produces a spoiler on the portal but there is no way to put the content i want to put inside the spoiler into this code

I am looking to hide the following code in the spoiler
https://download-ssl.xbox.com/content/mgs/liveplayer/production/xblflow/amp-ch1/xblplayer/player.html?content=live1&amp;playerId=XBLMedia

Any help would be greatly appreciated