Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Template Modifications

Reply
 
Thread Tools
fix png transparency Details »»
fix png transparency
Version: 1.00, by RC. RC. is offline
Developer Last Online: Apr 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.7.0 Rating:
Released: 05-25-2008 Last Update: Never Installs: 40
Template Edits
 
No support by the author.

this code fix the png transparency problems whit ie5 and ie 6

this is very simple:
in the header template add this code very top:

PHP Code:

<!--[if gte IE 5.5000]>
<
script language="JavaScript">
function 
correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
for(var 
i=0i<document.images.lengthi++)
{
var 
img document.images[i]
var 
imgName img.src.toUpperCase()
if (
imgName.substring(imgName.length-3imgName.length) == "PNG")
{
var 
imgID = (img.id) ? "id='" img.id "' " ""
var imgClass = (img.className) ? "class='" img.className "' " ""
var imgTitle = (img.title) ? "title='" img.title "' " "title='" img.alt "' "
var imgStyle "display:inline-block;" img.style.cssText
if (img.align == "left"imgStyle "float:left;" imgStyle
if (img.align == "right"imgStyle "float:right;" imgStyle
if (img.parentElement.hrefimgStyle "cursor:hand;" imgStyle
var strNewHTML "<span " imgID imgClass imgTitle
" style=\"" "width:" img.width "px; height:" img.height "px;" imgStyle ";"
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
"(src=\'" img.src "\');\"></span>"
img.outerHTML strNewHTML
i-1
}
}
}
window.attachEvent("onload"correctPNG);
</
script>
<![endif]--> 


If you Like This Mod Mark INSTALLED

enjoy

Show Your Support

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

Comments
  #2  
Old 05-26-2008, 01:04 AM
dvbusuario's Avatar
dvbusuario dvbusuario is offline
 
Join Date: Oct 2007
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Install!!
Reply With Quote
  #3  
Old 05-26-2008, 06:26 AM
Bonus Paradise Bonus Paradise is offline
 
Join Date: May 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you for that!
Reply With Quote
  #4  
Old 05-26-2008, 10:31 AM
Silvio's Avatar
Silvio Silvio is offline
 
Join Date: Nov 2005
Location: Italy
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ty sir! *installed
Reply With Quote
  #5  
Old 05-26-2008, 03:32 PM
echo2kk5 echo2kk5 is offline
 
Join Date: Dec 2004
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with 32 bit PNG images as well?
Reply With Quote
  #6  
Old 05-27-2008, 09:53 AM
OcR Envy's Avatar
OcR Envy OcR Envy is offline
 
Join Date: May 2008
Location: Boston
Posts: 248
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any problems with width/height going crazy? I've tried other png ie fixes that worked but had issues.
Reply With Quote
  #7  
Old 05-27-2008, 02:35 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This solution is more elegant, less resource intensive and still valid:

https://vborg.vbsupport.ru/showthread.php?t=94416

Just by placing the javascript in an external file, you can significantly reduce page load and bandwidth simply because its cached in the end-user's browser. Not only that but IE7 and IE8 do not need this applied to PNG images since they support the Alpha Transparency natively.
Reply With Quote
  #8  
Old 06-20-2008, 04:28 PM
OsiRiS_X OsiRiS_X is offline
 
Join Date: Oct 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Install, Very Nice!
Reply With Quote
  #9  
Old 06-21-2008, 04:16 PM
kencasanova kencasanova is offline
 
Join Date: Jun 2007
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesn't work with mine. help!
Reply With Quote
  #10  
Old 06-21-2008, 05:08 PM
CMGU CMGU is offline
 
Join Date: Mar 2007
Location: Central America
Posts: 213
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

doesn't work for me
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 10:46 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.07354 seconds
  • Memory Usage 2,301KB
  • 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_php
  • (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
  • (1)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete