PDA

View Full Version : New Posting Features - bbSpoiler


hambil
07 Apr 2006, 09:39
Keywords: bbcode, hidden, spoiler

Description:
A simple but effective [spoiler] bbcode. All the ones I've seen so far fall short for some minor reason or another - so I've created my own :)

Features:

Hides/Unhides with cross browser javascript (tested with latest IE and Firefox)
No template edits or file edits required.
Uses the colors of the current style.
Spoiler text does not show in thread preview.Install
Download the bbSpoiler_1.0.zip file.
Follow instructions in install.txt

Silvio
07 Apr 2006, 10:24
*Installed

ty man! :banana:

*oooppss! 1st post

ciao!

Shack Networks
07 Apr 2006, 10:49
Cheers Hambil, I spent the best part of my life trying to avoid the answer to who shot JR and you go and spoil it in one foul swoop with a screenshot lol.

Nice hack and I will be adding it as soon as I sort my site out, Ive just tested on my dev site and it works fine.

H

hambil
07 Apr 2006, 11:41
Fixed a bug that caused some forum threads to display funcky in forum view. Grab the latest zip. Since there's only one install so far, I only screwed up one person. I'll try harder next time :)

Shack Networks
07 Apr 2006, 11:48
2 Installs now m8

Thanks for the update.

hambil
07 Apr 2006, 11:58
Ah crap, I broke the thread-preview in my last upload. My only excuse is that it's 4am here. All fixed now, but you may need to download again.

Snake
07 Apr 2006, 21:44
Thanks man, works just fine!

VViper
08 Apr 2006, 00:04
Very good, thankyou for sharing,
i noticed in the install.txt

The image path is .images

I put it into forum/images

the path then was just images/spoiler with no full stop

Hope that helps someone else out.
Thanks again for the hack.

Kihon Kata
03 May 2006, 18:33
Hambil,

Awesome hack!!! installed onmy 3.5.4! One problem, it doesn't work LOL Tried Firefox/IE and nothin'

The click to show spoiler table shows up, but it won't click down to show the spoiled text. Any ideas?

hambil
03 May 2006, 18:45
Hambil,

Awesome hack!!! installed onmy 3.5.4! One problem, it doesn't work LOL Tried Firefox/IE and nothin'

The click to show spoiler table shows up, but it won't click down to show the spoiled text. Any ideas?
The only reason I can think of that it wouldn't work is if you don't have "headinclude" in your SHOWTHREAD template - do to another hack, or some custom style.

Kihon Kata
03 May 2006, 19:01
check it out

The only reason I can think of that it wouldn't work is if you don't have "headinclude" in your SHOWTHREAD template - do to another hack, or some custom style.

hambil
03 May 2006, 19:03
Hmmm...

Can you show me your bbcode for the spoiler tag?

Kihon Kata
03 May 2006, 19:05
sure...

<div width="100%" class="alt1" onclick="spoiler(this);" style="border-collapse: collapse; border: solid thin black;"><div id="idTitle" class="alt2" style="border-collapse: collapse; border: solid thin black; width: 100%;">&nbsp;<b>click to show</b></div><div id="idSpoiler" style="display: none;">{param}</div></div>

and

The butler did it!

is that what you mean?



Hmmm...

Can you show me your bbcode for the spoiler tag?

hambil
03 May 2006, 19:23
It looks like the replace isn't working for some reason. Try taking the javascript and editing into the SHOWTHREAD template.

add after "headinclude"

<script language='JavaScript' type='text/javascript'>
<!--
function spoiler(obj)
{
for (var i = 0; i < obj.childNodes.length; i++)
{
if (obj.childNodes[i].id == 'idTitle')
titleRow = obj.childNodes[i];
if (obj.childNodes[i].id == 'idSpoiler')
{
if (obj.childNodes[i].style.display != 'none')
{
obj.childNodes[i].style.display = 'none';
titleRow.innerHTML = '&nbsp;<b>click to show</b>';
}
else
{
obj.childNodes[i].style.display = 'block';
titleRow.innerHTML = '&nbsp;<b>click to hide</b>';
}
}
}
}
//-->
</script>

Kihon Kata
03 May 2006, 19:28
Yep that worked. Does that slow the showthread down? We have many users that will probably NOT use this feature

hambil
03 May 2006, 19:29
No. It's just javascript. It's only called when spoiler 'show/hide' button is clicked.

Kihon Kata
03 May 2006, 19:31
cool! We'll use this for our movie review forum

Kihon Kata
05 May 2006, 04:05
Hambil! Reporting a problem that I found! :) or I mean :(

When you hover over threads' titles in forumdisplay, showthread, today's posts, new posts, the little popup for the thread preview text is now dead and is NOT working. I disable the product and they work. Looks like the spoiler tags are breaking the tooltips.

Remember, I'm the one that had to manually put the javascript into showthread. (I think that is where I had to put it)

Any ideas?

zombie_rem
05 May 2006, 07:01
It looks like the replace isn't working for some reason. Try taking the javascript and editing into the SHOWTHREAD template.

add after "headinclude"

<script language='JavaScript' type='text/javascript'>
<!--
function spoiler(obj)
{
for (var i = 0; i < obj.childNodes.length; i++)
{
if (obj.childNodes[i].id == 'idTitle')
titleRow = obj.childNodes[i];
if (obj.childNodes[i].id == 'idSpoiler')
{
if (obj.childNodes[i].style.display != 'none')
{
obj.childNodes[i].style.display = 'none';
titleRow.innerHTML = '&nbsp;<b>click to show</b>';
}
else
{
obj.childNodes[i].style.display = 'block';
titleRow.innerHTML = '&nbsp;<b>click to hide</b>';
}
}
}
}
//-->
</script>



I was having the same problem with the "Click to Show" not working.... but i cant find where to add the script.. i cant find "headinclude" anywhere..:cry:

hambil
05 May 2006, 08:10
Post your FORUMHOME template.

TTG
05 May 2006, 10:31
Been using this for some time now .. simply add it as a new BB code :-

<div class="spoiler"> <input type="button" class="button" onClick="this.nextSibling.nextSibling.style.display='block';this.parentNode.removeChild(t his);" value="Show spoiler"> <span class="content" style="display:none">Spoilertext</span> </div>

Produces a single click button.

Kihon Kata
05 May 2006, 14:42
Post your FORUMHOME template.
who you talkin' to Hambil? please use the quote option so we know. :)

zombie_rem
06 May 2006, 16:47
Been using this for some time now .. simply add it as a new BB code :-

<div class="spoiler"> <input type="button" class="button" onClick="this.nextSibling.nextSibling.style.display='block';this.parentNode.removeChild(t his);" value="Show spoiler"> <span class="content" style="display:none">Spoilertext</span> </div>

Produces a single click button.


I used that, and the button works, but all it shows is "Spoilertext" and not what i typed.

hambil
06 May 2006, 17:52
I was having the same problem with the "Click to Show" not working.... but i cant find where to add the script.. i cant find "headinclude" anywhere..:cry:
Post your FORUMHOME template.

hambil
06 May 2006, 17:53
Hambil! Reporting a problem that I found! :) or I mean :(

When you hover over threads' titles in forumdisplay, showthread, today's posts, new posts, the little popup for the thread preview text is now dead and is NOT working. I disable the product and they work. Looks like the spoiler tags are breaking the tooltips.

Remember, I'm the one that had to manually put the javascript into showthread. (I think that is where I had to put it)

Any ideas?
I've been sick for a couple days. I'm looking at this now.

Kihon Kata
06 May 2006, 22:18
I've been sick for a couple days. I'm looking at this now.
Great. Thanks. Oh I have been deathly ill also. Fever/throat :(

zombie_rem
07 May 2006, 09:33
Post your FORUMHOME template.


I found it. I clicked the wrong file. :speechless:

But it still doesn't work.

da420
10 May 2006, 08:02
Hambil! Reporting a problem that I found! :) or I mean :(

When you hover over threads' titles in forumdisplay, showthread, today's posts, new posts, the little popup for the thread preview text is now dead and is NOT working. I disable the product and they work. Looks like the spoiler tags are breaking the tooltips.

Remember, I'm the one that had to manually put the javascript into showthread. (I think that is where I had to put it)

Any ideas?


Great hack, but am having this same problem. I have to disable it until a fix was released.

Thanks for the hack, and can't wait to see this fixed.

hambil
10 May 2006, 17:51
Great hack, but am having this same problem. I have to disable it until a fix was released.

Thanks for the hack, and can't wait to see this fixed.
Hmmm. All it does is modify the tooltip. Are you using any other hacks, like improved thread preview?

da420
10 May 2006, 21:15
Hmmm. All it does is modify the tooltip. Are you using any other hacks, like improved thread preview?

Nope not improved thread preview, I disable your hack and it comes back no problems. Love this hack, but can't use it until that is fixed.

hambil
10 May 2006, 21:53
Okay, I made a patch that should get the tooltips to show again. However, the spoilers will show in thread preview. This only effects the few of you who have this problem. Everyone else should notice no difference and doesn't need to update.

I'll need access to one of the boards of the people having this problem to figure it out further.

cavyspirit
10 May 2006, 23:28
This would be good as a warning for graphic content/photos.

da420
11 May 2006, 01:03
Okay, I made a patch that should get the tooltips to show again. However, the spoilers will show in thread preview. This only effects the few of you who have this problem. Everyone else should notice no difference and doesn't need to update.

I'll need access to one of the boards of the people having this problem to figure it out further.

Works flawlessly so far! Thanks for the hack man!! This is super!

Kihon Kata
11 May 2006, 05:08
Okay, I made a patch that should get the tooltips to show again. However, the spoilers will show in thread preview. This only effects the few of you who have this problem. Everyone else should notice no difference and doesn't need to update.

I'll need access to one of the boards of the people having this problem to figure it out further.
Thanks Bill for this patch.

I have a few questions:
I see that it has the same version number, is this right?
How do we install this, import product with overwrite...or uinstall first?
Do we have to delete and re-add the bbcode?

hambil
11 May 2006, 11:43
Thanks Bill for this patch.

I have a few questions:
I see that it has the same version number, is this right?
How do we install this, import product with overwrite...or uinstall first?
Do we have to delete and re-add the bbcode?
Just import product with overwrite. I didn't change the version # because it's a very tiny change. I've got a couple more changes coming up and it will likely get put in with those as version 1.1.

wdlove
11 May 2006, 23:11
Is there anyway to make it looks nice like the other spoiler hacks?

Something like this one? http://www.vbulletin.org/forum/showthread.php?t=113776&highlight=spoiler

I think that one looks great, but doesn't function as good as this one.

hambil
12 May 2006, 01:05
Is there anyway to make it looks nice like the other spoiler hacks?

Something like this one? http://www.vbulletin.org/forum/showthread.php?t=113776&highlight=spoiler

I think that one looks great, but doesn't function as good as this one.
It's all exposed in the spoiler bbcode. I'm not a designer, but if someone wants to make it look better I'm all for it.

Olli460
16 May 2006, 03:11
Great job man. This spoiler is really simple and a good one to use too.

obmob
19 Jun 2006, 19:04
Oh, seems to be the most simple spoiler tag out there... i'll test it, thanks.

Zelos
10 Aug 2006, 01:31
Any chance this works for 3.6?

hambil
28 Aug 2006, 03:17
Any chance this works for 3.6?
I don't know. I'll test it this week.

ZombieAndy
07 Sep 2006, 18:02
installed and working on 3.6.0 :)

R1lover
18 Sep 2006, 04:28
I used that, and the button works, but all it shows is "Spoilertext" and not what i typed.

I have the same issue....... I like the button better but not if it doesn't work lol

an yes the text still shows up on "mouse over" in forum view.

Renae
03 Jan 2007, 21:35
This install was extremely simple and easy. I encountered NO problems. This was great, thank you.

I was writing something about a book, realized I needed this, searched for it. Saw many, this one looked easy. Downloaded and in about 5 minutes after I decided that I needed this, I was already using it.

Great Job!

Kinneas
17 Jan 2007, 15:31
I have the same issue....... I like the button better but not if it doesn't work lol

an yes the text still shows up on "mouse over" in forum view.
Replace "Spoilertext" with "{param}".

klinsek
01 Feb 2007, 15:56
Ah, nice work. Thanks much. Perfect for my game guild forum.

L-Mane
11 Feb 2007, 18:20
It works, but I got a error.

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT COUNT(*) AS `num` FROM post WHERE `userid` = 1 AND `threadid` =;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Error Number : 1064
Date : Sunday, February 11th 2007 @ 01:19:58 PM
Script : http://www.wordofsouth.com/myblock/admincp/bbcode.php?do=modify
Referrer : http://www.wordofsouth.com/myblock/admincp/index.php?do=nav

odie3
09 Apr 2007, 03:49
hmm, kind of wanted to install this on my 3.6.5 board... guess not. :(

hambil
09 Apr 2007, 04:02
I have it installed on my 3.6.5 with no problems.

Tact7626
17 Apr 2007, 02:45
installed on 3.6.5. works great. just having trouble customizing it's look. like i changed the 100% widths to 80% and it doens't respond correctly. the inside div response correctly but not the outside div. it still takes up 100% of the table width. i could specify exact size but...whatever. it's all aesthetics.

great spoiler. thanks.




edit: ok i figured it out. i noticed you placed the width of the outside div inside quotes OUTSIDE the style thingy. div width="whatever"

while on the inside div it's set properly inside the style (style=width:whatever%; )

so i put it in the right place and now it works perfectly and actually adheres to my sizes. thanks again. ^^

AAN
25 Apr 2007, 19:04
I have this installed.

It works great except it's not exactly what I want.

How do I make it so that what appears on the spoiler tab is the same as the "option" that I type into the box?

Right now the spoiler tab says "Click to show" and is very very long.
What I'm wanting is for it to be shorter and have it be what I type as the "option" when I'm setting up the spoiler.

Does this exist some place else?

Floob
30 Apr 2007, 00:42
installed on 3.6.5. works great. just having trouble customizing it's look. like i changed the 100% widths to 80% and it doens't respond correctly. the inside div response correctly but not the outside div. it still takes up 100% of the table width. i could specify exact size but...whatever. it's all aesthetics.

great spoiler. thanks.




edit: ok i figured it out. i noticed you placed the width of the outside div inside quotes OUTSIDE the style thingy. div width="whatever"

while on the inside div it's set properly inside the style (style=width:whatever%; )

so i put it in the right place and now it works perfectly and actually adheres to my sizes. thanks again. ^^

Can you expand on that - how/where do you change the width of the spoiler info?

hambil
30 Apr 2007, 20:29
Ownership of this hack is being transfered to Dismounted. Thank you for everyone who used, enjoyed, and made suggestions for this hack.

Tact7626
30 Apr 2007, 21:35
Can you expand on that - how/where do you change the width of the spoiler info?



there's a part where the guy put <div width="100%" >

and it doesn't work well. instead, you should use <div style="width:100%;">.

he used the second method on the second div, but the first method on the other div. and that's why i was having trouble setting my own sizes to it. after i realized this, i changed the "incorrect" one and it works. :p

Floob
30 Apr 2007, 21:58
Nice thanks.

I use this now


<div style="width:20%;" class="alt1" onclick="spoiler(this);" style="border-collapse: collapse; border: solid thin black;">

<div id="idTitle" class="alt2" style="border-collapse: collapse; border: solid thin black; width: 100%;">&nbsp;<b>Click to show spoiler</b></div>

<div id="idSpoiler" style="display: none;">The butler did it!</div></div>

Dismounted
01 May 2007, 11:01
Ownership of this hack is being transfered to Dismounted. Thank you for everyone who used, enjoyed, and made suggestions for this hack.
Thanks, I'll be making a new thread soon :).

gutterboy
28 May 2007, 20:34
OK.. I installed this I wanted to change the text "click to show" slightly. My new updated text only shows if I click on it first to show it & then click again to hide it; but if I refresh the page it won't show my custom text anymore.

I made the changes in the code that has the hook "showthread_complete" as that was the only place I could find that text; I even searched the templates for it &...... nothing.

Any help here?

Thanks!

GuaRRand
15 Jun 2007, 14:32
can you make it so that the cursor becomes an arrow instead of the default line ... it would give it a more "clickable" feeling to it.

And it doesnt show up on the quickreply or edit windows, in the menubar i mean.
I see the button in a normal new post, but not in the quickreply or edit windows...

thanks

GuaRRand
19 Jun 2007, 10:00
*bump*

gutterboy
19 Jun 2007, 10:27
Could we please get an update here?

Thx!

jags2ooo
29 Jun 2007, 20:05
Great man I love how easy it is to use and Edit. Thanks this is perfect.

The Best thing about this MOD is there is NO more Highlighting needed :P