News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Simple Spoiler Tag

Started by Gary, February 24, 2007, 10:23:04 PM

Previous topic - Next topic

Gary

Link to Mod

This mod will add a simpler version of a spoiler tag, it'd simply create a box where the text is the same colour as the background.

VERSION 1.5 RELEASED!

With version 1.5 a button to Post.template.php has been added so be sure to upload spoiler.gif into your BBC images folder for your theme (a classic variation is provided)

There are two different methods of displaying this.

1.5a is a block level box just like the quote and code tags.
1.5b is an inline black box with the rest of your text.

Languages Supported:
English American
English British
Swedish (Thanks to Veidit for the translation)

Attached to this post is the Classic Theme's BBC button.

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Emperium

I've tested it out and it applies correctly, however it doesn't create the box to match with the text.

Basically it all looks like pretty normal text to me, example:

Spoiler (Highlight to read)
wow this is awesome

That's pretty much what happens, the [spoiler] tags made that nice heads up about spoiler, but the spoiler within is as if it were typed normally. No matching colour box at all. I am not using the default theme. Also is there a way to add a BBC button for this [spoiler][/spoiler] tag?

Gary

#2
You'll need to edit style.css by adding:


/* Simpson I order you to buy those shoes*/
.spoiler
{
color: #CCCCFF;
background-color: #CCCCFF;
border: 1px solid #000000;
margin: 1px;
padding: 1px;
font-size: x-small;
line-height: 1.4em;
}


to the end.

To add a button create an image for it in a graphics program, then add it to the other buttons in Post.template.php

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Emperium

#3
I added it to the end of style.css nothing happened.

There are a bunch of different colour options for my theme, so I've been adding the code to the end of the style_thecolour.css that I'm using, still no good though.

karlbenson

try ctrl f5 (make sure the css file is being updated and not stuck in the cache)

Emperium

I think that did the trick, thank you!

Faustus

I installed teh mod but all I get is

//Spoiler Tag $txt['spoiler'] = 'Spoiler (Highlight to read)'; along the top of my forum.

Gary

It's probably after the closing ?> in Modifications.english.php, open that file up and move it to before the closing ?>

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Kettu

Thank you for that simple but great mod  :D
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

Veidit

Hmm
I only get:
Spoiler (Highlight to read)
test

but would it be possible for an option of the mod to only black out the text and not add Spoiler (Hilight to read) and not add any form of linebreaks?

Gary

You could code it that way yes. The style is set in style.css and the actual layout is in Subs.php on how its displayed.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Gary

#11
Version 1.5 released. This includes English British and Swedish translations (thanks to Veidit for the Swedish) it also includes a button for your users to click on.

If you want a block level box for spoilers use 1.5a, if you want it inline, use 1.5b

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

KerriM

Quote from: Emperium on February 25, 2007, 01:14:28 AM
I've tested it out and it applies correctly, however it doesn't create the box to match with the text.

Basically it all looks like pretty normal text to me, example:

Spoiler (Highlight to read)
wow this is awesome

That's pretty much what happens, the [spoiler] tags made that nice heads up about spoiler, but the spoiler within is as if it were typed normally. No matching colour box at all. I am not using the default theme.
Also is there a way to add a BBC button for this [spoiler][/spoiler] tag?

same here...it doesn't actually create the spoiler...

Gary

You have to add the CSS to your style.css file. Depending on which one you installed 1.5a or 1.5b. But either way, it'll go on the end. A button has also been added in 1.5.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Kambei_Shimada

I'd been using this mod with no problems until today when I upgraded it. Now it just displays [spoiler] text [/spoiler] around all the posts where it previously worked.

Help?  I'm on SMF 1.1.2 and don't have any other packages installed other than Rename Topic.

Gary

Which version did you upgrade to 1.5a or 1.5b? You should've uninstalled the old one first.

For 1.5a make sure that something like


array(
'tag' => 'spoiler',
'before' => '<div class="spoilerheader">' . $txt['spoiler'] . '</div><div class="spoiler">',
'after' => '</div>',
'block_level' => true,
),


is included in there somewhere.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

fangweile

Error in Package Installation

Execute Modification     ./Sources/Subs.php     Test failed

janitro


martina

#18
This is great and admin can post them but regular members get this message

Sorry - you don't have the proper permissions to post spoilers.

Is there a fix for this as I can't see anything in permissions to change?

Gary

martina: That doesn't have anything to do with this mod. You must've installed one of the other Spoilers.

fangweile, janitro: There must be a conflicting mod somewhere. Take a look at the modification.xml file to see what to do and install manually.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Advertisement: