PDA

View Full Version : BB Code Enhancements - [BB Code] Spoiler Tag


theFM
04-14-2010, 10:00 PM
PLEASE CLICK ON INSTALL , IF YOU ARE INSTALLING IT , TO RECEIVE MORE UPDATES ON THIS.

This is is Without option code , with option , check posts below

As Many People PMed Me about to upgrade my Spoiler Tag code to vb4 , so I added this ,
The tag is:

Text you want to hide.

Now a guide to add it:


1. Upload the files of the attachment.
2. Log in at Admin Panel
3. Go to Style manager > All Style Options > Edit Models > headinclude.
4. Find:

<script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"></script>After this, add:

<script type="text/javascript" src="clientscript/spoiler.js"></script>5. Go to the BBCode option and then select to Add a new one.
6. Enter the data:

--- Title: Spoiler
--- Tag Name: spoiler
--- Replacement:


<blockquote class="postcontent restore ">
<div class="bbcode_container">
<div class="bbcode_quote">
<div class="quote_container">
<div class="bbcode_quote_container"></div>
<div class="bbcode_postedby">
<div style="margin: 5px 20px 20px;">
<div class="alt2" style="text-align: right; margin: 0px; padding: 6px;">
<span style="float: left; padding-top: 2px;"> <img src="images/icons/icon-spoiler.png" alt="Spoiler" />
<b>Spoiler: </b></span>
<input value="Mostrar" style="margin: 0px; padding: 0px; width: 80px; font-size: 10px;" 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 = 'Ocultar'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Mostrar';}" type="button">
</div>

<div style="padding-top: 4px;">
<div class="alt2" style="display:none; margin: 0px; padding: 6px;">
{param}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
--- Example: This is a spoiler tag!

--- Description: Tag to hide spoilers.
--- Use Option? NO
--- Bottom image: images/spoiler.gif
--- Remove Tag if Empty? Yes.
--- The other 3 options, set to No.

7 - Click to add and you are done!

It should look like this:

http://img199.imageshack.us/img199/7941/capturarqs.png

Note : - I have added this as a free source , you are free to edit it and help yourself , but add your modification in here aswel , so that you will help others ,
Users please browse through more posts to see more modification of this mod , please Click Install and Rate the Mod :)

dhemitz
04-15-2010, 11:56 AM
Thanks theFM ........ i will to try...

Oyabun
04-15-2010, 05:18 PM
Can you make it slide?

vicelover
04-16-2010, 06:14 AM
Any screenshots? Thanks

Mukashi
04-16-2010, 11:22 AM
Getting a few errors with this on my test board

If the spoiler is in the format
This is a spoiler tag!
it just shows up as text

If it's in the format
This is a spoiler tag!
it displays fine, but if there are multiple spoilers in the post and you click to open any of them, they only open the first one. Also, if you click the image in the spoiler thing, it opens a new page displaying just that image, rather than opening the spoiler.

theFM
04-26-2010, 08:40 PM
Thanks for saying , Fixed the Things ...

Try Now , it was doing alright now

jeremyricci
05-06-2010, 07:18 PM
Thanks for saying , Fixed the Things ...

Try Now , it was doing alright now

I've tried it as well, and I'm getting the same error. Perhaps I made an installation error? When I have multiple spoiler tags in 1 thread, only the first spoiler tag is revealed when clicked, the others all revert back to the original tag.

Also, would it be possible to make the "Spoiler" text a button to click, rather than selectable text? I suppose I could look into the HTML for that.

obmob
05-06-2010, 09:13 PM
This is a nice addon, thanks :)

ddaybofb
05-11-2010, 04:23 PM
I've tried it as well, and I'm getting the same error. Perhaps I made an installation error? When I have multiple spoiler tags in 1 thread, only the first spoiler tag is revealed when clicked, the others all revert back to the original tag.

Also, would it be possible to make the "Spoiler" text a button to click, rather than selectable text? I suppose I could look into the HTML for that.

Im having the same problem

Pangramma
05-14-2010, 03:13 PM
I've figured out a workaround by other codes found on google...

<blockquote class="postcontent restore ">
<div class="bbcode_container">
<div class="bbcode_quote">
<div class="quote_container">
<div class="bbcode_quote_container"></div>
<div class="bbcode_postedby">
<div style="margin: 5px 20px 20px;">
<div class="alt2" style="text-align: right; margin: 0px; padding: 6px;">
<span style="float: left; padding-top: 2px;"> <img src="images/icons/icon-spoiler.png" alt="Spoiler" />
<b>Spoiler: <i>{option}</i></b></span>
<input value="Mostrar" style="margin: 0px; padding: 0px; width: 80px; font-size: 10px;" 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 = 'Ocultar'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Mostrar';}" type="button">
</div>

<div style="padding-top: 4px;">
<div class="alt2" style="display:none; margin: 0px; padding: 6px;">
{param}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>


Notice i'm using the OPTION tag, so be carefull


This will work for those threads with more than one spoiler, avoiding the load of the javascript (so if you do this, remove the code in headinclude)

paramegsoft
05-14-2010, 04:33 PM
thanks

i will test it

Kaosvf
05-16-2010, 08:01 AM
Thx

Dr.osamA
05-20-2010, 12:38 AM
thanxx
good BBcode

installd+ 5 stars

for arabic users:

هذا الكود بعد تعديله لللعربية و مقتبس من الرد رقم 10

<blockquote class="postcontent restore ">
<div class="bbcode_container">
<div class="bbcode_quote">
<div class="quote_container">
<div class="bbcode_quote_container"></div>
<div class="bbcode_postedby">
<div style="margin: 5px 20px 20px;">
<div class="alt2" style="text-align: left; margin: 0px; padding: 6px;">
<span style="float: right; padding-top: 2px;"> <img src="images/icons/icon-spoiler.png" alt="Spoiler" />
<b>المفسد: </b></span>
<input value="عرض المحتوى" style="margin: 0px; padding: 0px; width: 80px; font-size: 10px;" 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 = 'اخفاء'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'عرض المحتوى';}" type="button">
</div>

<div style="padding-top: 4px;">
<div class="alt2" style="display:none; margin: 0px; padding: 6px;">
{param}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>

Dave-M
05-25-2010, 07:27 PM
Hi,

This looks interesting, is it possible to change the name from "spoiler" to something else so that it can be used in other ways.

For example, in a sig, so it might say:

me, him, you, them, etc

Would it just be a case of editing the phrases?

I hope that makes sense :)

Thanks.

ndut
05-26-2010, 06:39 PM
Nice

Michlerish
05-27-2010, 06:40 PM
This didn't work for me. I'm getting a broken image, and nothing to highlight or click... I'm fairly certain I did everything right.

Anyone else have this problem?

grunty1
05-27-2010, 08:41 PM
Installed and works great, nice guide!

robbiefritz
05-28-2010, 03:08 PM
Now a guide to add it:


1. Upload the files of the attachment.
2. Log in at Admin Panel
3. Go to Style manager > All Style Options > Edit Models > headinclude.
4. Find:

OK I don't see an option to edit modules. Do you mean templates? I did a search in the headinclude template but it returned "not found'. Any suggestions?

Running 4.03 PL1 if that matters.

Found the problem:

<script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"></script>

There were spaces in there that caused the search to not find the line.

robbiefritz
05-28-2010, 03:25 PM
Getting a few errors with this on my test board

If the spoiler is in the format
This is a spoiler tag!
it just shows up as text

If it's in the format
This is a spoiler tag!
it displays fine, but if there are multiple spoilers in the post and you click to open any of them, they only open the first one. Also, if you click the image in the spoiler thing, it opens a new page displaying just that image, rather than opening the spoiler.

NOT fixed sir! Get the exact same problems. :(

Uninstalled it for now. This one (https://vborg.vbsupport.ru/showthread.php?t=240674&highlight=spoiler) seems to work better although I like the look of yours better. We typically use more than one per post so this problem prevents me from using it. Will check back when fixed.

Wallace40
07-30-2011, 07:48 PM
HI - uhm - okay - have to say I have no knowledge of anything - when I say that I mean I didnt even upload and install the forum I am now running someone else did who disappeared and I have been left to it - I have installed just 2 plug ins and one product in my life and they were like full time jobs trying to get done - I read installation instructions on some of these mods etc and there is always something I get stuck on or makes no sense to me or sounds to complicated to try & when I do they make me want to turn to drink....

I have now tried to install a spoiler tag on my forum no less than 11 times, something goes wrong that I dont understand or its really horrible looking or didnt work on everything on forum AND didnt have the icon etc which appears in the advanced posting option things (whatever thats called??! editor? see thats how bad I am!! lol) I had lost faith completely..........

BUT - this installed absolutely perfectly - it was really easy to install and use, works on everything & I have had no problems at all - and for me that really is RARE as I consider typing on a computer not a typewriter as a big challenge!! lol (yep, I'm oldish!) - and not just that it is easy to adapt and looks REALLY professional/good on my forum - I am so happy - this might sound mad for something as simple sounding as a BB code for spoilers but I have to say its been the hardest thing to find for me - and even the girl that started and designed the site told me she couldnt find a good one that worked well for us before she disappeared somewhere in Moscow..............(lol).

You would not believe how many bad BB codes for spoilers I tried - either because they werent good on 4.0 Vb or the instructions etc made life impossible for a novice like me or whatever. I thought a spoiler BB code was a pretty essential thing & couldnt believe it wasnt standard on vbulletins - I cant believe how long it took to find a really good one that someone like me could install..............and did everything I wanted and looked good complete with icons/images etc.. so A BIG BIG BIG THANK YOU!

I am so grateful to you for your time making an EASY to install good looking essential add on.....

Brexen
07-30-2011, 08:05 PM
Thanks man i tryed it worked fine installed D:

thanhhungtn1
08-06-2011, 10:14 PM
It worked with
example
But it didn't with
example2

nacaruncr
08-06-2011, 10:25 PM
a idea... try to remplace this code:
<b>Spoiler: </b></span>with:
<b>Spoiler: &nbsp;</b>{option}</span>and activate the Use Option: YES

I have a similar spoiler, and have this code when you put Example it show me:

Spoiler: Title
--Example

XD I don't really know if will work or not... but you can try, ok ;)

regards ;)

MikeBeams
03-08-2012, 08:37 PM
Thanks! Great code!

xCSoulSlayer
04-15-2012, 10:23 AM
Great spoiler code!

marccap
04-25-2012, 05:25 PM
do you know how to reduce the width of the blue spoiler box

mertiliuss
07-09-2012, 01:12 PM
in the mobile skin does not work.

any solution?

fxdigi-cash
12-14-2012, 03:40 PM
it doesn't work on vb4.2........ any idea? thanks

Ravallojr
12-15-2012, 03:30 AM
Fix image and provide 4.2 code.

datoneer
01-27-2013, 12:30 AM
This is awesome mod. Thanks you so much. Installed, rated, nominated!

Angel Luis
02-07-2013, 07:13 PM
I can view the spoiler in the activity page.

IggyP
02-13-2014, 11:19 PM
this good for vb5 at all?

ramesh_umk3
02-14-2014, 11:50 AM
this good for vb5 at all?

class which are used in bbcode may not present in vB5 try once if not working you can remove it

john7911
02-14-2014, 02:09 PM
Any screenshots? Thanks

Dstephan
02-17-2014, 11:55 PM
It seems that language filtering doesn't work inside the spoiler- is there a fix for this?

ClaymanX
02-18-2014, 06:31 AM
How can i set it that only registred members can see the content of the spoiler?

IggyP
02-19-2014, 02:32 AM
How can i set it that only registred members can see the content of the spoiler?

+1
that would be very cool...i was hoping its possible myself...id even pay towards something like that with usergroup permissions

tharbin
01-29-2015, 02:03 PM
works perfect, just had to change the HTML code to english :P thanks a ton for this!