Wednesday, September 26, 2007

PNG-24 in IE for osCommerce

This is quick fix to display PNG-24 properly on Internet Explorer.

Just modify html_output.php.



$msie='/msie\s(5\.[5-9]|[6]\.[0-9]*).*(win)/i';

if( !isset($_SERVER['HTTP_USER_AGENT']) ||

!preg_match($msie,$_SERVER['HTTP_USER_AGENT']) ||

preg_match('/opera/i',$_SERVER['HTTP_USER_AGENT']))

{

$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' .
tep_output_string($alt) . '"';

}

else

{

if(strtoupper(substr($src, -3, 3)) == "PNG")

{

$image = '<img src="images/spacer.png" style=" width:'.$width.'px; height:'.$height.'px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''. $src.'\',
sizingMethod=scale);" border="0" alt="' . tep_output_string($alt) . '"';

}

else

{

$image = '<img src="' . tep_output_string($src) . '" border="0"
alt="' .strtoupper(substr($src, -3, 3)). tep_output_string($alt) . '"';

}

}

Labels: , ,


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?