Announcement

Collapse
No announcement yet.

Giving something back: Hiding Broken Images

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

    #16
    Ian - use the PHP to write the whole <img> to the page and not from within the <img> tag itself ..

    if exist = <img src="file.jpg" />
    else = <img src="blank.gif" />


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #17
      sorry, my last post was supposed to follow Lee's... It makes no sense out of sync :S

      I think I understand the principle - instead of looking on the webserver to see if the file is there, do the search at upload time on the local files.

      I think I'm thinking backwards now. Thanks.

      Comment


        #18
        The php within actinic runs as the page is created, so the page is created and then uploaded when you update the site. So you can do all of your evaluations on the desktop and just send the final page off to the server. No need to do anything on the server, evaluate it on the desktop in other words.

        Comment


          #19
          ooh... the wonderful glow of comprehension...

          I knew Actinic's PHP wouldn't help me online, but I hadn't considered being able to use it at creation time.

          Quick question - do actinic PHP tags work like the <?php and ?> tags we all know and love? eg can I do this?

          Code:
          <actinic:block php="true" >
          
          if(some stuff) {
          
          </actinic:block>
          
          HTML stuff
          
          <actinic:block php="true" >
          
          } else {
          
          </actinic:block>
          
          HTML stuff
          
          <actinic:block php="true" >
          
          }
          
          </actinic:block>

          Comment


            #20
            You only need to open and close the block once, you can do your echo statements in between all within the the same block. The block works very much like the <?php and ?> as far as i know, if not exactly the same. I think the weirdest thing to understand that it's an engine running within actinic and nothing happens online, it has already been processed prior to upload.

            Comment


              #21
              Code:
              <actinic:block php="true" >
              $rsimage = "rs_" . basename(str_replace('\\','/', '<actinic:variable name="ProductImageFileName" encoding="perl" selectable="false" />'));
              if (file_exists($rsimage)) {
              echo "<img src=\"".$rsimage."\" border=\"0\" width=\"<actinic:variable name="ProductImageWidth" encoding="perl" selectable="false" />\" height=\"<actinic:variable name="ProductImageHeight" />\" alt=\"<actinic:variable name="SectionName" />\" />";
              }
              </actinic:block>
              Thanks guys.

              Comment


                #22
                Indeed - it runs the routine and parses the results as if on a normal PHP page .. everything between the <block php> is parsed at upload... very powerful inclusion into Actinic.


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #23
                  It is safest setting the width variable to perl and not selectable also as it can crash the preview in the design tab


                  Bikster
                  SellerDeck Designs and Responsive Themes

                  Comment

                  Working...
                  X