Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Custom Title Spoiler Button Details »»
Custom Title Spoiler Button
Version: 1.0.1, by GamBun GamBun is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.8.x Rating:
Released: 03-04-2009 Last Update: Never Installs: 84
Auto-Templates
Re-useable Code Translations  
No support by the author.

I have a Spoiler Tag Feature at my site that allows for a spoiler with a custom button title to be initially seen (great if you want to hint what is hidden inside).

I don't see anything exactly the same here...although some are similar... & have seen many requests for other spoiler ideas, so.... I thought I might share. Please be kind as this is my first shared hack.

Update: Spoilers still work in version 4.x.x (including suites). Spoilers may be used as intended, in all Blog posts, forum posts, & published article content (CMS) to hide hints/cheats. I will not support it anywhere else outside of posting areas.

It's real easy. Just log into the AdminCP=>Custom BBCodes=>Add New BB Code

Then do this:

Title: Spoiler
BB Code Tag Name: Spoiler

Replacement:
Code:
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px; width:852; height:26"><right><font color="red"><b>&nbsp;</b></font></right>  
<input type="button" value="Spoiler about {option}" style="font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';   this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '{option}'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{param}
</div>
</div>
</div>
Example: [spoiler=Title Text]Hidden Text Here[/spoiler]

description: Creates a button that hides/shows spoiler messages.

use {option}: Click "Yes" (Note: some have found they need to set this option to "No" due to personal styling, but in most cases it should be "Yes").

add the path to your "spoiler" icon The image would go in your forums images/editor directory. (Feel free to use the icon I added at the bottom of this post.. just right click on it to download it to your computer)

Remove tag if empty: Click Yes

...leave the rest at "No"

click "save" button & that's it!

>>LIVE EXAMPLE<< (You can test there without signing up, if you want to see how it works, but also not this is the newer "Smooth Version" the "Box Version" can be seen in the screen shots below).

The code will then be: [spoiler="Button Title Here"]Hidden Content Here...[/spoiler]

This also works to nested spoilers as well!

Below there is an icon to use as well. Just add your image of choice to your path... /images/editor directory.

ENJOY!

Please Note: if for any reason this spoiler system breaks when converting to 4.0 upgrade. Just to BB Code manager & delete it, go through the process of adding it again, as given above. Doing this will not make you lose any forum content as long as you use the the same code (i.e. if you modified the code I gave you, then you will have to do the same again for it to work as you want). Doing this will force the new version to read the bbcode properly. It also works in CMS, but I personally am not using it right now, as it's not relevant to my site. So let me know if you have any problems, & I'll test.

We have a smooth, "NO BOX" version HERE that also works for all 3X versions.

Screenshots

File Type: gif scrnshot1.gif (21.1 KB, 0 views)
File Type: gif scrnshot2.gif (19.4 KB, 0 views)
File Type: gif scrnshot.gif (21.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Panzer Max

Comments
  #22  
Old 09-10-2009, 11:22 AM
Drache Drache is offline
 
Join Date: Aug 2004
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I enable option yes then the old post with spoilers will not work. how do i fix this?
Reply With Quote
  #23  
Old 11-29-2009, 04:34 PM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Drache View Post
If I enable option yes then the old post with spoilers will not work. how do i fix this?
Can you share the old code for your spoilers. I don't know what you used. Just PM me about it.
Reply With Quote
  #24  
Old 11-30-2009, 11:12 AM
ImYourLady ImYourLady is offline
 
Join Date: Dec 2008
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Works well with 3.8.2
Reply With Quote
  #25  
Old 12-01-2009, 03:01 PM
The Smoking Gun The Smoking Gun is offline
 
Join Date: Jun 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Love it!!! Installed!!

Any chance of using {username} in title? So that each time a thread starter is displayed it is personalized by the member viewing it with their user name?

If so send the update alert I will tag too!

TSG!
Reply With Quote
  #26  
Old 12-19-2009, 01:59 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with vB4?
Reply With Quote
  #27  
Old 01-09-2010, 10:00 PM
tonyzhou tonyzhou is offline
 
Join Date: Nov 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

should apply to this one as well;

XSS

[spoiler=xss';alert('XSS');var y=']test[/spoiler]

click button twice
Reply With Quote
  #28  
Old 01-17-2010, 02:15 PM
ndut ndut is offline
 
Join Date: Sep 2007
Location: Indonesia
Posts: 335
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there's diffence if no title...& with title??
Reply With Quote
  #29  
Old 03-21-2010, 11:04 PM
Nook_Neformat Nook_Neformat is offline
 
Join Date: May 2006
Location: Kiev, Ukraine
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone knows how to make spoiler work with rss?
Reply With Quote
  #30  
Old 03-26-2010, 03:11 PM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Nook_Neformat View Post
anyone knows how to make spoiler work with rss?
Not really, This content was created for direct posting. Sorry.

Update: Spoilers still work in version 4.2.x, Tested in the Suites as well. Spoilers may be used as intended, in all Blog posts, forum posts, & published article content (CMS).

I will update the main content pages when 4.2.x becomes available in the BB CODE updates section.
Reply With Quote
  #31  
Old 04-06-2010, 01:56 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, installed but a slight problem with the look. I've edited the code from border: 1px inset to border: 0px and that works (see pic Unhidden) but the hidden pic still shows the long grey bar.

How can I remove this?
Attached Images
File Type: jpg Hidden.jpg (41.5 KB, 0 views)
File Type: jpg Unhidden.jpg (39.1 KB, 0 views)
Reply With Quote
Reply


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 10:21 AM.


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.07875 seconds
  • Memory Usage 2,344KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (5)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete