Quote Originally Posted by DrByte View Post
tpl_modules_main_image.php
Code:
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
<div id="productMainImage" class="centeredContent back">

<?php if (strstr($products_image_large, 'large/')) { ?>

<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
<noscript>
<?php
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
</noscript>

<?php } else {
         echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); 
      } 
?>

</div>
Thanks again, Dr. Byte! This PHP script worked perfectly.

I see that FIRST of all, I had no else statement, so even if I was otherwise correct, only half the desired result would obtain.

But additionally, Dr. Byte also didn't check for the file itself, but rather a string.

Can anyone simpy tell me..is the 'products_image_large' string the name of the file Zen Cart designates as the 'large image' that will display if the popup feature is on? In other words, does $products_image_large sometimes contain the name of a file that is NOT a large file, but just the base image file in /IMAGES/ which is then handled as such by zencart?

I notice that without 'popups disabled if no large photo' and no large photo is present, ZC will display a smaller image.

I am trying to understand this, Im new to PHP....



I understand that the IF (strstr statement is checking the $products_image_large string.....is it checking to see if the 'large/' subdir is part of the string? (as Im guerssing it would be if a large photo is present)

I am trying to understand this all a bit better....thanks in advance!!!!!!!!!