Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications

Reply
 
Thread Tools
Spoiler Tag Details »»
Spoiler Tag
Version: 1.0.0, by King Kovifor King Kovifor is offline
Developer Last Online: Aug 2015 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 04-21-2006 Last Update: Never Installs: 24
 
No support by the author.

Title: Spoiler
Tag: spoiler
Replacement:
HTML 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="Show/Hide" /></a>Spoilers!</td>
</tr>
<tbody id="collapseobj_spoiler_{option}" style="">
<td class="alt1" align="$stylevar[left]" valign="top">{param}</td>
</tbody>
</table>
</div>
Example: [spoiler=example]This is Hidden![/spoiler]
Use Option: Yes
Image: Leave Blank

Q. Why do I have to "use option"?
A. This will solve a bug when not using it. In the first coding it wasn't used, but it would only collapse the first usage of "[spoiler][/spoiler]" in the thread. Using option in the code allowed to to specify which usage of the tags to collapse.

Bugs: It's open by default! I'm working on getting it closed by default.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-19-2007, 08:52 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian View Post
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.
How could I do that within the BBCode Manager?
Reply With Quote
  #23  
Old 08-07-2007, 09:29 PM
daboogas94e daboogas94e is offline
 
Join Date: Aug 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't seem to get the spoiler tags working at all
Reply With Quote
  #24  
Old 08-10-2007, 11:46 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by daboogas94e View Post
i can't seem to get the spoiler tags working at all
What do you have in the BBCode Manager?
Reply With Quote
  #25  
Old 11-25-2007, 11:44 PM
smokey's Avatar
smokey smokey is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
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
Here's a quick fix.

Create a plugin, for the hook location choose postbit_display_complete and paste the following php code in the box:

PHP Code:
$this->post['message'] = preg_replace('/\{rand_string\}/i',rand(0,32768),$this->post['message']); 
The above code will change {rand_string} in a post to a random number (making it unique).

In the spoiler bbcode you created, find both:

Code:
spoiler_{option}
Replace both with:

Code:
spoiler_{rand_string}
Also I replaced "Spoiler!" in the header to "Spoiler for {option}". Just a suggestion to all.

Thanks for the bbcode btw, it was a great idea!
Reply With Quote
  #26  
Old 02-02-2008, 12:28 PM
TheoMessinis's Avatar
TheoMessinis TheoMessinis is offline
 
Join Date: Jun 2005
Location: Athens Greece
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! Great spoiler!
Reply With Quote
  #27  
Old 03-28-2008, 12:39 PM
mikkitine's Avatar
mikkitine mikkitine is offline
 
Join Date: Oct 2007
Location: London
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
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
Quote:
Originally Posted by smokey View Post
Here's a quick fix.

Create a plugin, for the hook location choose postbit_display_complete and paste the following php code in the box:

PHP Code:
$this->post['message'] = preg_replace('/\{rand_string\}/i',rand(0,32768),$this->post['message']); 
The above code will change {rand_string} in a post to a random number (making it unique).

In the spoiler bbcode you created, find both:

Code:
spoiler_{option}
Replace both with:

Code:
spoiler_{rand_string}
Also I replaced "Spoiler!" in the header to "Spoiler for {option}". Just a suggestion to all.

Thanks for the bbcode btw, it was a great idea!
I combined both of your suggestions and the result was still unchanged. Spoiler tags with the same option only open the first spoiler. In fact, spoiler tags with a different option still only open the first spoiler.
Reply With Quote
  #28  
Old 05-16-2009, 03:52 PM
scottevtv scottevtv is offline
 
Join Date: Apr 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The tag begins as "Spoiler about...", and then if the user clicks and cicks again the "Spoiler about" text is gone. This was a bit confusing.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05406 seconds
  • Memory Usage 2,290KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete