This may sound stupid, but Id like to use spoiler tags like the ones in 4chan's /a/. How can I do it? Thx!
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.
>>2
Thanks!!, I guessed it was not that easy to do, but I appreciate your help, now I know where to start
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
IE doesn't support pseudo-class hover, so you can't implement spoilers purely as CSS.
>>5
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.
>>4
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.
>>6
Thanks again, Ive been working on it and realized that so I started learning Perl.
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
Here I give you a link to my board so you can see what I meant:
http://www.imeejis.com/vg/wakaba.html
post something between [spoiler]text here[/spoiler] to see it
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).
>>10
Thanks a lot WAHa!!, I processed it at the comment formatting and now its finally working.
Well it works. I am pleased that I was at least a bit helpful.
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.
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.
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).
>>17
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?
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.
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.
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).
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.
>>25
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.
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.
Thanks for the help, got spoilers working awesomely now!
"<span class="lijlkjlkjl">