Problem to use a PNG logo

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
turbohead
Posts: 5
Joined: Sat Aug 12, 2006 4:39 am

Problem to use a PNG logo

Post by turbohead »

I have a problem about using a PNG logo. There is no problem when I load it in Firefox, but when I load it in IE, it looks like this:
Attachments
This is the IE view
This is the IE view
1.jpg (10.57 KiB) Viewed 4849 times
This it the Firefox view
This it the Firefox view
2.jpg (12 KiB) Viewed 4851 times

ElbertF
Registered User
Posts: 583
Joined: Fri Dec 03, 2004 4:35 pm
Location: tracing..
Contact:

Re: Problem to use a PNG logo

Post by ElbertF »

PNG isn't fully supported by older IE versions, this is not a phpBB problem. And if I'm correct, this isn't even about a phpBB forum..?

turbohead
Posts: 5
Joined: Sat Aug 12, 2006 4:39 am

Re: Problem to use a PNG logo

Post by turbohead »

But this logo works fine in some of Joomla! templates in IE6 (although some templates don't)
This is a phpbb3 forum, I just edited the subsilver template a bit, You can find it here.
Last edited by turbohead on Sat Aug 12, 2006 10:00 am, edited 1 time in total.

turbohead
Posts: 5
Joined: Sat Aug 12, 2006 4:39 am

Re: Problem to use a PNG logo

Post by turbohead »

BTW, if I want only the buttons without text (register, login, faq, etc), what should I do to get rid of the text links? :|

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Problem to use a PNG logo

Post by Highway of Life »

Edit the language file ;)
Image

turbohead
Posts: 5
Joined: Sat Aug 12, 2006 4:39 am

Re: Problem to use a PNG logo

Post by turbohead »

Thank you, I'll try it later~ :D

Wert
Registered User
Posts: 400
Joined: Tue Jul 03, 2001 8:33 pm

Re: Problem to use a PNG logo

Post by Wert »

turbohead wrote: But this logo works fine in some of Joomla! templates in IE6 (although some templates don't)
This is a phpbb3 forum, I just edited the subsilver template a bit, You can find it here.
Joomla could well be using some gross hack to enable png transparency in IE6 to some degree. I wouldn't count on it.

And while Joomla looks pretty, you might look into drupal if you've got serious needs. Joomla/Mambo is really limited if you want to go beyond the basics.
Need good web hosting? I recommend Hostrocket.

harmlessgoat22
Posts: 108
Joined: Sun Nov 27, 2005 12:25 am

Re: Problem to use a PNG logo

Post by harmlessgoat22 »

OH MY GOSH! It's like you mixed ipb and phpbb together. How DARE YOU? What did your parents tell you? Good and Evil don't mix!
alphaPORTAL
phpBB3 Integration MOD:
Create Pages in phpBB3
Portal
Many Modules including Login, Welcome, Search, Top Posters, Online Now, Menu, Offsite Links, and more

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Problem to use a PNG logo

Post by Highway of Life »

There is a workaround for this...
The problem can only be fixed in IE 5.5 and 6.
Why only versions 5.5 & 6 you say? Because Windows IE versions prior to 5.5 do not support the filter which fixes the PNG problem, and version 7 is reported to have fixed the issue entirely.

Place this code in your header on the page with the PNG.

Code: Select all

<!--[if lt IE 7]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.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.href) imgStyle = "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 + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
EDIT: I should add, that it would be best if you put this in a remote file, then call the JS script using the below code.
Of course, if you use this method, you would ONLY include the contents inside the <script> tags in the code shown above.

Code: Select all

<!--[if lt IE 7.]>
<script defer type="text/javascript" src="yourfile.js"></script>
<![endif]-->
Image

turbohead
Posts: 5
Joined: Sat Aug 12, 2006 4:39 am

Re: Problem to use a PNG logo

Post by turbohead »

Highway of Life wrote: Edit the language file ;)

Thank you, the text get away from menu bar now :mrgreen:
Highway of Life wrote: Place this code in your header on the page with the PNG.

Sorry, I'm not familiar with codes, should I place this code in index.php?
harmlessgoat22 wrote: OH MY GOSH! It's like you mixed ipb and phpbb together. How DARE YOU? What did your parents tell you? Good and Evil don't mix!

I like the style of IPB, but it's expensive........so what I could do is to edit the style to make it more looks like IPB :?

Post Reply