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
BBCode - Custom Spoiler Details »»
BBCode - Custom Spoiler
Version: 1.01, by orange gold orange gold is offline
Developer Last Online: Sep 2011 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.1.0 Rating:
Released: 12-23-2010 Last Update: Never Installs: 44
 
No support by the author.

*Update released! In the new code the button will automatically adjust it's width to tightly fit all the text in the title.. You don't have to worry about keeping your title small anymore! enjoy!

If you like this you may also like the image preview spoiler for large images

I have seen spoiler code before but I am not sure if there is any spoiler code 4.0 for a custom spoiler where you can enter the text that appear on the button (ex. Click to view hidden message) and also show what is on the inside...

Here is my code I made:
** There is a known glitch where in the button title if you put the following symbol in the name ' then it will not work... If anyone can fix this please let me know because I have tried.. Other than that, the code works fine!

Enjoy! (Screenshots below)

Title:
Code:
Spoiler
BBCode Tag Name:
Code:
spoiler
Replacement:
Code:
<div>
    <div class="pre-spoiler">
    <input type="button" value="  {option}  " style="font-size:14px;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.value = '{option}';}">
    </div>
    <div>
        <div class="spoiler" style="display: none;"><div style="border: 1px solid ;">{param}</div></div>
    </div>
</div>
Example:
Code:
[spoiler=enter your title here]enter your text here[/spoiler]
Description:
Code:
Shows and hides text with the click of a button.
(Glitch: In the button title... do not use this symbol ' )
Use Option:
Code:
Yes.
Leave everything else default... Let me know what you think..

Screenshots

File Type: png Screen shot 2010-12-24 at 3.43.54 AM.png (11.2 KB, 0 views)
File Type: png Screen shot 2010-12-24 at 3.44.00 AM.png (12.8 KB, 0 views)

Show Your Support

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

Comments
  #22  
Old 01-15-2011, 10:19 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

uhm?

replacement:
Code:
<strike>{param}</strike>
???

haha
Goodluck!
You might also want to use the CSS line-through, instead of just <strike>, old HTML like that might go obselete.
Reply With Quote
  #23  
Old 07-14-2011, 08:52 AM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update released! In the new code the button will automatically adjust it's width to tightly fit all the text in the title.. You don't have to worry about keeping your title small anymore! enjoy!
Reply With Quote
  #24  
Old 08-23-2011, 10:32 PM
MonkYZ MonkYZ is offline
 
Join Date: Jul 2008
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help! But can you please tell me how to show the original title instead of "Hide" ?
Reply With Quote
  #25  
Old 11-04-2011, 11:31 AM
Breixo Breixo is offline
 
Join Date: Jun 2010
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working on 4.1.7, everything ok!
Reply With Quote
  #26  
Old 07-20-2014, 09:33 PM
BasicGreatGuy BasicGreatGuy is offline
 
Join Date: Oct 2006
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone come up with a fix for the apostrophe glitch?
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 05:48 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.04101 seconds
  • Memory Usage 2,276KB
  • Queries Executed 23 (?)
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
  • (7)bbcode_code
  • (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
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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_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