Subject: New tag - spoiler
I tried to create new tag called 'spoiler' because on my forum, we often wrote about films and games and their plots. But it's not the best idea to show something that someone shouldn't see before see it himself. I know that we can use something like this:
SPOILER - lookout!
This is text that you should not read.
The end of SPOILER
But this is not the best solution as you can read it involuntary...So I'd like to have this tag, that should look like this:
[spoiler]This is text that you should not read.[/spoiler]
And it should be converted to div with display: none and instead of it user should see link with some text like Click here to reveal great mysteries. Clicking it should change display: none to display: block with JS.
So where's the problem?
I have no idea how to add some variable to this tag to make it independent from others on page and in same post (id). It's needed for identification different divs so JS could be used. First I thought that I could use $postid or something but if someone will use more then one spoiler in post it will generate errors.
Could someone help me with this? If there is some better way to deal with this problem then I don't mind to use it.
SPOILER - lookout!
This is text that you should not read.
The end of SPOILER
But this is not the best solution as you can read it involuntary...So I'd like to have this tag, that should look like this:
[spoiler]This is text that you should not read.[/spoiler]
And it should be converted to div with display: none and instead of it user should see link with some text like Click here to reveal great mysteries. Clicking it should change display: none to display: block with JS.
So where's the problem?
I have no idea how to add some variable to this tag to make it independent from others on page and in same post (id). It's needed for identification different divs so JS could be used. First I thought that I could use $postid or something but if someone will use more then one spoiler in post it will generate errors.
Could someone help me with this? If there is some better way to deal with this problem then I don't mind to use it.

Off Topic:
Oh and Yves...Happy Birthday!
Oh and Yves...Happy Birthday!

"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."

Draghmar
Show profile
Link to this post
