What it does
Makes IE use DirectX to properly render PNGs with transparency.
How to apply
Open: Sources/Subs.php
Look for:
$codefromcache = array_keys($code_to_from);
$codetocache = array_values($code_to_from);
Add directly after:
// A PNG image with transparency in IE5.5+. Maybe not the best solution, but it works :P. Width and height are optional.
$codefromcache[] = '~\[png(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*(.+?)(?:<br />)*\[/png\]~ei';
if (isset($disabled['png']) || isset($disabled['img']))
$codetocache[] = '$5';
elseif ($context['browser']['is_ie5.5'] || $context['browser']['is_ie6'])
$codetocache[] = '\'<a href="$5"><img src="' . $settings['images_url'] . '/blank.gif" alt=""\' . (\'$2\' != \'\' ? \' width="$2"\' : \'\') . (\'$4\' != \'\' ? \' height="$4"\' : \'\') . \' border="0" style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=\\\'true\\\', src=\\\'$5\\\', sizingMethod=\\\'\' . (\'$2\' != \'\' || \'$4\' != \'\' ? \'scale\' : \'image\') . \'\\\');" /></a>\'';
else
$codetocache[] = '\'<img src="$5" alt=""\' . (\'$2\' != \'\' ? \' width="$2"\' : \'\') . (\'$4\' != \'\' ? \' height="$4"\' : \'\') . \' border="0" />\'';
Other Resources
http://koivi.com/ie-png-transparency/
Usage
[png]http://blah.com/blah.png[/png]
[png=http://blah.com/blah.png (optional: width=20 height=20)]blahblah[/png]
In other words, same as the [img] tag.
Enjoy ;D
yikes... that page made my internet explorer lock up, and eventually my pc...
yeah, its pretty intensive..
I take it this doesn't work on SMF 1.0.2?
it should...
the only version i know of that it wont work on yet is 1.1 beta 3
Great trick :).
/me gives IE the evil eye for not making my precious Opera avatar transparent...
-Dan The Man
Quote from: ??? on June 16, 2005, 08:05:09 PM
it should...
the only version i know of that it wont work on yet is 1.1 beta 3
Well, I couldn't find these lines of code anywhere in Subs.php:
$codefromcache = array_keys($code_to_from);
$codetocache = array_values($code_to_from);
Wait, nevermind.
This doesn't even do what I want.
I have a piece of code that enables PNGs anywhere on the site to become transparent when viewed with IE.
Problem is, it gives me parse errors when I use it.
Even when the quotes that create the parse errors are escaped.
If I post the code, do you think you might be able to fix the parse errors?I got it fixed. :D
Sorry for necro posting, but I too am not able to find the following code in subs.php.
$codefromcache = array_keys($code_to_from);
$codetocache = array_values($code_to_from);
So where should I post this? I am using a custom theme with SMF 1.1.8
Or you can use css to feed a png-8 or a gif for IE6. AlplhaImageLoader is nasty no matter how you do it.
Hi to everebody.
I didn't want to create an additional theme that's why I'll ask my question here.
For one project I want to make some integration of 2 web application. The idea is:
I have a web site that shows the news of the comunity. Also I have a board with news in order not to publish one news twice through 2 application I want to make first messages of board news be displayed on web site.
This task was done. But I stucked with problem of BB codes. I don't want to make an additional BB code parser or use any. I want to use BB code parser that is in SMF forum engine. May be someone knows what file contains this function. It would be perfect if you could also tell the name of function that parses BB codes in forum. :)
Thank you for attention. :)
Spending some time I found out that function parse_bbc does BB code parsing. Last question where this function located?
I think if I'll spend some a little bit more time I'll answear this question by myself. :)
Problem solved. :)
This function located in file /Sources/Subs.php
:)