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
Inline Hover Spoiler BB Code (like Something Awful and Reddit) Details »»
Inline Hover Spoiler BB Code (like Something Awful and Reddit)
Version: 1.1, by Fangs404 Fangs404 is offline
Developer Last Online: Sep 2019 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.x.x Rating:
Released: 02-29-2012 Last Update: Never Installs: 18
Re-useable Code Translations  
No support by the author.

I posted this version of the spoiler BB code for vB 3.7 and 3.8, and it was well received, so I figured I'd bring it to vB 4, too.

Having been a member of Something Awful for a while, I've grown to really like their spoiler BB code. Reddit has the same spoiler code. I searched around, but I couldn't find a similar spoiler for vB. Every single spoiler tag I saw requires that you either click a button (which doesn't allow inline spoilers) or highlight text (which requires unnecessary work). I wanted to mimic SA's and Reddit's simple spoiler code on my forum, so this is what you see here. This mod is completely theme-independent (it's just a BB code, nothing else!), and it'll keep your site W3C compliant.

Without hovering, you see nothing but black:


However, when you hover the mouse over the black section of text, it magically appears:


Title: Spoiler
BB Code Tag Name: spoiler
Replacement:
HTML Code:
<span style="color: #000000; background: #000000;" onmouseover="this.style.color='#FFFFFF';" onmouseout="this.style.color='#000000';">{param}</span>
Example: [spoiler]THIS TEXT IS SPOILERED LOL[/spoiler]
Description: This tag changes the text into a black box which is unreadable. If you hover the mouse over the black box, the text will magically appear.
Use Option: No
Image:

Note: Depending on your template, you may need to change the colors in the HTML replacement code. Just make sure that color, background, and onmouseout match and that onmouseover is different. The colors in the above code should work just fine for styles with a light background and dark text.

Show Your Support

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

Comments
  #2  
Old 03-02-2012, 06:48 PM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just updated the image to be vB4 compatible. vB3 wanted 21x20 images, and vB4 wants 16x16 images.
Reply With Quote
  #3  
Old 03-16-2012, 12:50 PM
EvilArcana EvilArcana is offline
 
Join Date: Jul 2007
Location: Pensacola, FL
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to get the spoilered text to not show up in any Most Recent Posts widgets?
Reply With Quote
  #4  
Old 03-19-2012, 03:31 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EvilArcana View Post
Is there any way to get the spoilered text to not show up in any Most Recent Posts widgets?
Can you give me an example? It sounds like that's a bug with the widget not properly rendering BB code.
Reply With Quote
  #5  
Old 04-01-2012, 12:39 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really like it. :up:
Reply With Quote
  #6  
Old 04-04-2012, 12:29 AM
ptceuro ptceuro is offline
 
Join Date: Jan 2012
Location: U.S.A
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank's
I really like it.
Reply With Quote
  #7  
Old 05-30-2012, 03:41 PM
midnightpariah midnightpariah is offline
 
Join Date: May 2012
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A fantastic solution for a spoiler BB code! You've even provided an elegant button. Thank you so much!

One issue I encountered is in vB's Mobile skin on an iPhone (Safari). For some reason, the text receives a white dropshadow, making it legible while "hidden" and thus somewhat defeating its purpose. This problem does not exist in the normal fullsite vB skin on an iPhone, nor is it present in the Mobile skin when viewed from a computer with IE9.
Reply With Quote
  #8  
Old 06-18-2012, 04:21 AM
Fangs404 Fangs404 is offline
 
Join Date: Oct 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by midnightpariah View Post
A fantastic solution for a spoiler BB code! You've even provided an elegant button. Thank you so much!

One issue I encountered is in vB's Mobile skin on an iPhone (Safari). For some reason, the text receives a white dropshadow, making it legible while "hidden" and thus somewhat defeating its purpose. This problem does not exist in the normal fullsite vB skin on an iPhone, nor is it present in the Mobile skin when viewed from a computer with IE9.
Hm, would you mind providing a screenshot? If this only happens in mobile Safari, it might just be an iPhone problem. Perhaps the iPhone isn't capable of rendering the text the way a browser with a mouse can.
Reply With Quote
  #9  
Old 05-24-2023, 11:28 PM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works 4.2.6 php 7.2
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 08:45 AM.


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.04552 seconds
  • Memory Usage 2,298KB
  • 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
  • (1)bbcode_html
  • (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
  • (9)post_thanks_box
  • (1)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete