Spoiler tags? (30)

1 Name: Anonymous : 2006-06-27 09:42 ID:xRn5jAXO [Del]

This may sound stupid, but Id like to use spoiler tags like the ones in 4chan's /a/. How can I do it? Thx!

2 Name: EleoChan!EhVtXXdTd6 : 2006-06-27 09:50 ID:9V4EfeIN [Del]

You'd probably have to add in your own markup so that something like ~~SpoilerTextHere~~ would get turned into something like <span class="spoiler">SpoilerTextHere</span>, then add .spoiler class to your stylesheet (or probably better in futaba_style.pl since you probably want it to apply to multiple stylesheets), in which the text is black against a black background and the text is white on mouseover.

My guess is that you won't have an easy time doing it. I wouldn't.

3 Name: Anonymous : 2006-06-27 10:06 ID:xRn5jAXO [Del]

Thanks!!, I guessed it was not that easy to do, but I appreciate your help, now I know where to start

4 Name: Anonymous : 2006-06-27 11:06 ID:xRn5jAXO [Del]

I dont get this or how to do it:

"You'd probably have to add in your own markup so that something like ~~SpoilerTextHere~~ would get turned into something like <span class="spoiler">SpoilerTextHere</span>"

Ive already created a spoiler class in futaba.pl so thats the last thing I need. Thanks again

5 Name: Mr VacBob!JqK7T7zan. : 2006-06-27 19:11 ID:VHCLAHsb [Del]

IE doesn't support pseudo-class hover, so you can't implement spoilers purely as CSS.

6 Name: EleoChan!EhVtXXdTd6 : 2006-06-27 23:50 ID:9V4EfeIN [Del]

At the very least he could just have it be black text against black text and force users to highlight...

I actually didn't know IE didn't support pseudo-classes. I wonder if IE7 does.

