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

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

Category: Add-On Releases - Version: 4.2.x Rating:
Released: 08-06-2010 Last Update: Never Installs: 57
Uses Plugins
Re-useable Code  
No support by the author.

This Mod supports all 3X Versions - 4.2.x Versions!
Due to the demands, I have created a new version of spoilers. The greatest complaint I received HERE, was the framing of the actual spoiler. So gone is the "ugly" box! It is really quite easy to remove, but I understand that coding can be confusing/foreign to some people, this is why, I am releasing a clean, "NO BOX" version. I will still support those who want the box, for the 3X version, until the migration of everyone to the 4.X.x is made completely mandatory.

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 really 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>
<div style="display: none;">
{param}
</div>
</div>
</div>
Example: [SPOILER="Custom Button Title"]Hidden Content 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 (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) The image would go in your forums images/editor directory.

Remove tag if empty: Click "Yes"

...leave the rest at "No"

Click "Save" button & that is it!

The code will then be:

[SPOILER="Custom Button Title"]Hidden Content Here...[/SPOILER]

This also works to nested spoilers as well!

Nested Code Example:

[SPOILER="Button Title Here"]Hidden Content Here...[SPOILER="2nd Nested Button Title Here"]2nd Hidden Nested content Here...[/SPOILER][/SPOILER]


>>LIVE EXAMPLE<< (You can test there without signing up, if you want to see how it works).

It also works for the CMS suites! >>LIVE EXAMPLE<< (Please feel free to post comments & give it a try!)

ENJOY!

Please Note: if for any reason this spoiler system breaks when converting from 3X to 4.0 upgrade. Just go 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 BB code properly.

Screenshots

File Type: jpeg spoiler.jpeg (58.7 KB, 0 views)

Show Your Support

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

Comments
  #12  
Old 10-31-2011, 03:11 PM
ShackMaster ShackMaster is offline
 
Join Date: Apr 2006
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't work for me on 4.1.4 ... It does not hide the spoiler... just shows tags.
Reply With Quote
  #13  
Old 10-31-2011, 03:19 PM
ShackMaster ShackMaster is offline
 
Join Date: Apr 2006
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I change Use {option} to "No" it works fine.
Reply With Quote
  #14  
Old 04-03-2012, 06:45 PM
MJJUltimate MJJUltimate is offline
 
Join Date: Dec 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ShackMaster View Post
If I change Use {option} to "No" it works fine.
Same here, I could only get it to work by disabling that option. Now it works fine
Reply With Quote
  #15  
Old 06-20-2012, 10:51 AM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ ShackMaster & MJJUltimate - This may be from personal styling to your site. In most cases it should be "Yes." I have added this bit of info in case others have the same issues. Enjoy the spoilers.
Reply With Quote
  #16  
Old 02-19-2013, 04:25 AM
hamdanikcung hamdanikcung is offline
 
Join Date: May 2012
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

doesnot work in mobile ?
Reply With Quote
  #17  
Old 03-11-2013, 08:26 AM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hamdanikcung View Post
doesnot work in mobile ?
Not all mobile devices are set up to accept code such as this. I hope it changes down the road though. Sorry.
Reply With Quote
  #18  
Old 03-11-2013, 08:45 AM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hamdanikcung View Post
doesnot work in mobile ?
Not all mobile devices are set up to accept code such as this, or perhaps not right away. For example: You may have to check things like if your javavscripting to see if it's up-to-date for whatever browser you are using. Try this to see if it helps. I hope things become more uniform/consistent down the road with devices, but that will likely be a long time from now. So it might really be more the device might not support the code. When I shared this code, I was really meant for full website forums/suites, so that even large things like even videos can be hidden.
Reply With Quote
  #19  
Old 03-12-2013, 02:03 AM
WorldCraft WorldCraft is offline
 
Join Date: Jun 2010
Posts: 240
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't work on the mobile theme because the buttons there get an extra div, thus rendering the javascript unable to select the right elements. This would be a relatively easy fix, if only <vb:if>'s were allowed in custom bbcode...
Reply With Quote
  #20  
Old 03-13-2013, 09:04 PM
zaimbat zaimbat is offline
 
Join Date: Aug 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works great, thank you. Is there a way to make the button appear also in the Quick Reply box? I only see it if I go to the Advanced mode.
Reply With Quote
  #21  
Old 08-07-2013, 02:25 AM
GamBun's Avatar
GamBun GamBun is offline
 
Join Date: Jun 2006
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hamdanikcung View Post
doesnot work in mobile ?
No. This was originally created for forums and CMS. Some moble devices do not support this spoiler code. Sorry!

@ zaimbat ~ Your answer is HERE! or... >>This<< may also help
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 07:31 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.05736 seconds
  • Memory Usage 2,339KB
  • 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
  • (4)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
  • (2)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
  • (1)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