Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

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
  #2  
Old 12-24-2010, 06:59 PM
Blooded Blooded is offline
 
Join Date: Feb 2010
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was looking for this thanks
Reply With Quote
  #3  
Old 12-24-2010, 09:33 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you like it!!
Reply With Quote
  #4  
Old 12-25-2010, 09:43 PM
Antidepresiv Antidepresiv is offline
 
Join Date: Dec 2010
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks dude! Is it possible to display a custom button for this spoiler, for example, a button with width 150 height 15px ?
Reply With Quote
  #5  
Old 12-25-2010, 10:57 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes! (: in the replacement code you will see something like 450px etc. Replace that with 150px. Sory I'm on my phone now. I can also make it auto re-size when I get home... Good luck until then (:
Reply With Quote
  #6  
Old 12-25-2010, 11:07 PM
Antidepresiv Antidepresiv is offline
 
Join Date: Dec 2010
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Y i get that, but i meant a custom blank button, so when you click on it, the spoiler text shows.. thanks for you'r reply..
Reply With Quote
  #7  
Old 12-25-2010, 11:37 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do not understand.. Do you mean just a plain button with no text that is that size?
Reply With Quote
  #8  
Old 12-26-2010, 12:31 AM
Antidepresiv Antidepresiv is offline
 
Join Date: Dec 2010
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Y, and when you enter the spoiler title, it shows on that button.. Don't get me wrong, this is rly cute, but i want to add a custom blank button for the spoiler, cuz i have a custom design.. And thank you again
Reply With Quote
  #9  
Old 12-26-2010, 12:42 AM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where it says:

value="{option}"

Change the text {option} to the custom title you want shown, instead of the one the user enters..

Then later on there is a value that says..

Use {option}? Check no...

Save..

Does this work?
Reply With Quote
  #10  
Old 12-26-2010, 01:07 AM
Antidepresiv Antidepresiv is offline
 
Join Date: Dec 2010
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dude, sty, but you have miss understod me, i would just like to make a custom button for the spoiler, users can write their own title, but i would make the button, it would be an image, so when they click on that image, the spoiler shows.. Hope i explained it.. And thank you again for you'r help..

Best Regards,
Anti
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 04:18 PM.


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.04480 seconds
  • Memory Usage 2,304KB
  • Queries Executed 24 (?)
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
  • (6)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_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