Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Gary on February 24, 2007, 10:23:04 PM

Title: Simple Spoiler Tag
Post by: Gary on February 24, 2007, 10:23:04 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=573)

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
Title: Re: Simple Spoiler Tag
Post by: 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?
Title: Re: Simple Spoiler Tag
Post by: Gary on February 25, 2007, 09:55:46 AM
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
Title: Re: Simple Spoiler Tag
Post by: Emperium on February 25, 2007, 12:13:32 PM
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.
Title: Re: Simple Spoiler Tag
Post by: karlbenson on February 25, 2007, 02:52:46 PM
try ctrl f5 (make sure the css file is being updated and not stuck in the cache)
Title: Re: Simple Spoiler Tag
Post by: Emperium on February 25, 2007, 03:21:52 PM
I think that did the trick, thank you!
Title: Re: Simple Spoiler Tag
Post by: Faustus on April 03, 2007, 01:56:29 AM
I installed teh mod but all I get is

//Spoiler Tag $txt['spoiler'] = 'Spoiler (Highlight to read)'; along the top of my forum.
Title: Re: Simple Spoiler Tag
Post by: Gary on April 03, 2007, 09:05:33 AM
It's probably after the closing ?> in Modifications.english.php, open that file up and move it to before the closing ?>

-ALM
Title: Re: Simple Spoiler Tag
Post by: Kettu on May 06, 2007, 05:24:30 AM
Thank you for that simple but great mod  :D
Title: Re: Simple Spoiler Tag
Post by: Veidit on May 06, 2007, 09:15:07 AM
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?
Title: Re: Simple Spoiler Tag
Post by: Gary on May 06, 2007, 09:48:34 AM
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
Title: Re: Simple Spoiler Tag
Post by: Gary on May 07, 2007, 10:22:33 PM
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
Title: Re: Simple Spoiler Tag
Post by: KerriM on May 10, 2007, 09:33:55 PM
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...
Title: Re: Simple Spoiler Tag
Post by: Gary on May 10, 2007, 09:39:52 PM
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
Title: Re: Simple Spoiler Tag
Post by: Kambei_Shimada on May 16, 2007, 01:36:01 PM
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.
Title: Re: Simple Spoiler Tag
Post by: Gary on May 16, 2007, 02:05:36 PM
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
Title: Re: Simple Spoiler Tag
Post by: fangweile on June 28, 2007, 01:04:59 AM
Error in Package Installation

Execute Modification     ./Sources/Subs.php     Test failed
Title: Re: Simple Spoiler Tag
Post by: janitro on August 01, 2007, 12:02:09 PM
same here..
Title: Re: Simple Spoiler Tag
Post by: martina on August 02, 2007, 07:41:45 AM
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?
Title: Re: Simple Spoiler Tag
Post by: Gary on August 02, 2007, 10:00:26 AM
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
Title: Re: Simple Spoiler Tag
Post by: martina on August 02, 2007, 10:10:57 AM
Oh right ok thank you x.
Title: Re: Simple Spoiler Tag
Post by: martina on August 02, 2007, 10:13:37 AM
I did have another one in my cpanel but not active on the forum.  I have deleted it now but it is still the same.  Do I need to delete the spoiler and re upload it?
Title: Re: Simple Spoiler Tag
Post by: paulrudz on August 03, 2007, 12:52:44 PM
I have got no idea how to install this (or any mod).  I'm using version 1.1.3.  Could anyone give me some quick instructions?  Thanks.

(I read through the general mod instillation instructions, but am still unsure what to do.  What file do I edit?  Where exactly do I make this edit, etc).
Title: Re: Simple Spoiler Tag
Post by: Gary on August 03, 2007, 02:45:57 PM
To quote myself

Quote from: ALM on May 20, 2007, 07:23:18 PM
Download the mod, then go Admin > Packages > Download Packages > Upload a Package > [Browse] > Upload and follow the intructions.

-ALM

-ALM
Title: Re: Simple Spoiler Tag
Post by: chrishicks on September 03, 2007, 11:40:33 PM
ok, I tried to download 1.5a which shows on the download/zip file but when I upload it, it shows as version 1.5b. any ideas on what to do here? I downloaded both 1.5a and 1.5b and they both show as 1.5b when I upload the file.
Title: Re: Simple Spoiler Tag
Post by: Gary on September 04, 2007, 03:54:31 AM
Ignore it, its an error on my part.

That or use the new 1.5a package.

-ALM
Title: Re: Simple Spoiler Tag
Post by: Algol on September 05, 2007, 01:28:32 AM
Will you please tell me which part of code shoud I change so the spoiler mod works with
[x] and [/x] tags

instead of

[spoiler] and [/spoiler]

I want to do this because all spoilers on my board are tagged with x and /x (in square brackets, ofc.), from some other spoiler mod that I used on the SMF version 1.0.9.

