vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   PNG Transparency for Internet Explorer (https://vborg.vbsupport.ru/showthread.php?t=94416)

Oblivion Knight 08-15-2005 10:00 PM

PNG Transparency for Internet Explorer
 
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!

Floris 08-16-2005 05:34 PM

Very cool to share this, many will want this and especially nice to see the pros/cons against eachother. Good job.

Adrian Schneider 08-16-2005 05:46 PM

Thanks, works great.

Bad Bunny 08-16-2005 07:32 PM

Quote:

Originally Posted by TheSpecialist
Thanks, works great.

It doesn't seem to do anything for me. I am using rc1

Adrian Schneider 08-16-2005 08:09 PM

I think you have to do a hard refresh for the new JS files to load.
Ctrl F5

Oblivion Knight 08-16-2005 08:46 PM

Failing that; What version of Internet Explorer are you using and do you have javascript enabled?

Bad Bunny 08-17-2005 03:05 AM

Yeah, I restarted IE. I appreciate the work you did, and it must be good stuff. But I ended up using a different method. But thank you!

Wayne Luke 08-30-2005 05:02 AM

Great to see a solution which doesn't require modifying the PHP or how images are called. I used it to upload all new PNG emoticons to my site and it works great. Going to replace the icons with PNG tomorrow.

Hopefully since IE7 should support this transparently, more webmasters will start using PNGs to their full potential and we can see some cool things because of it.

Rhoads 11-03-2005 06:21 PM

Nice, installed in 5 sec and working perfectly :nervous:

TheFocusElf 11-06-2005 11:42 AM

sure, this mod is no catch all -- but I do like that it does address the issue.

-installed-

Darat 12-15-2005 08:30 AM

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.

bashy 01-13-2006 08:18 PM

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

Thanks m8 your a star :) installed

Pcparts 01-21-2006 01:19 PM

Thanks.


*installs*

BaselineAce 01-21-2006 02:40 PM

Anyone figure out a way to use background-image?

crash resistant 01-25-2006 09:14 PM

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?

wizardan 02-06-2006 12:06 PM

Perfect.
It addressed a concern I had for one of my skins.
Very much installed!

reismarktq2 03-20-2006 02:05 AM

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?

Lost_Prophet 03-20-2006 12:50 PM

Fantastic :D
*install*

magicktrick 03-29-2006 11:32 PM

wow, I was looking for something like this for my main site, and Viola! It works there too. Many thanks...installed and then some.

Oblivion Knight 07-26-2006 02:31 PM

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.. :)

sensimilla 08-22-2006 09:44 AM

I did everything as described and it doesnt work for me with the BBcode manager and rounded quotes hack.
https://vborg.vbsupport.ru/showthread.php?t=120073

Is it possible ? IE 6 here..

bada_bing 08-22-2006 12:48 PM

Stupid question but what does this actually do?

sensimilla 08-23-2006 07:26 AM

Quote:

Originally Posted by bada_bing
Stupid question but what does this actually do?

Theres no stupid questions only stupid answers.

Removes blue backgorund on transparet gifs in IE, I belive its IE that should be fixed.

Adrian Schneider 08-23-2006 07:30 AM

Quote:

Originally Posted by sensimilla
Theres no stupid questions only stupid answers.

Removes blue backgorund on transparet gifs in IE, I belive its IE that should be fixed.

I thought you were going to say "... only stupid people". lol

There is a "bug?" in IE that prevents PNG transparency. This is a workaround so the images look okay. I've been using it for about a year now...

Sin City 10-02-2006 11:53 AM

excellent hack... very useful

Scormen 10-14-2006 07:50 PM

Quote:

Originally Posted by sensimilla
I did everything as described and it doesnt work for me with the BBcode manager and rounded quotes hack.
https://vborg.vbsupport.ru/showthread.php?t=120073

Is it possible ? IE 6 here..

Hi,

I use that hack to, but it also does not wants to work for me.. :(
I'm using 3.6.2

Grtzz

Oblivion Knight 10-15-2006 08:27 AM

That modification contains a lot of this type of image reference in the coding:
Code:

<td style="background-image:url();">
As mentioned in the introduction; CSS backround PNGs are not supported.

Scormen 10-16-2006 04:50 PM

Ohh okay sorry, I didn't cheked the CSS... My fault!

Thanks,
Kris

nokturno 12-10-2006 04:09 PM

excellent hack

Ohiosweetheart 12-24-2006 07:07 PM

Where, exactly, in headinclude to we place this code ??

HTML Code:

<!--[if lt IE 7.]>
<script defer type="text/javascript" src="clientscript/vbulletin_pngfix.js?v=$vboptions[simpleversion]"></script>
<![endif]-->


Ultima07 07-28-2007 11:59 PM

haha this is just what i needed http://www.tamilultima.com

Defkalion 07-31-2007 08:36 AM

Great hack, works like a charm in 3.6.8 :)

Many thanks to the author and the thread starter :)

argus 01-02-2008 11:33 PM

Works great in 3.6.8 PL2. Thank you for sharing.

GoodKarmaKid 03-22-2008 05:08 AM

Does this work with vb 3.7 RC1 ??

Selene 05-10-2008 02:15 PM

I merged the xml into my style
uploaded the pics to the right path in images editor

and the icons are not showing up? So what is it I have done wrong? : )

Wayne Luke 05-11-2008 05:54 PM

Quote:

Originally Posted by GoodKarmaKid (Post 1471345)
Does this work with vb 3.7 RC1 ??

It should work in all versions of 3.7.0.

Wayne Luke 05-11-2008 05:55 PM

Quote:

Originally Posted by Selene (Post 1514951)
I merged the xml into my style
uploaded the pics to the right path in images editor

and the icons are not showing up? So what is it I have done wrong? : )

Can't really tell.. Do you have a screenshot of the problem?

Super Jinni 09-05-2008 05:37 PM

ok, I tried it just now, but it didn't work for me

even after doing hard refresh

Masiello 09-15-2008 07:16 AM

Thanks, in combination with the Wayne editor it works perfect on my 3.7.3 PL1 board :)

bleros 12-13-2008 02:11 AM

good job mann


All times are GMT. The time now is 03:56 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.01622 seconds
  • Memory Usage 1,809KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete