News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Spoiler-Tag?

Started by Skoen, June 01, 2004, 08:51:47 PM

Previous topic - Next topic

Skoen

This might just be a mod or a code snippet or whatever, but how about adding a spoiler-tag feature?
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Oldiesmann

#1
Aquilo, can you port your LSP mod to SMF?
Michael Eshom
Christian Metal Fans

Aquilo

#2
as I said in my pm it's bulky, I had to just make another function for it to run through since I haven't figured out the new doUBBC() function yet, since it has a heap more code and I just cant see where it's parsing [ code ] tags except one place where it splits them but all I see it doing after that is parsing [ php ] tags I'll look at it more when I get the time!

but it's converted (somewhat!).
http://www.xtram.net/smf/index.php?topic=19.0

what I'd like to see is SMF auto close [ code ] tags only if told to like xhtml [ code /] so you don't get this ! :P

Skoen

You have the code or something for the spoiler tag, cause it's a good, but unnecessary feature, like the Karma. :P
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Daniel Hofverberg

I would also really like support for spoiler tags. It's actually quite useful for many forums.

Oldiesmann

Everything you're looking for should be in Subs.php... The main difference is that all the bbcode tags are in one spot and the HTML equivalents are in a different spot (unlike YaBB SE, where the HTML equivalent was always right below the bbcode tag).
Michael Eshom
Christian Metal Fans

David

Are you doing spoiler in that the text blends with the background of the post so you need to highlight it or the type where you have to reply to the thread to see it?
This space for rent.

Oldiesmann

The way he did it, you see Spoiler and when you click on that, the text "magically" appears (thanks to Javascript).
Michael Eshom
Christian Metal Fans

Skoen

A spoiler tag is a BBC-tag that puts [spoiler] and [/spoiler] around a text. Then if the user clicks on where it says "Click for spoiler", the text will appear.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


mironicus

I'd like to see this spoiler-tag in a next version of SMF. Very useful!

Dietrich

Quote from: mironicus on June 14, 2004, 07:43:50 AM
I'd like to see this spoiler-tag in a next version of SMF. Very useful!
I won't count on that. It's a relative useless feature for most forums.

Skoen

Look at the first post of this topic. I would not want this as a built-in feature by default, just a code snippet or a mod.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Anguz

Aquilo

the way the code tag is handled in doUBBC() is it's either code or it isn't, the whole message is separated in parts with this and then what isn't gets the other tags parsed, what is is just shown inside a code box... I got familiar with this working on an improved code tag mod

the new way the bbc tags are done with associative arrays is way nicer, imho, and it shouldn't be really hard to do this new tag... it's actually quite similar to the quote tag with the added JS effect, right?

message me if you want help with that
Cristián Lávaque http://cristianlavaque.com

orange

I would also like to see this as a built-in feature.

I've added it myself but it's annoying to have to keep re-hacking it in after upgrading, and it would only add 2 lines to the SMF source code.

In the meantime, in case anyone wants a code snippet:

This is for RC1 only!

Subs.php, around line 810.

Search for:
'~\[/quote\](?:<br />)?~i' => '</div>',


Add After:
// spoiler tags
'~\[spoiler\](?:<br \/>)?~i' => '<b>Spoiler below, select the area to read the text</b><div class="spoiler">',
'~\[/spoiler\](?:<br \/>)?~i' => '</div>',


You then just need to add a spolier section to the stylesheet, something like this:

.spoiler {
   FONT-SIZE: 10px; COLOR: #C8DAED; FONT-FAMILY: Arial, verdana, helvetica, serif;
   BACKGROUND-COLOR: #C8DAED; border: solid #000000 1px;
}

† ÐëepÇuT¹ †

Quote from: orange on August 10, 2004, 04:31:05 PM
I would also like to see this as a built-in feature.

I've added it myself but it's annoying to have to keep re-hacking it in after upgrading, and it would only add 2 lines to the SMF source code.

In the meantime, in case anyone wants a code snippet:

This is for RC1 only!

Subs.php, around line 810.

Search for:
'~[/quote](?:<br />)?~i' => '</div>',


Add After:
// spoiler tags
'~[spoiler](?:<br />)?~i' => '<b>Spoiler below, select the area to read the text</b><div class="spoiler">',
'~[/spoiler](?:<br />)?~i' => '</div>',


You then just need to add a spolier section to the stylesheet, something like this:

.spoiler {
   FONT-SIZE: 10px; COLOR: #C8DAED; FONT-FAMILY: Arial, verdana, helvetica, serif;
   BACKGROUND-COLOR: #C8DAED; border: solid #000000 1px;
}

Quote

Nice.. can you tell us how to link a image box like this one
so when they click on a box representing "Spoiler Tag" it would create a spoiler tag you know what I'm saying..



Personal Website
x3Generation - gaming
graphics and anime.
 

Favorite Forums
> SimpleMachines Forum
> GamerzPlanet Forums


Anguz

Well, I had totally forgotten about this topic and now that I learned a little bit of JS, I wrote a mod. Looking for topics where this was requested to point them to the mod, I found this one again and turns up the way Aquilo and I did it, is practically the same. :P

Anyway, in case someone wants it packaged for RC2, here it is.
http://mods.simplemachines.org/index.php?mod=50
Cristián Lávaque http://cristianlavaque.com

klumy

I really like the idea for spoiler tags.

they could be very useful especially on movie forums, where people talk about films

Zencefil

 
It's very useful (almost vital) in gaming forums as well.





Pentium III 550/100 MHz,
384 MB RAM, XP Pro SP 2


OvermindDL1

#18
I made a secret tag, which I could oh so easily change to read spoiler instead, using the package system, it fully installs and uninstalls in RC2 only at moment, it is on my package server at the moment, although downloading it from the server is odd, so use the direct link to the tar.gz on the package server instead and upload it (if downloading directly works, good, if not, and you know why, please tell).  To see how it works, goto my profile on my forums and look at my signiture, move your curser over it.  It is two lines added in the mod, completely css based and passes the verifier, no JS used.  If you want me to make the same thing to read spoiler instead, say so, it'd take me all of two minutes to change and upload as another package on my server.

EDIT:  If people are really interested, I could add options in the adminCP to allow you to change the forground and background colors of it as well (you'll see what I mean by colors when you see it).  If people are really interested, I'll do that, only take about 10 minutes for that, that is time I do have...

Anguz

I downloaded your file and my antivirus inmediatly moved it to quarantine. It found Trojan.Rbot.Gen.97898.MX>:(
Cristián Lávaque http://cristianlavaque.com

OvermindDL1

How could it have that, it is a compressed tar.gz file containing the required mod file, nothing else...
Dealing with your warning, I just scanned it with a fully updated virus scanner, found nothing.  Re-extracted it, examined the contents, they are unchanged from the orginal source.  And could you please explain how it would be possible for an SMF specific mod file to have a virus?

Anguz

I'm not saying you did it on purpose, I'm just saying what happened.

It could've been a hell of a coincidence that right that second my antivirus monitor found the trojan from somewhere else and I blamed it on the file I downloaded. Maybe your antivirus doesn't detect it. Maybe the heuristics in mine made a mistake. I don't know.

I told you so you could fix it if needed.
Cristián Lávaque http://cristianlavaque.com

OvermindDL1

I do thank you for alerting me, if it did have something it would need to be fixed quickly.  I have since downloaded it three more times from my server onto two seperate computers and one virtual computer, they all extract to a simple .tar, then that extracts to the two files, package.xml, and the corresponding .mod file, and they are identical to the originals, and when recompressed they are the same size as the downloaded version.  Would you do me a favor and test again?

Anguz

I downloaded it once more and scanned it and it was clean. :)

In your mod's description you wrote
Quote
Note: Please remember that the more bbCodes you have installed, the slower the forum will parse.

I invite you to check out my Faster Parsecode mod.
http://mods.simplemachines.org/index.php?mod=39
Cristián Lávaque http://cristianlavaque.com

OvermindDL1

Yep, I've read about it, haven't installed it, before I install anything I like to go through the code with a fine tooth comb, as I did with SMF, do not really have time to right now, but rest assured, I will soon. :)

ANARCH¥

something i need to understand: i placed the spoiler mod for test, and its not really util for me, but in fact, i want to let him installed. so, how i can place a button on the editor message windows for the people ? i want to create my own tag button and insert with the other, like this the spoiler tag can be applied with 1 click.

OvermindDL1

You can either add a button for it in the skin template itself (I think), or if there is enough demand for it, I can make another version that will include a button in the main code...  I am not sure where the button data is stored, but I could find it easily enough should I look.  Or where you even talking about mine?

Raecoco

Quote from: orange on August 10, 2004, 04:31:05 PM
I would also like to see this as a built-in feature.

I've added it myself but it's annoying to have to keep re-hacking it in after upgrading, and it would only add 2 lines to the SMF source code.

In the meantime, in case anyone wants a code snippet:

This is for RC1 only!

Subs.php, around line 810.

Search for:
'~\[/quote\](?:<br />)?~i' => '</div>',


Add After:
// spoiler tags
'~\[spoiler\](?:<br \/>)?~i' => '<b>Spoiler below, select the area to read the text</b><div class="spoiler">',
'~\[/spoiler\](?:<br \/>)?~i' => '</div>',


You then just need to add a spolier section to the stylesheet, something like this:

.spoiler {
   FONT-SIZE: 10px; COLOR: #C8DAED; FONT-FAMILY: Arial, verdana, helvetica, serif;
   BACKGROUND-COLOR: #C8DAED; border: solid #000000 1px;
}


i couldn't make it.there comes error double arrows bla bla.
can someone write this openly ?

Advertisement: