View Full Version : Spoiler search fix
El_Muerte
10-05-2005, 10:00 PM
Quite some forums have a [spoiler] tag to remove content until the user requests it. However, when searching the forum the content within the spoiler will be visible (when results are shown as posts).
This plugin will remove the content of the spoiler with the text " [[spoiler removed]]" (you can change the phrase through the phrase manager, id: spoilerfix_replacement)
https://vborg.vbsupport.ru/attachment.php?attachmentid=35361&stc=1
And as extra, this is the replacement HTML I use for the spoiler tag on my forum:
<small><b>Spoiler:</b></small><br />
<div style="border: 1px dashed gray; padding: 1px;"><div><button type="button" class="button" onclick="this.parentNode.parentNode.childNodes[1].style.display = ''; this.parentNode.style.display = 'none';" title="Click to show the spoiler.">show spoiler</button></div><div id="spoiler" style="display: none;">{param}</div></div>
It will look like this:
https://vborg.vbsupport.ru/attachment.php?attachmentid=35362&stc=1
Live demo (http://el-muerte.student.utwente.nl/lba/forum/misc.php?do=bbcode#spoiler) of this spoiler tag
Does this also include the [spoiler] code itself for threads? I need that too...
edit: It doesn't. Can that be added or can you not do replacement stuff in plugins/products?
Blam Forumz
10-07-2005, 05:24 PM
Yes, please include the spoiler tag code
El_Muerte
10-07-2005, 09:29 PM
vbcodes can't be included in products (well, not easily)
all you've got to do is create a new vbcode with the tag name "spoiler" and use the replacement HTML I posted above.
wolfyman
10-08-2005, 03:57 PM
very nice, thanks :)
MetalAges
11-01-2005, 08:58 PM
Just a quick question. Say a guy has a 5meg video clip in his spoiler tag...will it only load if someone clicks to "show" ?
El_Muerte
11-02-2005, 04:26 AM
Just a quick question. Say a guy has a 5meg video clip in his spoiler tag...will it only load if someone clicks to "show" ?
I doubt it. It's up to the plugin and browser settings I guess.
Pvtiste
11-30-2005, 11:35 AM
very nice ! thx
aciurczak
11-30-2005, 05:52 PM
This is nice (and needed), but folks can still see the spoiler contents with the mouseover preview ( tooltips ). I don't want to disable those previews; is there any way to blank the content within the spoiler tag from being shown in those?
El_Muerte
12-01-2005, 06:37 AM
This is nice (and needed), but folks can still see the spoiler contents with the mouseover preview ( tooltips ). I don't want to disable those previews; is there any way to blank the content within the spoiler tag from being shown in those?
I checked it out and there is no way to fix the thread previews :(
There's no way to hook into the processing before the vbtags are removed.
shovel
12-01-2005, 12:26 PM
I personally like the text link instead of the button link. Just do an <a> and use an onClick parameter to send info to the nodes.
Kwikms
12-16-2005, 04:47 PM
Very nice. How about another button? After you clicked "show spoiler" you will see "hide spoiler" and you can hide it again ^^.
Very nice. How about another button? After you clicked "show spoiler" you will see "hide spoiler" and you can hide it again ^^.
This is what I use for that
<div style="margin:5px 20px 20px 20px">
<div class="smallfont" style="margin-bottom:2px"><b>Spoiler:</b>
<input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{param}
</div>
</div>
</div>
Ok,
i used SPOILER in my old forum. But now on 3.5.2 he dosn't want to work ? Any ideea ? I don't really understand what this hack do.
EDIT: Actualy, if I create a new spoiler he works. But old spoilers don't want to work. I just see the button, click it and...nothing.
Fofer
01-09-2006, 03:58 AM
This is what I use for that
<div style="margin:5px 20px 20px 20px">
<div class="smallfont" style="margin-bottom:2px"><b>Spoiler:</b>
<input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{param}
</div>
</div>
</div>
Okay, that is just WAY cool. It's clean and perfect and my users love it! Thanks.
I love how the button says "Show" when the text is hidden ... and "Hide" when the text is showing. However, this doesn't work on Safari (for Mac.) Any workaround?
cclaerhout
01-09-2006, 08:48 AM
Thank you ! Great bbcode.
Nigh7mar3
02-05-2006, 10:44 AM
No one have a cool button to insert spoiler code?
Thanks nice mod
cerebro
02-24-2006, 01:35 PM
Thanks, works fine in explorer and firefox
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.