Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default zen_image vs zen_image_OLD

    I have a few questions about the zen_image_OLD function, which was created many years ago when replaced by the zen_image function.

    The zen_image_OLD function only exists in \includes\functions\html_output.php, while the zen_image function exists in both \admin\includes\functions\html_output.php and \includes\functions\html_output.php.

    1. Is zen_image_OLD likely to become obsolete any time soon?

    2. Now I have been using code similar to the following ever since static html days and in certain non-admin zencart pages to automatically reduce the size of a large image to fit within its div, whilst maintaining the proportions of that image.

    This code works as intended using the zen_image_OLD function, but when the zen_image function is used, a large image is fitted to its enclosing div but loses its proportionality.

    Code:
    <div class="event_image_outer">
      <div class="event_image_inner">
         <!-- Note: closing ' />' for <img> is located in function zen_image -->
         <img class="c1" <?php echo zen_image(DIR_WS_IMAGES .'events_images/' . $event_array['image'], '', '', 'hspace="0" vspace="0"');?>
      </div>
      <div class="clearLeft"> </div>
    </div>
    CSS for the above code:
    Code:
    .event_image_outer {width:100%; margin:2em auto;}
    .event_image_inner {width:98%; margin:0.5em auto; text-align:center;}
    img.c1 {max-width:100%; margin:0em auto;}
    I would greatly appreciate if someone could explain, or provide a solution for, why the above code does not work properly with the zen_image function.


    3. Upon comparing the zen_image (and other) functions in \admin\includes\functions\html_output.php with \includes\functions\html_output.php, I notice some functions end thereabouts without a forward slash:
    Code:
    $image .= ' >';  (or $whatever .= ' >';)
    while the same functions in the includes file end thereabouts with a forward slash:
    Code:
    $image .= ' />';  (or $whatever .= ' />';)
    Is there a reason why the admin functions do not have the closing slash (ie '/>') ?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: zen_image vs zen_image_OLD

    zen_image_OLD is used for template images, language files and for when the setting in Configurations ... Images ... is set to 0 for:
    Image - Use Proportional Images on Products and Categories
    Use Proportional Images on Products and Categories?

    NOTE: Do not use 0 height or width settings for Proportion Images
    0= off 1= on
    as to the closing slash the Admin has not been cleaned up as much as the Catalog ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: zen_image vs zen_image_OLD

    Hi Ajeh

    Since I need Proportion Images = 1, I changed zen_image to zen_image_OLD, and it is working as desired.

    Thanks

 

 

Similar Threads

  1. v153 zen_image() and online documentation
    By jerrygarciuh in forum Basic Configuration
    Replies: 1
    Last Post: 30 Jul 2014, 11:09 PM
  2. zen_image align
    By Kansai_mike in forum Basic Configuration
    Replies: 2
    Last Post: 10 Mar 2007, 10:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR