vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Spoiler Tag (https://vborg.vbsupport.ru/showthread.php?t=113776)

King Kovifor 08-06-2006 12:50 PM

Quote:

Originally Posted by Danny W
I noticed if you have more than 1 spoiler on a page the buttons only open the first one.

The spoiler tag should include:

[spoiler=SOMEUNIQUE_ID]and it'll collapse for all of them[/spoiler]

dartho 08-07-2006 05:05 AM

I changed this ever so slight for my own uses - still all the original code.

I've called the code JOKE
Code:

<div class="fieldset">
<table class="tborder" cellpadding="5" cellspacing="0" border="0" width="100%" align="center">
<tr>
  <td class="tcat" colspan="3"><a style="float:right" href="#top" onclick="return toggle_collapse('spoiler_{option}')"><input type="button" value="Click Me" /></a>{option}</td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="display:none;">
<td class="alt1" align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>

So bascially it shows the joke, and you click the "Click Me" button to show the punch line :)

Nice Hack - Thanks!!

King Kovifor 08-16-2006 12:59 PM

Quote:

Originally Posted by dartho
I changed this ever so slight for my own uses - still all the original code.

I've called the code JOKE
Code:

<div class="fieldset">
<table class="tborder" cellpadding="5" cellspacing="0" border="0" width="100%" align="center">
<tr>
  <td class="tcat" colspan="3"><a style="float:right" href="#top" onclick="return toggle_collapse('spoiler_{option}')"><input type="button" value="Click Me" /></a>{option}</td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="display:none;">
<td class="alt1" align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>

So bascially it shows the joke, and you click the "Click Me" button to show the punch line :)

Nice Hack - Thanks!!

It's for your use. And if you want to change it to be used with jokes. Go right a head.

ArchEnemy 08-25-2006 02:19 PM

Thank you for that code (the joke one too). I find it useful to set the title of the hidden field, but would be even nicer when it would use a default name when nothing was specified. :)

When you add class="button", the button comes in the css style. Looks better.
Code:

<input type="button" class="button"
Ok, after some testing, ... another variation of the code above. It creates a box with a textlink (option), which opens and closes the box. So this one is without any additional ugly buttons.

Code:

<div class="fieldset">
<table class="tborder" cellpadding="5" cellspacing="0" border="0" width="100%" align="center">
<tr>
  <td class="tcat" colspan="3"><a style="float:left" href="#top" onclick="return toggle_collapse('spoiler_{option}')"><input type="hidden" value="{option}" />{option}</a><br></a></td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="display:none;">
<td class="alt1" align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>


sbrum 09-04-2006 03:19 PM

Quote:

Originally Posted by King Kovifor
The spoiler tag should include:

[spoiler=SOMEUNIQUE_ID]and it'll collapse for all of them[/spoiler]

This does not work for me either. Sometimes the first button opens the second spoiler.

sbrum 09-04-2006 03:21 PM

Quote:

Originally Posted by sbrum
This does not work for me either. Sometimes the first button opens the second spoiler.

Sorry, its working now.

Disasterpiece 07-19-2007 07:30 PM

Hi

I wanted to use the option param, so the user could use this for his own text on the button.

so when he uses [spoil=hideMe]xyz[/spoil] then, the Button says "hideMe".

i'm looking for a better way for the unique id. creating a random id would be perfect, but i don't think this is possible in html. any solution?

King Kovifor 07-19-2007 07:41 PM

If you install the multi option hack somewhere here on the forum, you could change this up to be [spoil=hideMe|uniqueID]xyz[/spoil]. I'm not sure how you'd do the HTML, since I've never used the hack, but I know it exists.

Adrian Schneider 07-19-2007 07:50 PM

The unique identifier should be generated by PHP (hash, microtime, etc).

Then you could do [spoiler]HE DIES IN THE END![/spoiler] or if you want ... [spoiler=WARNING]HE DIES IN THE END[/spoiler] which would replace the default caption.

Just an idea to simplify the use. :)

Disasterpiece 07-19-2007 08:08 PM

Yeah, im kind of a noob in php, i can only html ^^

so, this is my modified code:
Code:

<div class="fieldset">
<table cellpadding="5" cellspacing="0" border="0" align="center">
<tr>
  <td colspan="3" align="center"><a href="#top" onclick="return toggle_collapse('spoiler_{option}')"><input type="button" value="{option}" /></a></td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="display:none;">
<td align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>

i used the option param for the button's value AND the spoiler id. works in 80%; when users use different values for the buttons, but i wanted to use it in the signature. So there would be many buttons with the same id.

is it possible to use php code in the code field? when yes, could you give me the php code for creating a random number? would be great :D


All times are GMT. The time now is 02:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02701 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete