2015-01-22, 11:00 AM
This is pretty simple to do and I highly apologize if a thread like this already exists.
Anyway, let's get to it:
Step 1: Go to Admin CP ---> Configuration ---> MyCode (You'll find it to the left in the sidebar) ---> Add New Mycode
Step 2, configure your MyCode:
Title: It doesn't matter, write whatever you want.
Short Description: Again, it doesn't matter, write whatever you want
Regular Expression: Type this: \[spoiler\](.*?)\[/spoiler\]
Replacement: Type this: <div id="spoiler">$1</div>
Enabled?: Yes. (Obviously)
So now you're done with the configuration. Time for some css.
Step 3, writing some very simple css:
Now go to: Admin CP ---> Templates & Style ---> Click on your theme: By default it should be Default or MyBB 1.8. ---> Add Stylesheet
File name: The name doesn't really matter but makes sure you end the name with .css
Attached to: Globally
And then choose: Write my own content.
Now write this code:
Press Save stylesheet.
And now you are done! Please note that in the text editor when you make posts/topics you will only see the spoiler text as code but once you post your thread/post the text should be a black box that shows the text when you hover over it.
Edit: Just in case anyone was confused, to use this code you write: [spoiler]*Your text here*[/spoiler].
Anyway, let's get to it:
Step 1: Go to Admin CP ---> Configuration ---> MyCode (You'll find it to the left in the sidebar) ---> Add New Mycode
Step 2, configure your MyCode:
Title: It doesn't matter, write whatever you want.
Short Description: Again, it doesn't matter, write whatever you want
Regular Expression: Type this: \[spoiler\](.*?)\[/spoiler\]
Replacement: Type this: <div id="spoiler">$1</div>
Enabled?: Yes. (Obviously)
So now you're done with the configuration. Time for some css.
Step 3, writing some very simple css:
Now go to: Admin CP ---> Templates & Style ---> Click on your theme: By default it should be Default or MyBB 1.8. ---> Add Stylesheet
File name: The name doesn't really matter but makes sure you end the name with .css
Attached to: Globally
And then choose: Write my own content.
Now write this code:
#spoiler {
display:inline-block;
color: black;
background-color: black;
}
#spoiler:hover {
display:inline-block;
color: white;
background-color: black;
}
Press Save stylesheet.
And now you are done! Please note that in the text editor when you make posts/topics you will only see the spoiler text as code but once you post your thread/post the text should be a black box that shows the text when you hover over it.
Edit: Just in case anyone was confused, to use this code you write: [spoiler]*Your text here*[/spoiler].