Dolphin, the GameCube and Wii emulator - Forums
Spoiler ? Blank Space ? - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Support (https://forums.dolphin-emu.org/Forum-support)
+--- Thread: Spoiler ? Blank Space ? (/Thread-spoiler-blank-space)



Spoiler ? Blank Space ? - Chacker - 03-16-2010

Does someone know how to make a spoiler ?
Does someone know how to make blank space that doesn't get compressed ?
I tried so much codes, are some codes disabled on this forum Huh


RE: Spoiler ? Blank Space ? - Ocean - 03-16-2010

Hide tags aren't a default function in MyBB boards. The forum admin would have to mod it with a filter which are commonly found under GNU license. One such is below.

PHP Code:
<?php
$plugins
->add_hook("parse_message""spoiler_run");
}
function 
spoiler_activate()
{
}
function 
spoiler_deactivate()
{
}
function 
spoiler_run($message)
{
    
$pattern = array("#\[spoiler=(?:&quot;|\"|')?(.*?)[\"']?(?:&quot;|\"|')?\](.*?)\[\/spoiler\](\r\n?|\n?)#si""#\[spoiler\](.*?)\[\/spoiler\](\r\n?|\n?)#si");

    
$replace = array("<div><div class=\"quote_header\">$1 <a href=\"javascript:void(0);\" onclick=\"javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';}\">(Click to View)</a></div><div class=\"quote_body\" style=\"display: none;\">$2</div></div>""<div><div class=\"quote_header\">Spoiler <a href=\"javascript:void(0);\" onclick=\"javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';}\">(Click to View)</a></div><div class=\"quote_body\" style=\"display: none;\">$1</div></div>");

    while(
preg_match($pattern[0], $message) or preg_match($pattern[1], $message))
    {
        
$message preg_replace($pattern$replace$message);
    }
    
$find = array(
        
"#<div class=\"quote_body\">(\r\n?|\n?)#",
        
"#(\r\n?|\n?)</div>#"
    
);

    
$replace = array(
        
"<div class=\"quote_body\">",
        
"</div>"
    
);
    
$message preg_replace($find$replace$message);
    return 
$message;
}
?>