You have to modify wakaba.pl or wakautils.pl (I don't know which one), which means you have to know Perl or know someone who does who will help you. I'm sure regular expressions will be involved :( I don't know either Perl or RegEx so I can't really give you anything but theory.

WAHa may or may not be willing to help you.

7 Name: Anonymous : 2006-06-28 08:46 ID:xRn5jAXO [Del]

Thanks again, Ive been working on it and realized that so I started learning Perl.

8 Name: Anonymous : 2006-06-28 09:56 ID:xRn5jAXO [Del]

Me again...
Ive replaced [spoiler][/spoiler] with <span class="spoiler"> </span> but when I post in my board I see <span class="spoiler"> and </span>, I mean, it doesnt format it with spoiler class, it shows it like a simple txt. Any ideas? Thanks in advance

9 Name: Anonymous : 2006-06-28 10:06 ID:xRn5jAXO [Del]

Here I give you a link to my board so you can see what I meant:


post something between [spoiler]text here[/spoiler] to see it

10 Name: !WAHa.06x36 : 2006-06-28 10:48 ID:1BnUH95x [Del]


That happens if you do your replacement before Wakaba does its own formatting, because it will think the user typed in "<span class="spoiler">". You need to do it only after Wakaba has processed the comment (or possibly at the same time, if you're being clever).

11 Name: Anonymous : 2006-06-28 12:52 ID:xRn5jAXO [Del]

Thanks a lot WAHa!!, I processed it at the comment formatting and now its finally working.

12 Name: EleoChan!EhVtXXdTd6 : 2006-06-28 19:43 ID:Heaven [Del]

Well it works. I am pleased that I was at least a bit helpful.

13 Name: Anonymous : 2006-06-29 08:10 ID:Heaven [Del]

of course you were helpful. Thanks a lot!!

14 Name: tripfaq!ORIhb1kwYg : 2006-08-01 11:14 ID:LyaMEsN3 [Del]

For those who doesn't know much about perl. Go to wakautils.pl looks for "# do <em>" without the "". Add this below:

# do <span class="spoiler">
$line=~s{ (?<![0-9a-zA-Z\*_\x80-\x9f\xe0-\xfc]) (~~) (?![<>\s\*_]) ([^<>]+?) (?<![<>\s\*_\x80-\x9f\xe0-\xfc]) \1 (?![0-9a-zA-Z\*_]) }{<span class="spoiler">$2</span>}gx;

replace the ~~ with what kind of trigger you want, and <span class="spoiler"></span> (note $2 must be there)

I personally doesn't know any perl and have just edited the line above it. From what it looks it works. As long as you don't do
~~something~~ and only ~~something~~.

Someone in here should know perl though and could make it work.

15 Name: tripfaq!ORIhb1kwYg : 2006-08-01 11:15 ID:LyaMEsN3 [Del]

Oops meant to say: As long as you don't do
__~~something~~__ and only ~~__something__~~.

16 Name: tripfaq!ORIhb1kwYg : 2006-08-01 11:20 ID:LyaMEsN3 [Del]

Also where can i find where the script checks for checkboxes so i can add like <if $spoiler></if> into the script if a checkbox with the name "spoiler" or something excists.

17 Name: !WAHa.06x36 : 2006-08-01 11:58 ID:1BnUH95x [Del]


All the POST variables are read right near the start of the script. post_stuff() is then called with the big list of variables. You can either change this to include new ones all the way through, or as it happens, $query is a global variable so $query->param("whatever") works everywhere (this is easier to do, but less neat).

18 Name: tripfaq!ORIhb1kwYg : 2006-08-01 15:03 ID:LyaMEsN3 [Del]

I'm really bad with perl but $query "wouldn't" seem like a "global variable" it probably is but i'm probably doing it wrong.

From what you wrote i would guess it would be possible to do:

<if $query->param("something")></if>

I get a "Template format error". What am i doing wrong?

19 Name: !WAHa.06x36 : 2006-08-01 15:08 ID:1BnUH95x [Del]

Oh, that's right, it's probably declared with "my", so it's only available in wakaba.pl. If you change the declaration at the top of wakaba.pl to use "our" instead of "my" it should work.

20 Name: tripfaq!ORIhb1kwYg : 2006-08-01 15:25 ID:LyaMEsN3 [Del]

Sorry i didn't really catch where i should change to "our" i tried all the my's to the $nofile one. I don't know if its anything significant but my style.pl only require wakautils.pl.

21 Name: !WAHa.06x36 : 2006-08-01 15:53 ID:1BnUH95x [Del]

The declaration for "$query".

No, no, wait. Your real problem is that you have "<if $query->". You need to use "<if $query -\>param" (I think).

22 Post deleted by user.

23 Post deleted by user.

24 Post deleted by user.

25 Name: Anonymous : 2006-10-22 11:58 ID:aPg23Ld6 [Del]

Could someone provide the .spoiler class in CSS? I can't think of any other solutions besides the mouseover that >>2 suggested and I my brain is starting to break.

26 Name: Anonymous : 2006-10-22 14:46 ID:Y3EQrXfo [Del]

with help of IE7-hack (set of javascripts, that make IE more standards-friendly) and :hover pseudo-class it's trivial. You can sneak peek at 2ch.ru/a, they have it.

27 Post deleted by user.

28 Name: Anonymous : 2011-03-12 18:43 ID:MCJ3YgHg [Del]

Hi, I'm using Kareha and added >>14 to wakautils.pl. Instead of futaba.pl (or futaba_style.pl?), where should I create the .spoiler class? I'm assuming that is a Wakaba-only file. I also tried adding

.spoiler span {
visibility: hidden;
.spoiler:hover span {
visibility: visible;

to nigrachan.css but the ~~'d text still showed up as normal.

29 Name: Anonymous : 2011-03-20 00:19 ID:sX9vCcQi [Del]

Thanks for the help, got spoilers working awesomely now!

30 Name: Anonymous : 2011-04-02 07:07 ID:Ddsd3RMw [Del]

"<span class="lijlkjlkjl">

Name: Link:
Leave these fields empty (spam trap):
More options...