We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    Hello,
    I’m trying to use a php script for fixing png transparency with IE from here

    I made a new snippet and called it replacePngTags and pasted the code provided.

    my problem is that I need to call the code twice on the page, at the top and bottom, and don’t know what is the right way to accomplish that?
    can someone please explain/tip me on how to go about it?

    Thanks in advance!

    edit:

    ie,
    1.Save the function into a file named "replacePngTags.php"
    At the top of the files that you want to use this function with, paste the following code: 
    [b]<?php ob_start(); ?>[/b]
    2.Now, at the bottom of this file, paste the following lines of code: 
    [b]<?php
        include_once 'replacePngTags.php';
        echo replacePngTags(ob_get_clean());
    ?>[/b]



      • 27330
      • 884 Posts
      anyone? i thought that’s a simple one smiley
        • 22303 MODX Staff
        • 10,725 Posts
        This might work better as a plugin attached to the OnWebPagePrerender event, especially if it’s going to be used for all pages. Otherwise, it likely won’t work within MODx without some significant modification by you, since MODx already does it’s own output buffering...
          • 27330
          • 884 Posts
          thanks Jason,
          unfortunately using this as plugin with OnWebPagePrerender doesn’t seem to effect the page sad
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: sinbad at Jun 20, 2007, 08:12 AM

            thanks Jason,
            unfortunately using this as plugin with OnWebPagePrerender doesn’t seem to effect the page sad
            Yeah, again, it won’t work as is; you’ll need to author a plugin that uses it properly. You may need to become more familiar with how to author a plugin first... undecided
              • 27330
              • 884 Posts
              ok, was hopping for it to work right out of the box smiley
              guess I’ll keep looking for another fix.
              thanks again...