Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PNG Transparency for Internet Explorer Details »»
PNG Transparency for Internet Explorer
Version: 1.0, by Oblivion Knight Oblivion Knight is offline
Developer Last Online: Nov 2016 Show Printable Version Email this Page

Version: 3.5.5 Rating:
Released: 08-15-2005 Last Update: Never Installs: 198
Template Edits
Additional Files  
No support by the author.

Ever wanted to allow your users to see transparent PNG images using Internet Explorer? Now you can!

[high]Note:[/high] I did NOT create this script, it remains the sole property of it's author.


Pros & Cons

Pros:
  • Ignored as a comment in other browsers, so no browser-sniffing code is required
  • Works with (X)HTML Strict & Transitional Doctypes
  • Does not break W3C validation
  • Lightweight and very easily deployed
  • Works with existing in-line or external CSS rules based on class or ID selectors
  • Works with old-style img align="left" or align="right" attributes
  • Adds itself to the end of any existing Body Onload code
  • Works with imagemaps and input images using a special version
Cons:
  • Doesn't work in IE versions earlier than 5.5
  • Requires JavaScript to be enabled - the estimations for how many people choose not to use JS vary wildly.
  • CSS backround PNGs not supported - experimentation revealed I could traverse the Stylesheets collection and use the AlphaImageLoader trick to replace all background-image attributes containing PNGs, but then background-repeat would not work, and anchors placed over non-transparent parts of the image were not clickable :-(
  • CSS rules for the PNG images based on the img selector are lost, but this is easily rectified by adding a class selector to your img rule such that img{..} becomes img,.png{..} - then add the attribute class="png" to each of your PNGs.

To install, simply upload the attached .js file to your /forums/clientscript/ directory.

Then edit your headinclude template, and add the following:
HTML Code:
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="clientscript/vbulletin_pngfix.js?v=$vboptions[simpleversion]"></script>
<![endif]-->
You're all set.!
Note: Updated to reflect changes by the author, and 3.5.x javascript handling changes. This template modification works fine with 3.6.x as it is, and therefore won't be posted in the 3.6.x forum!

Show Your Support

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

Comments
  #12  
Old 12-15-2005, 08:30 AM
Darat Darat is offline
 
Join Date: Aug 2004
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi - wondering if this could be made to work with a "runtime generated" png? We've just installed LaTex onto our forum and we output that as a transparent PNG, which looks fine on all browsers bar IE of course.
Reply With Quote
  #13  
Old 01-13-2006, 08:18 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Absolutely brilliant...
I can now use the smiley maker

Thanks m8 your a star installed
Reply With Quote
  #14  
Old 01-21-2006, 01:19 PM
Pcparts Pcparts is offline
 
Join Date: May 2005
Location: Holland
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.


*installs*
Reply With Quote
  #15  
Old 01-21-2006, 02:40 PM
BaselineAce BaselineAce is offline
 
Join Date: Oct 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone figure out a way to use background-image?
Reply With Quote
  #16  
Old 01-25-2006, 09:14 PM
crash resistant crash resistant is offline
 
Join Date: Oct 2004
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One of the most under-rated and under-used hacks/mods in existance.

THANK YOU

Shame on you developers for not using PNG, regardless of IE support. Remember the whole firefox shebang?
Reply With Quote
  #17  
Old 02-06-2006, 12:06 PM
wizardan wizardan is offline
 
Join Date: Jan 2006
Location: America
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perfect.
It addressed a concern I had for one of my skins.
Very much installed!
Reply With Quote
  #18  
Old 03-20-2006, 02:05 AM
reismarktq2 reismarktq2 is offline
 
Join Date: Feb 2003
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack works perfectly for me except for one major problem: Avatars.

I thought the problem was that height and width weren't specified, but I spent two hours trying to figure out how to add that and it still wouldn't work. Anyone?
Reply With Quote
  #19  
Old 03-20-2006, 12:50 PM
Lost_Prophet Lost_Prophet is offline
 
Join Date: Feb 2006
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fantastic
*install*
Reply With Quote
  #20  
Old 03-29-2006, 11:32 PM
magicktrick magicktrick is offline
 
Join Date: Mar 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, I was looking for something like this for my main site, and Viola! It works there too. Many thanks...installed and then some.
Reply With Quote
  #21  
Old 07-26-2006, 02:31 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by reismarktq2
This hack works perfectly for me except for one major problem: Avatars.

I thought the problem was that height and width weren't specified, but I spent two hours trying to figure out how to add that and it still wouldn't work. Anyone?
Avatars should work if you use the file system storage option instead of database..
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 03:26 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.04336 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete