vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - Custom Title Spoiler Button (Smooth Version) (https://vborg.vbsupport.ru/showthread.php?t=248145)

GamBun 08-06-2010 10:00 PM

Custom Title Spoiler Button (Smooth Version)
 
1 Attachment(s)
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! :D

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.

Juggernaut 08-07-2010 03:26 AM

Great work man :D

GamBun 08-07-2010 04:26 PM

Thanks! :)

myarmy 08-20-2010 04:09 AM

nice one... thanks!

Zombo 08-21-2010 09:19 AM

does not work on 4.0.6

GamBun 08-23-2010 04:28 PM

Actually, it does. Where are you having the problem?

Afsoul 08-29-2010 01:16 PM

This is what I need... Thank you very much :D

angeljs 05-27-2011 09:15 PM

Exactly what I was looking for and working perfectly, thanks :)

GE-Tom 10-07-2011 06:19 AM

Work great with 4.1.6. Thanks a lot. Easy to customize. Installed.

I adapted it slightly.

Spoiler close: http://s3.imgimg.de/uploads/customsp...ab7c7a1jpg.jpg
Spoiler open: http://s3.imgimg.de/uploads/customsp...1dea0dajpg.jpg

Code:

<div style="margin-top:5px; margin-buttom:5px;">
<div class="smallfont" style="margin-bottom:-1px; width:852; height:26"><right><font color="red"><b>&nbsp;</b></font></right> 
<input type="button" value="Spoiler: {option}" style="color: #4E4E4E; background-color: #EAEAEA; border: 1px solid #CECECE; border-radius: 3px 3px 3px 3px; font-size: 11px; font-weight: bold; margin-top: 10px; padding: 5px;" 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 = 'Spoiler: Inhalt verbergen'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Spoiler: {option}'; }">
</div>
<div>
<div style="display: none; background-color: #EAEAEA; border: 1px solid #CECECE; border-radius: 3px 3px 3px 3px; padding: 10px;">
{param}
</div>
</div>
</div>

But i think its better to outsource the css code.

GamBun 10-14-2011 02:48 PM

Nice GE-Tom! :)


All times are GMT. The time now is 06:22 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.02871 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_code_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