Announcement

Collapse
No announcement yet.

PNG image fix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PNG image fix

    I've noticed tha Apolyton does not show .png images for IE, due to not having proper code for it.

    Here, I've pasted a code for PNG image determination and proper display:

    This should be somewhere the global values are defined, before construction of HTML code:
    Code:
    define('PNG', is_integer(strpos($GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'],'MSIE')) && !is_integer(strpos($GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'],'Opera')));
    And this template should be used each time an uploaded image is displayed, replacing '/pic/mypicture.png' with the actual path to picture.
    Code:
    [td style="' . (PNG ? ' filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=/pic/mypicture.png, sizingMethod=crop);' : '') . '"]' . (PNG ? '' : '[img src="/pic/mypicture.png" alt="" /]') . '[/td]
    legend:
    PNG here is the constant defined above which says whether you need to have filter for PNGs or you can go with [img] tag.
    sizingMethod can have values"
    Code:
    crop Clips the image to fit the dimensions of the object. 
    image Default. Enlarges or reduces the border of the object to fit the dimensions of the image. 
    scale Stretches or shrinks the image to fill the borders of the object.
    Hope this gets implemented (shouldn't be much of work).
    -- What history has taught us is that people do not learn from history.
    -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  • #2
    Your code tag is really screwed - Im unable to paste normal HTML code within it, so I pasted it with '[' instead of '<' and ']' instead of '>'.
    -- What history has taught us is that people do not learn from history.
    -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

    Comment


    • #3
      A possible solution to the screwed up code tag is attaching a .txt file
      I love being beaten by women - Lorizael

      Comment


      • #4
        Umm, well, me bad.
        If you (yeah, you the person who's responsible for proper work of this forum! ) want, I can upload the file.
        -- What history has taught us is that people do not learn from history.
        -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

        Comment


        • #5
          Originally posted by binTravkin
          Your code tag is really screwed - Im unable to paste normal HTML code
          within it, so I pasted it with '[' instead of '<' and ']' instead of '>'.
          What, like this?

          Code:
          <strong>binTravkin</strong> is a big pansy
          (\__/) 07/07/1937 - Never forget
          (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
          (")_(") "Starting the fire from within."

          Comment


          • #6
            Originally posted by Urban Ranger


            What, like this?

            Code:
            <strong>binTravkin</strong> is a big pansy
            another reason to be a moderator
            Hi, I'm RAH and I'm a Benaholic.-rah

            Comment


            • #7
              Oops, wrong word.

              It should be "patsy."
              (\__/) 07/07/1937 - Never forget
              (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
              (")_(") "Starting the fire from within."

              Comment


              • #8
                UR, this is childish.
                If you intend to see what I did, take the HTML code of mine and replace the '[' and ']' back to '<' '>'.
                I am not stupid and it looks like the developers of poly software have forgotten to add either htmlspecialchars function to processing the content of code tags, or there is something wrong with quotation escaping.

                So, basically, one can make a thread unreadable by inserting some arbitrary HTML with both types of quotes (double and single).
                -- What history has taught us is that people do not learn from history.
                -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                Comment


                • #9
                  Originally posted by Urban Ranger
                  Oops, wrong word.

                  It should be "patsy."
                  Freudian slip?
                  I love being beaten by women - Lorizael

                  Comment


                  • #10
                    Originally posted by binTravkin
                    I am not stupid and it looks like the developers of poly software have forgotten to add either htmlspecialchars function to processing the content of code tags, or there is something wrong with quotation escaping.
                    The proper way of inserting special characters into any Web page is to use HTML entities. That's what my post was intended to show.

                    For example, you can place < by entering "&lt;"
                    (\__/) 07/07/1937 - Never forget
                    (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                    (")_(") "Starting the fire from within."

                    Comment


                    • #11
                      Umm, no, the proper way of coding the 'code' tag output is to use htmlspecialchars function.

                      Or are you telling me, that I should manually convert each entity?

                      Im a developer myself and have programmed code tag output, I can paste the whole code here if you want an example.
                      -- What history has taught us is that people do not learn from history.
                      -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                      Comment


                      • #12
                        Fix the width, bT
                        I love being beaten by women - Lorizael

                        Comment


                        • #13
                          Originally posted by binTravkin
                          Umm, no, the proper way of coding the 'code' tag output is to use htmlspecialchars function.
                          Duh, why did you underline something that's not an URL?

                          Anyway, you are relying on a PHP function which may or may not be used. You should always do "HTML safe" things on the Web.

                          Originally posted by binTravkin
                          Or are you telling me, that I should manually convert each entity?
                          Bog standard for Web pages. If you don't like it, write your own little filter for code fragments you wish to post on the Web. It should be a breeze for you.
                          (\__/) 07/07/1937 - Never forget
                          (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                          (")_(") "Starting the fire from within."

                          Comment


                          • #14
                            uh, why did you underline something that's not an URL?
                            For you to read it twice.
                            Anyway, you are relying on a PHP function which may or may not be used. You should always do "HTML safe" things on the Web.
                            Umm, on a web application which would never work without PHP and whose code actually consists of 80% PHP 5% MySQL and 15% HTML?
                            That's Stone Age thinking, dude.

                            Bog standard for Web pages.
                            Obsolete 'pseudo-standard' as general lazyness of developers.
                            Companies that care about usability don't do such.

                            EDIT: Actually there are things that require usage of htmlspecialchars and other code->non-code conversion functions, like JavaScript.
                            Last edited by binTravkin; February 24, 2006, 05:31.
                            -- What history has taught us is that people do not learn from history.
                            -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                            Comment


                            • #15
                              I actually think it's quite funny to underline things that aren't urls.

                              Comment

                              Working...
                              X