==README for Spoiler BB code add-on for miniBB==
Release date: April 12, 2012.
Latest update: November 25, 2025.
miniBB version: 3.3+
Author: Paul Puzyrev (minibb.com)

This plug-in adds the possibility to post a "hidden" text, so called "Spoiler". For example, it may be often used for hiding the fable of movies. It provides the "Spoiler" button in the posting message area, and after you selected a portion of the text, click this button to surround your message witg the [spoiler]...[/spoiler] tags. The message should contain the similar colors of background and text font; if you click on the hidden part, it it made visible with a recognizable font.


==INSTALLATION==

* Copy the button image img/button_spoiler.svg under /img/ folder of your forum

* Modify the file bb_codes.php file adding the codes provided under bb_codes.encode.txt and bb_codes.decode.txt. The code under bb_codes.encode.txt should be pasted in the function enCodeBB before the line which says

$msg=preg_replace($pattern, $replacement, $msg);

The code under bb_codes.decode.txt should be pasted in the function deCodeBB before the aforementioned line.

* Modify bb_plugins.php and paste the code located under bb_plugins.code.txt - at your convenience, you could edit basic CSS styles which are applied to the Spoiler blocks in this code, such as fonts colors and background. Preferrably you may leave the widths, as they are already adjusted both for the Desktop and Responsive/Mobile mode. If you have Preview add-on installed, paste this code BEFORE the Preview add-on's code.

* Modify the templates/main_post_form.html template and in the section where all BB-code buttons reside, paste the following:

{$button_spoiler}

* Modify templates/form.js and at the end of this file, paste the code located under templates/form_js.code.txt of this package.

* Modify css/default.css, and at very top part where font families are defined, right after .headingTitle paste: ", .spoiler" (so it looks like "[...] headingTitle, .spoiler {". That way you assign the same font to the spoiler block.

* Modify templates/main_header.html (or whatever forum header file you could have), and before the closing </head> paste the following:

{$spoilerBlock}

* If you have Preview add-on installed, modify templates/addon_preview.html, and before the closing </head> paste the following:

{$spoilerBlock}

* Your language pack (lang/eng.php or any other) needs to contain the code from lang/eng.code.txt (or related language snippet) - defining what a spoiler message will have on top of it.


==USAGE==

The text will be posted inside of the block area of the same background color as the text color is. You won't see what's posted until you highlight the text with a mouse, clicking this part of the block. 


==NOTES==

This add-on was developed and released by Paul Puzyrev specially for miniBB community on the Cosmonautics Day. 
In 2016, additionally sponsored by tgcomics.com.

==FINALLY==
Questions? Suggestions? Improvements? Post them quickly on our support forums:
http://www.minibb.com/forums/plugins-11/
