Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Additional Product Images Not Displaying

Additional Product Images Not Displaying

Locked

Views: 1,583

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
4 Aug 2006, 3:02 PM
#1
wildcat82 avatar

wildcat82

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

Additional Product Images Not Displaying

Hello,

Could some please tell me why my additional product image in not displaying here:

Problem

There's an empty box under the description that should have the additional images in it. The main product image name is :

AnoFrame%20SwivelMount.jpg

And the additional product image name uploaded is:

AnoFrame%20SwivelMountaaa.jpg

Thanks!

EDITED: Never, ever post the zen_id or zenAdminID (session id) in a forum, email, newsgroup, newsletter, advertisement, etc. etc. etc. or you will be doomed ... :eek:

4 Aug 2006, 3:04 PM
#2
wildcat82 avatar

wildcat82

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

Re: Additional Product Images Not Displaying

By the way this is my code for main_template_vars_images_additional.php:

<?php if ($products_image != '') { // prepare image name $products_image_extention = substr($products_image, strrpos($products_image, '.')); $products_image_base = ereg_replace($products_image_extention . '$', '', $products_image); // if in a subdirectory if (strrpos($products_image, '/')) { $products_image_match = substr($products_image, strrpos($products_image, '/')+1); //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' - base ' . $products_image_base . '<br>'; $products_image_match = ereg_replace($products_image_extention, '', $products_image_match) . '_'; $products_image_base = $products_image_match; } $products_image_directory = ereg_replace($products_image, '', substr($products_image, strrpos($products_image, '/'))); if ($products_image_directory != '') { $products_image_directory = DIR_WS_IMAGES . ereg_replace($products_image_directory, '', $products_image) . "/"; } else { $products_image_directory = DIR_WS_IMAGES; } // Check for additional matching images $file_extension = $products_image_extention; $products_image_match_array = array(); if ($dir = @dir($products_image_directory)) { while ($file = $dir->read()) { if (!is_dir($products_image_directory . $file)) { if(preg_match("/" . $products_image_base . "/i", $file) == '1') { if (substr($file, 0, strrpos($file, '.')) != substr($products_image, 0, strrpos($products_image, '.'))) { if ($products_image_base . ereg_replace('^' . $products_image_base, '', $file) == $file) { $products_image_match_array[] = $file; // echo 'I AM A MATCH ' . $file . '<br>'; } else { // echo 'I AM NOT A MATCH ' . $file . '<br>'; } } } } } if (sizeof($products_image_match_array)) { sort($products_image_match_array); } $dir->close(); } if (sizeof($products_image_match_array)) { echo ' <tr>'; echo ' <td colspan="2" align="center" valign="top" class="plainBox">'; echo '<table align="center">'; echo "\n\n" . '<tr>'; $new_images_cnt = 0; for ($i = 0, $n = sizeof($products_image_match_array); $i < $n; $i++) { if ($new_images_cnt >= IMAGES_AUTO_ADDED) { echo '<tr>'; $new_images_cnt = 0; } $new_images_cnt ++; $file = $products_image_match_array[$i]; $image_base = ereg_replace('^' . DIR_WS_IMAGES, '', $products_image_directory) . ereg_replace($products_image_extention . '$', '', $file); $products_image_additional = DIR_WS_IMAGES . $image_base . $products_image_extention; $products_image_large_additional = DIR_WS_IMAGES . 'large/' . $image_base . IMAGE_SUFFIX_LARGE . $products_image_extention; //echo 'WHO AM I ' . $products_image_large_additional . ' vs ' . $products_image_large_additional; ?> <td align="center" class="smallText"> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo (file_exists($products_image_large_additional) ? '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large_additional) . '\\\')">' . zen_image($products_image_additional, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : zen_image($products_image_additional, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"')); ?>'); //--></script> <noscript> <?php //$products_image_large_additional = $products_image_base . IMAGE_SUFFIX_LARGE . $file_extension; if (file_exists($products_image_large_additional)) { echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large_additional) . '" target="_blank">' . zen_image($products_image_additional, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; } else { echo zen_image($products_image_additional, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />'; } ?> </noscript> </td> <?php if ($new_images_cnt >= IMAGES_AUTO_ADDED or $i == ($n-1)) { echo '</tr>' . "\n\n"; } } echo '</table>'; echo ' </td>'; echo ' </tr>'; } } ?>
4 Aug 2006, 6:07 PM
#3
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Location:
Lake Havasu, AZ
Posts:
1,090
Plugin Contributions:
0

Re: Additional Product Images Not Displaying

In order for the additional images to work they have to be named the same and then numbered... you state that you have your images named :

AnoFrame%20SwivelMount.jpg

And the additional product image name uploaded is:

AnoFrame%20SwivelMountaaa.jpg

Zen doesn't see those as the same name because of the aaa at the end

In order for this particular image to have additional images you would want to name your images as :

AnoFrame%20SwivelMount.jpg
AnoFrame%20SwivelMount_01.jpg
AnoFrame%20SwivelMount_02.jpg

etc.

I hope that helps:yes:

4 Aug 2006, 6:16 PM
#4
wildcat82 avatar

wildcat82

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

Re: Additional Product Images Not Displaying

I just renamed my file to :

AnoFrame%20SwivelMount_01.jpg

But I still get the same blank result

4 Aug 2006, 6:53 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Additional Product Images Not Displaying

When I view source for products_id 185 I am seeing the smaill image as:

344c37d8a8309d4619905f3bc0a15c77.image.100x117.jpg

Is something running to change the image names that would have all the extra periods in the name?

This is confusing the images layout from the looks of things ...

What happens if you name the group of images more conventionally with a

basefilename.jpg

Then name the additional images to match the group in the standard manner?

basefilename_01.jpg
basefilename_02.jpg
basefilename_03.jpg

4 Aug 2006, 7:03 PM
#6
wildcat82 avatar

wildcat82

New Zenner

Join Date:
Aug 2006
Posts:
4
Plugin Contributions:
0

Re: Additional Product Images Not Displaying

No luck....when I removed

AnoFrame%20SwivelMount_01.jpg

from the ftp server, the box below the description disappears...so i know that zencart knows that there's another picture that exists but for some reason it still isn't showing.

5 Aug 2006, 2:17 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Additional Product Images Not Displaying

Sounds like you may need to clear your cache in the Image Handler...