Thank you very much!




Btw, you may also wanna add an extra CSS rule if you want your spoilers to be revealed by hovering your mouse over spoiler div (works fine with Opera 9.22, Firefox 2.0.6 and Netscape 8, but not in IE6).

.spoiler:hover
{
   color: #FFFFFF;
}


Title: Re: Simple Spoiler Tag
Post by: Gary on September 05, 2007, 03:50:08 AM
For either 1.5a or 1.5b change:

array(
'tag' => 'spoiler',


to

array(
'tag' => 'x',


and on Post.template.php change

'spoiler' => array('code' => 'spoiler', 'before' => '[spoiler]', 'after' => '[/spoiler]', 'description' => $txt['spoiler_post']),


'x' => array('code' => 'x', 'before' => '[x]', 'after' => '[/x]', 'description' => $txt['spoiler_post']),

-ALM
Title: Re: Simple Spoiler Tag
Post by: Algol on September 05, 2007, 03:58:41 AM
Thank you very much for the quick answer and, of course, for this very useful mod. :)
Title: Re: Simple Spoiler Tag
Post by: White_Wolf on September 12, 2007, 03:55:45 AM
I'm running SMF 1.1.3 with TinyPortal v0.9.8
When I installed the original simplespoiler I had to eddit the CSS, and then ctrl F5 to refresh my browser, and then it worked.

But the 1.5  A&B version doesn't install. They both say
Quote./Sources/Subs.php    Test failed

I want to use the 1.5 version because it comes with a button (or so I've heard).
Title: Re: Simple Spoiler Tag
Post by: Gary on September 12, 2007, 08:44:26 AM
It does come with a button, which version do you want, 1.5a and 1.5b each have different code to add into Subs.php

-ALM
Title: Re: Simple Spoiler Tag
Post by: White_Wolf on September 12, 2007, 09:46:51 AM
Quote from: ALM on September 12, 2007, 08:44:26 AM
It does come with a button, which version do you want, 1.5a and 1.5b each have different code to add into Subs.php

-ALM
The 1.5a and 1.5b have the bbc button image, but the original one doesn't.
I've uploaded the spoiler.gif from the 1.5 and manually put it in my /images/bbc/ folder. But it seems to be lacking the protocol to pull it up.

as for which one I want 1.5a or 1.5b, I guess the inline one. But I've tried to install both of them and I get an installation error
QuoteInstalling this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
2.    Execute Modification    ./Themes/default/languages/Modifications.english_british.php    Test successful
3.    Execute Modification    ./Themes/default/languages/Modifications.swedish.php    Test successful
4.    Execute Modification    ./Sources/Subs.php    Test failed
5.    Execute Modification    ./Themes/default/Post.template.php    Test successful
6.    Execute Modification    ./Themes/default/style.css    Test failed
7.    Extract File    ./Themes/default/images/bbc/spoiler.gif    

Interesting, now it gives me two errors. The style.css is the new error. I guess maybe because I already entered the block of text in the css file to make it recognize the first one?

Well, the first version works.. I just have to manually type in [spoiler] text [/spoiler]
Sure wish I had a handy dandy button for it though :(
Title: Re: Simple Spoiler Tag
Post by: Gary on September 12, 2007, 10:02:09 AM
If it's already installed, then do you have a custom theme with its own Post.template.php?

-ALM
Title: Re: Simple Spoiler Tag
Post by: White_Wolf on September 12, 2007, 12:18:57 PM
yes
Quote from: ALM on September 12, 2007, 10:02:09 AM
If it's already installed, then do you have a custom theme with its own Post.template.php?

-ALM
Yes. I have SMF Default, Classic, and two skins I am customizing that are copies of SMF Default. Those are the only ones with the post.template.php
Title: Re: Simple Spoiler Tag
Post by: Gary on September 12, 2007, 12:54:49 PM
Then the reason it isnt appearing on your themes (except the default) is because it doesnt modify those themes, you'll need to add the code to those themes manually. (style.css too actually)

This will help out: http://sleepycode.com/PackageParser/index.php

-ALM
Title: Re: Simple Spoiler Tag
Post by: White_Wolf on September 17, 2007, 07:02:51 PM
QuoteThen the reason it isnt appearing on your themes (except the default)
Actually, it's not appearing on the default. It's not appearing on any theme.
Title: Re: Simple Spoiler Tag
Post by: Viporizer on September 19, 2007, 02:05:22 PM
I got the same error as other people.


Installing this package will perform the following actions:
Type Action Description
1. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
2. Execute Modification ./Themes/default/languages/Modifications.english_british.php Test successful
3. Execute Modification ./Themes/default/languages/Modifications.swedish.php Test successful
4. Execute Modification ./Sources/Subs.php Test failed
5. Execute Modification ./Themes/default/Post.template.php Test successful
6. Execute Modification ./Themes/default/style.css Test successful
7. Extract File ./Themes/default/images/bbc/spoiler.gif


Tried to add it manually but it just gives an error on line XXX and my forum wouldn't load.

I looked at it more deeply and found that the search criteria isn't in the Subs.php
But now for the next question. Where to add it manually ^^
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 15, 2007, 08:16:15 PM
i get an error in subs

and i cant manually install as the parsers wont read it and i cant read XML or the like
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 04:57:18 AM
Which one are you trying to install? 1.5a or 1.5b?

-ALM
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 07:18:00 AM
umm
which ever was on the bottom..
it was a lol
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 02:00:32 PM
Find:

                        array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),


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


-ALM
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 05:00:15 PM
were you replying to me?
which file am i looking in?
:|
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 07:15:26 PM
Yes, the file you need to look in is Subs.php as that's what you said the failure was. :P

-ALM
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 07:56:09 PM
it doesnt work now

the post comes up showing what it was supposed to hide :|

and i did check the coding of the post and it still had the spoiler code written in it lol
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 08:05:59 PM
Is the package installed in the package manager? (If not, do so anyway, ignoring any errors on Subs.php)
Are you using a custom theme? (If so, post and I'll give you further instructions)

-ALM
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 08:24:25 PM
lol its showing up

but it doesnt hide the text between the codes :S

http://www.jades-world.com/forums/index.php?topic=231.0
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 08:47:08 PM
oh wait :D

it works on the core theme!!

(i forgot i was using the core theme i modify and play with codes on lol)

how do i fix it to work with my other themes? (theres three, and their all copies of the core theme)

(and thankyou, i know im blonde, but your still here *hands bat* there you go, knock some sense into me ;))
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 09:29:29 PM
All you need to do is now make a change to your theme's style.css file.

Find:

.quoteheader, .codeheader
and add
, .spoilerheader

after it.

and then at the end of the file add:

/* 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;
}


You can also tweak the colours if you wish.

-ALM
Title: Re: Simple Spoiler Tag
Post by: Jade Elizabeth on October 16, 2007, 09:43:47 PM
IT WORKS PERFECTLY!!

THANKYOU SO MUCH!! :D
Title: Re: Simple Spoiler Tag
Post by: Gary on October 16, 2007, 10:03:44 PM
HOMER: And thats the end of that chapter. :P

-ALM
Title: Re: Simple Spoiler Tag
Post by: cru on October 19, 2007, 08:45:05 PM
hi all, can someone explain to me what's the use of this mod? i don't understand the descriptions in the download page.
TIA
Title: Re: Simple Spoiler Tag
Post by: Gary on October 19, 2007, 08:48:47 PM
It will allow people to hide text from view unless another person highlights over the spoiler box/area (depending on 1.5a or 1.5b) with the syntax of [spoiler][/spoiler]

-ALM
Title: Re: Simple Spoiler Tag
Post by: Tripp on November 30, 2007, 05:51:22 PM
Ok, I feel very stupid, I have downloaded the 1.5 version (the a and b version gave me errors on the sub file).  It works on the default theme but when I go to edit the style to ANY of my other themes, the spoiler doesn't change color.

Any ideas?  I'm using version 1.1.4
Title: Re: Simple Spoiler Tag
Post by: kirax2 on January 20, 2008, 06:25:15 PM
Hello there.

I would like to install package 1.5b on my forum; inline spoilers are just what I need.  However, I get the "./Sources/Subs.php Test Failed" error when I attempt to install it.  Could you please tell me how I should edit the Subs.php file in order to install 1.5b?  Also, once I do so, do I still need to edit the css file or any other file?

Thanks very much for your help!

-kirax2
Title: Re: Simple Spoiler Tag
Post by: syzable on February 26, 2008, 06:50:27 AM
Oops........wrong thread......ignore me.  :-[
Title: Re: Simple Spoiler Tag
Post by: Froggy on January 12, 2009, 01:55:08 AM
I just added the spoiler mod and it looks like it loaded   5a   (kinda)  :-[

i copied the .gif file and it appears and clicks to add the spoiler tags

but i just get the  spolier brackets with the actual text showing in the middle of them

what is the manual edit that would fix that problem

thanks

i am using dilbert theme 

is 5a the one where there would be a clickable spoiler button ?

Title: Re: Simple Spoiler Tag
Post by: Froggy on January 12, 2009, 01:59:05 AM
is anybody still looking at this thread ?

:)
Title: Re: Simple Spoiler Tag
Post by: Froggy on January 13, 2009, 12:30:00 PM
help
Title: Re: Simple Spoiler Tag
Post by: Froggy on January 16, 2009, 02:11:39 PM
anybody got any 'spolier' help or advice

it partially loaded ... now what

Title: Re: Simple Spoiler Tag
Post by: Froggy on January 17, 2009, 08:32:40 PM

anybody got any 'spolier' help