MyBB Community Forums

Full Version: Spoiler Custom MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you don't like having to select the text just to see what it is when you have a spoiler, then this is the thread for you! I've created a custom MyCode at my forums that allows you to simply see it on mouseover (assuming you have javascript enabled) through some very simple javascript - and I'm willing to share it here. Smile

Instructions
First, you need to go to the Custom MyCode page in your Admin CP and add a new Custom MyCode:

Name: Spoiler

Description: This allows users to add spoilers to their post.

Regular Expression:
Quote:\[spoiler\](.*?)\[/spoiler\]

Replacement:
Quote:<strong>Spoiler:</strong> <span class="spoiler" onmouseover="style.color = '#ffffff'" onmouseout="style.color = '#000000'">$1</span>
If you'd rather have it show when you click on it, INSTEAD put this in the replacement field:
Quote:<strong>Spoiler:</strong> <span class="spoiler" onclick="style.color = '#ffffff'" title="Click to show text">$1</span>

Activate MyCode?
Of course, set this to "Yes."

Add the MyCode.

Next, you need to go to the Modify Themes page in your Admin CP. For each theme that you want the spoiler tag to be supported in, you must edit that theme, and in the Additional CSS add:
Quote:.spoiler {
background: #000000;
color: #000000;
padding: 2px;
}

If you have it set to change when you click on it, to make it look "clickable", you can add this INSTEAD:
Quote:.spoiler {
background: #000000;
color: #000000;
padding: 2px;
cursor: pointer;
cursor: hand;
}

Update the theme.

Example
An example of this can be found at my forums:
http://forums.rctgo.com/showthread.php?t...55#pid3255

Edit:
Apparently there is already a spoiler MyCode out there, but I just thought I might as well share mine... it's a lot simpler. Toungue
rcpalace Wrote:What software do you use to create those types of graphics????
GIMP - however, most of the little icons in the post buttons (PM/website/email/quote/etc.) are from RCT3 itself Smile
WOW I didn't know GIMP was that powerful, I only created my logo in GIMP.
Thanks for the info though.
Awsome
wherte i found addditional css?