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
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:
Quote:
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 ...
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