There was many requests for a [spoiler] tag on my site, and after searching the internet fruitlessly for a hack that would allow me to add a spoiler tag, I decided to do it myself. I would like to post my results for everyone to use if you would like.
Go here for a demoFirst, open (xoopsroot)/class/module.textsanitizer.php and find this:
// [/rhl]
$patterns[] = "/[q[color=000000]u[/color]ote]/sU";
$replacements[] = _QUOTEC.'<div class="xoopsQuote"><blockquote>';
//$replacements[] = 'Quote: <div class="xoopsQuote"><blockquote>';
$patterns[] = "/[/quote]/sU";
$replacements[] = '</blockquote></div>';
In my XOOPS 2.2.3a Final version of this file, it was lines 223 through 227 (Editing with Dreamweaver)
After that, add this:
//Start Spoilers Hack - By Don Bauer
$patterns[] = "/[spoiler]/sU";
$replacements[] = 'Spoiler: <div class="xoopsSpoiler"><blockquote>';
$patterns[] = "/[/spoiler]/sU";
$replacements[] = '</blockquote></div>';
//End Spoilers Hack - By Don Bauer
But you aren't done!!! You need to add the new CSS code to your theme's style.css theme! So next, open (xoopsroot)/themes/(yourtheme)/style.css and find the div.xoopsQuote block (this is mine, yours can, and probably will look different):
div.xoopsQuote { background: #FFFFFF; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
After that, add your new div.xoopsSpoiler block (this is mine):
div.xoopsSpoiler { background: #000000; color:#000000; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
Ass you can see, all I did to this CSS block for div.xoopsSpoiler was change
background: #FFFFFF; to
background: #000000; and I added in
color: #000000; after that.
This will make a black block with black text, but you can change that to whatever you want, just make sure that the
background and the
color values are
exactly the same!
I would recommend copying and pasting your div.xoopsQuote block and just adding in the 'color: #000000'; and changing the color after 'background:' to '#000000'.
That's it!
Please use at your own risk as I hold no responsibility for damages done because of your use of this hack. I have tested with XOOPS 2.2.3a Final.
Enjoy!