Announcement

Collapse
No announcement yet.

Product Summary Image - Simple Image Revised July 2021

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

    Product Summary Image - Simple Image Revised July 2021

    Title and explanation at:

    https://community.sellerdeck.com/for...esizing-images

    The forum only lets you post 10 <img> tags thinking theu are images even though they are in code, so the layouts are on a number of posts - sorry!

    Product Summary Image - Simple Image Revised July 2021

    'Small Product Image'



    Code:
    <actinic:block php="true" >
    include_once 'simpleImage.php';
    error_reporting(E_ALL & ~E_NOTICE);
    $altname = '<actinic:variable name="ProductName" encoding="perl" selectable="false" /> image';
    $sOrigimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = str_replace('\\','/', '<actinic:variable name="ProductImageFileName" encoding="perl" selectable="false" />');
    $scaleddir = 'scaled/';
    $simpleimagebasespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = basename($sOrigimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />);
    $plgwidth = 267;
    $pmdwidth = 470;
    $psmwidth = 720;
    $pxswidth = 545;
    $plgfile = $scaleddir . 'plg_' . $simpleimagebasespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />;
    $pmdfile = $scaleddir . 'pmd_' . $simpleimagebasespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />;
    $psmfile = $scaleddir . 'psm_' . $simpleimagebasespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />;
    $pxsfile = $scaleddir . 'pxs_' . $simpleimagebasespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />;
    if ( file_exists($sOrigimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />) )
    {
    $plgheight = ($plgwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $pmdheight = ($pmdwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $psmheight = ($psmwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $pxsheight = ($pxswidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    }
    try
    {
    if ( file_exists($sOrigimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />) )
    {
    $simpleimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = new \claviska\SimpleImage($sOrigimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />);
    $simpleimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> -> resize($plgwidth) -> toFile($plgfile);
    $simpleimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> -> resize($pmdwidth) -> toFile($pmdfile);
    $simpleimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> -> resize($psmwidth) -> toFile($psmfile);
    $simpleimagespi<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> -> resize($pxswidth) -> toFile($pxsfile);
    }
    }
    catch(Exception $err)
    {
    // Handle errors
    echo $err->getMessage();
    }
    </actinic:block>
    </actinic:block>
    
    <div class="d-flex align-items-center justify-content-center w-100 product-image-sec">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpDisplayedByImage%22%20%2f%3e" >
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ExtendedInformationType%22%20%2f%3e%20%3d%3d%20%22Opens%20in%20a%20Pop%2dUp%20Window%22">
    <a href="<actinic:variable name=ExtendedInfoPageEncoded />" target="ActPopup" onclick="return ShowPopUp('<actinic:variable name=ExtendedInfoPageEncoded />',<actinic:variable name="ExtInfoWindowWidth" />,<actinic:variable name="ExtInfoWindowHeight" />);">
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ExtendedInformationType%22%20%2f%3e%20%3d%3d%20%22Opens%20in%20the%20Same%20Window%22" >
    <a href="<actinic:variable name="ExtendedInfoPageName" />">
    </actinic:block>
    </actinic:block>
    
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Section%22%29%20AND%20%28%3cactinic%3avariable%20name%3d%22ProductListImageLink%22%20%2f%3e%20%3d%3d%201%29" ><a href="<actinic:variable name="ProductPageName" />#SID=<actinic:variable name="SectionID" />">
    </actinic:block>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e">
    
    <img src=<actinic:block php="true">echo "\"$plgfile\" data-src=\"$plgfile\" alt=\"$altname\" title=\"$altname\" width=\"$plgwidth\" height=\"$plgheight\"";</actinic:block>
    id="im-<Actinic:Variable Name="EncodedProductAnchor" />"
    class="d-none d-lg-block" />
    <img src=<actinic:block php="true">echo "\"$pmdfile\" data-src=\"$pmdfile\" alt=\"$altname\" title=\"$altname\" width=\"$pmdwidth\" height=\"$pmdheight\"";</actinic:block>
    id="im-<Actinic:Variable Name="EncodedProductAnchor" />"
    class="d-none d-md-block d-lg-none" />
    <img src=<actinic:block php="true">echo "\"$psmfile\" data-src=\"$psmfile\" alt=\"$altname\" title=\"$altname\" width=\"$psmwidth\" height=\"$psmheight\"";</actinic:block>
    id="im-<Actinic:Variable Name="EncodedProductAnchor" />"
    class="d-none d-sm-block d-md-none" />
    <img src=<actinic:block php="true">echo "\"$pxsfile\" data-src=\"$pxsfile\" alt=\"$altname\" title=\"$altname\" width=\"$pxswidth\" height=\"$pxsheight\"";</actinic:block>
    id="im-<Actinic:Variable Name="EncodedProductAnchor" />"
    class="d-block d-sm-none" />
    </actinic:block>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e%20%3d%3d%20False">
    <img src="<actinic:variable name="DefaultProductImage" />"
    border="0"
    title="<actinic:variable name="ProductName" encoding="strip"/>"
    alt="<actinic:variable name="ProductName" encoding="strip"/>" />
    </actinic:block>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpDisplayedByImage%22%20%2f%3e%20OR%0d%28%28%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Section%22%29%20AND%20%0d%28%3cactinic%3avariable%20name%3d%22ProductListImageLink%22%20%2f%3e%20%3d%3d%201%29%29" >
    </a>
    </actinic:block>
    </div>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e">
    <actinic:variable name="PinterestButtonLayout" value="Product Pin It Button Layout" />
    </actinic:block>
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk
Working...
X