Zen Cart Logo
Forums / All Other Contributions/Addons / Image Handler 2 (for ZC v1.3.8 ONLY) Support

Image Handler 2 (for ZC v1.3.8 ONLY) Support

Views: 2,510,726

Results 6,221 to 6,240 of 7,094
6 Jan 2011, 6:00 PM
#6221
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Image Handler 2 (for ZC v1.3.8 ONLY) Support

finlander:

I have had to always install (re-install) lightbox over the top of IH whenever I had to re-install or upgrade IH (mainly because lightbox needs to overwrite one of the Additional Images files.

There could be other mods that also need need similar treatment after IH is installed.This is an incorrect approach.. You should NOT be overwriting these files at all.. Instead using a file merging program (like Winmerge or Beyond Compare) you need to merge BOTH the required lightbox code along with the required IH2 code for any files they share in common.. Otherwise you WILL replace required IH2 code when installing your lightbox and vice versa..

Maybe one day when I have time (and that ain't today:laugh:) I will post the correct code needed for lightbox/IH2 integration since this seems to be the one mistake made most often by shopowners when trying to install Zen Lightbox or Fual Slimbox with IH2..

6 Jan 2011, 6:03 PM
#6222
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

dbltoe:

The mods are probably not your problem. Nor is IH2.

My vote would go for the Template Monster template doing something to a file that is not normally messed with by Zen or any Mod.

Check your TM template to see if any of the files are common to any of the IH2 files. If so, you will need to VERY carefully merge them to make IH2 work.

Or you could contact TM and see what help you get for your money spent:censored:

On a 12mb connection, your site took 27 seconds to load and the first page has double anchors, open img elements, and empty p tags. Gotta love that TM -- NOTThis was my thought as well.. This is why I've never been a fan of TM.. Their motto seems to be "style over substance", and that's NOT a good thing..

Most of their template code is so badly hacked that it creates NOTHING but issues with other mods..

6 Jan 2011, 6:16 PM
#6223
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,767
Plugin Contributions:
9

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

My bad... I missed the lightbox. I always prefer Fual Slimbox with IH2.

However, I still vote for TM as the culprit.

6 Jan 2011, 6:50 PM
#6224
finlander avatar

finlander

Zen Follower

Join Date:
Oct 2010
Location:
Idaho
Posts:
293
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

DivaVocals:

This is an incorrect approach.. You should NOT be overwriting these files at all.. Instead using a file merging program (like Winmerge or Beyond Compare) you need to merge BOTH the required lightbox code along with the required IH2 code for any files they share in common.. Otherwise you WILL replace required IH2 code when installing your lightbox and vice versa..

A pure merge (all data from both the IH and the LB additional_images.php files, merged/incorporated into one file) would cause problems. That's why the LB box code uses the 'handle_image' IF statements to defer to the IH code where needed. There would be inconsistencies in the resulting code if it were a pure merge, with the IH code saying to do one thing and the LB code saying to do something else, in the same spot.

The LB overwrite of the IH additional_images.php file seems to work perfect on my install.

6 Jan 2011, 7:33 PM
#6225
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

finlander:

A pure merge (all data from both the IH and the LB additional_images.php files, merged/incorporated into one file) would cause problems. That's why the LB box code uses the 'handle_image' IF statements to defer to the IH code where needed. There would be inconsistencies in the resulting code if it were a pure merge, with the IH code saying to do one thing and the LB code saying to do something else, in the same spot.

The LB overwrite of the IH additional_images.php file seems to work perfect on my install.
But it's not a pure merge.. Not even for Fual Slimbox.. There are simply parts of the code that need to be modified for the lightbox, and parts which needs to be merged for IH2.. I'm glad it's working for you, but from what I remember, your suggested approach is the most common reason why most folks have trouble getting both to work together.. Perhaps the writers of Zen Lightbox have already incorporated IH2 code, but the last time I looked they had not and it still required a file merge of some sort to get both to work together..

One of these days when I get some time I'm gonna update the IH2 fileset to include the properly modified files needed for both Fual Slimbox and Zen Lightbox.. This should effectively out an end to the issues and questions surrounding how to merge IH2 with these two popular lightbox contribs..

6 Jan 2011, 7:36 PM
#6226
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

dbltoe:

My bad... I missed the lightbox. I always prefer Fual Slimbox with IH2.

However, I still vote for TM as the culprit.** nods in agreement with all of this **

7 Jan 2011, 1:08 PM
#6227
zippers avatar

zippers

New Zenner

Join Date:
Jan 2011
Posts:
5
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Hey all,

I tried looking for a solution but nothing came up so here i go.

I just installed the image handler and that all went fine.

When i add a new product everything goes fine and the 3 images appear under the manager in the image handler admin, but when i go to the actuall product info page all i get is a white box that says "larger image" (this should be the product image anyway which isn't showing) and then when i click on the larger image it says it can't be found.

After closer inspection it is looking for pictures in /images/medium/picture_MED.JPG in the smaller one and for the larger one in /images/large/picture_LRG.JPG

Am i missing something here? I hope someone can help me out :)

7 Jan 2011, 2:18 PM
#6228
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Zippers:

Hey all,

I tried looking for a solution but nothing came up so here i go.

I just installed the image handler and that all went fine.

When i add a new product everything goes fine and the 3 images appear under the manager in the image handler admin, but when i go to the actuall product info page all i get is a white box that says "larger image" (this should be the product image anyway which isn't showing) and then when i click on the larger image it says it can't be found.

After closer inspection it is looking for pictures in /images/medium/picture_MED.JPG in the smaller one and for the larger one in /images/large/picture_LRG.JPG

Am i missing something here? I hope someone can help me out :)
We need the USUAL compliment of information that we always ask for here..

  • Link to your site (specifically links DIRECTLY to the products which work correctly AND links to the ones that don't -- please don't ask folks to fish through your site looking for the issue)
  • What are your image settings??
    Providing this when you posts helps cut down on back and forth guess sessions.. Much better if you provide FULL information up front.. Thanks:wink2:
7 Jan 2011, 2:28 PM
#6229
zippers avatar

zippers

New Zenner

Join Date:
Jan 2011
Posts:
5
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Sorry about that! Won't happen again :)

The link http://www.athometextiles.com/index.php?main_page=product_info&cPath=79_80&products_id=939

And it's only slightly different on older products (the large image will show when clicked on but not the medium one on the info page)

example of an older product http://www.athometextiles.com/index.php?main_page=product_info&cPath=100&products_id=262

Image settings: even though i already tried putting the small one the same as all that were needed as was said in a tutorial.

Small Image Width 60
Small Image Height 60
Heading Image Width - Admin 57
Heading Image Height - Admin 40
Subcategory Image Width 60
Subcategory Image Height 60
Calculate Image Size true
Image Required true
Image - Shopping Cart Status 1
Image - Shopping Cart Width 180
Image - Shopping Cart Height 180
Category Icon Image Width - Product Info Pages 0
Category Icon Image Height - Product Info Pages 0
Top Subcategory Image Width 0
Top Subcategory Image Height 0
Product Info - Image Width 180
Product Info - Image Height 180 Info
Product Info - Image Medium Suffix _MED
Product Info - Image Large Suffix _LRG
Product Info - Number of Additional Images per Row 5
Image - Product Listing Width 120
Image - Product Listing Height 120
Image - Product New Listing Width 120
Image - Product New Listing Height 120
Image - New Products Width 120
Image - New Products Height 120
Image - Featured Products Width 180
Image - Featured Products Height 180
Image - Product All Listing Width 120
Image - Product All Listing Height 120
Product Image - No Image Status 1
Product Image - No Image picture no_picture.gif
Image - Use Proportional Images on Products and Categories 0
IH resize images yes
IH small image filetype no_change
IH small image background 255:255:255
IH watermark small images no
IH zoom small images yes
IH small image compression quality 85
IH medium image filetype no_change
IH medium image background 255:255:255
IH watermark medium images no
IH medium image compression quality 85
IH large image filetype no_change
IH large image background 255:255:255
IH watermark large images no
IH large image compression quality 85
IH large image maximum width 750
IH large image maximum height 550
IH watermark gravity Center

Hope this is better :)

7 Jan 2011, 2:45 PM
#6230
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

I'd check that you correctly merged the files in includes/modules/YOUR_TEMPLATE with your template files.. Looks like the required IH2 code may be missing.. Also given that this is a Template Monster (or one of their affliates) templates, they are know to incorrectly hack Zen Cart code to make their designs work.. It's possible that they have modified their template code using one of their typical non-standard methods which is causing a problem.. Once IH2 is managing your images, they will pull them from the bmz_cache folder not the paths you posted.. Your images are not doing this which is an indication that there is important IH2 code which is missing or being ignored/overwritten by something in your template..

Zippers:

Sorry about that! Won't happen again :)

The link http://www.athometextiles.com/index.php?main_page=product_info&cPath=79_80&products_id=939

And it's only slightly different on older products (the large image will show when clicked on but not the medium one on the info page)

example of an older product http://www.athometextiles.com/index.php?main_page=product_info&cPath=100&products_id=262

Image settings: even though i already tried putting the small one the same as all that were needed as was said in a tutorial.

Small Image Width 60
Small Image Height 60
Heading Image Width - Admin 57
Heading Image Height - Admin 40
Subcategory Image Width 60
Subcategory Image Height 60
Calculate Image Size true
Image Required true
Image - Shopping Cart Status 1
Image - Shopping Cart Width 180
Image - Shopping Cart Height 180
Category Icon Image Width - Product Info Pages 0
Category Icon Image Height - Product Info Pages 0
Top Subcategory Image Width 0
Top Subcategory Image Height 0
Product Info - Image Width 180
Product Info - Image Height 180 Info
Product Info - Image Medium Suffix _MED
Product Info - Image Large Suffix _LRG
Product Info - Number of Additional Images per Row 5
Image - Product Listing Width 120
Image - Product Listing Height 120
Image - Product New Listing Width 120
Image - Product New Listing Height 120
Image - New Products Width 120
Image - New Products Height 120
Image - Featured Products Width 180
Image - Featured Products Height 180
Image - Product All Listing Width 120
Image - Product All Listing Height 120
Product Image - No Image Status 1
Product Image - No Image picture no_picture.gif
Image - Use Proportional Images on Products and Categories 0
IH resize images yes
IH small image filetype no_change
IH small image background 255:255:255
IH watermark small images no
IH zoom small images yes
IH small image compression quality 85
IH medium image filetype no_change
IH medium image background 255:255:255
IH watermark medium images no
IH medium image compression quality 85
IH large image filetype no_change
IH large image background 255:255:255
IH watermark large images no
IH large image compression quality 85
IH large image maximum width 750
IH large image maximum height 550
IH watermark gravity Center

Hope this is better :)

7 Jan 2011, 2:57 PM
#6231
zippers avatar

zippers

New Zenner

Join Date:
Jan 2011
Posts:
5
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

It is a unique template indeed, but not from template monster or anything.

That's quite a shame cause from what i can see all it is apparantly doing is getting the image urls wrong.

7 Jan 2011, 3:22 PM
#6232
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Zippers:

It is a unique template indeed, but not from template monster or anything.

That's quite a shame cause from what i can see all it is apparantly doing is getting the image urls wrong.Wherever this template is from, the IH2 code which drives the main product image and the large image popup is clearly not there or has been merged in with your existing templates files in a way that prevents the images from being displayed.. The images clearly are not being pulled from the bmz_cache folder as they should..

<img src="images/medium/Chillax - Multi_MED.JPG" alt="Chillax single duvet/quilt cover and pillow case" title=" Chillax single duvet/quilt cover and pillow case " width="180" height="180" />

Suggest going over your entire install again and pay special attention to the files I mentioned earlier.. Also do you have any other image mods which might be in conflict??

7 Jan 2011, 3:37 PM
#6233
zippers avatar

zippers

New Zenner

Join Date:
Jan 2011
Posts:
5
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Oh my god this is so frustrating.

Yeah i just went over the install again and made sure everything is in. I had a quick look on some template files but couldn't find anything.

No other mods are installed for this zen cart. So there has to be an alteration somewhere.

7 Jan 2011, 3:50 PM
#6234
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Zippers:

Oh my god this is so frustrating.

Yeah i just went over the install again and made sure everything is in. I had a quick look on some template files but couldn't find anything.

No other mods are installed for this zen cart. So there has to be an alteration somewhere.
and without seeing what you see it's equally frustrating on this end too..:smile:

Can you try posting what your IH2 module files look like (the files I referenced earlier.. Please make sure you enclose the code using the code tags (otherwise it's a NIGHTMARE to read here, and the forum software alters code if not properly enclosed in code tags)

Also just checking you did rename all the YOUR_TEMPLATE folders to match the name of your template's folder when you installed IH2 right???

7 Jan 2011, 4:04 PM
#6235
zippers avatar

zippers

New Zenner

Join Date:
Jan 2011
Posts:
5
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Yeah i can understand that :) You can always just pm me and i'll give you a login to check though haha :P

Either way i'm guessing you mean the 2 files that come with the modules and then my template folder (and yes i did change the name :P )

addicitional_images.php

<?php
/**
 * additional_images module
 *
 * Prepares list of additional product images to be displayed in template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: additional_images.php 16913 2010-07-16 03:38:06Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
$images_array = array();

// do not check for additional images when turned off
if ($products_image != '' && $flag_show_product_info_additional_images != 0) {
  // prepare image name
  $products_image_extension = substr($products_image, strrpos($products_image, '.'));
  $products_image_base = str_replace($products_image_extension, '', $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 = str_replace($products_image_extension, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
  }

  $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
  if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
  } else {
    $products_image_directory = DIR_WS_IMAGES;
  }

  // Check for additional matching images
  $file_extension = $products_image_extension;
  $products_image_match_array = array();
  if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
      if (!is_dir($products_image_directory . $file)) {
        if (substr($file, strrpos($file, '.')) == $file_extension) {
          if(preg_match("/" . $products_image_base . "/i", $file) == '1') {
            if ($file != $products_image) {
              if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
                //echo 'I AM A MATCH ' . $file . '<br />';
                $images_array[] = $file;
              } else {
                //  echo 'I AM NOT A MATCH ' . $file . '<br />';
              }
            }
          }
        }
      }
    }
    if (sizeof($images_array)) {
      sort($images_array);
    }
    $dir->close();
  }
}

// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';

if ($num_images) {
  $row = 0;
  $col = 0;
  if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    $col_width = floor(100/$num_images);
  } else {
    $col_width = floor(100/IMAGES_AUTO_ADDED);
  }

  for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
//  Begin Image Handler changes 1 of 2
//  $flag_has_large = file_exists($products_image_large);
    $flag_has_large = true;//file_exists($products_image_large);
//  End Image Handler changes 1 of 2
    $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
    $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
    $base_image = $products_image_directory . $file;
    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
//  Begin Image Handler changes 2 of 2 remove additional single quotes from image attributes (important!)
    $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
//  End Image Handler changes 2 of 2
    $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);

    // Link Preparation:
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

    $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

    //      $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

    $link = $script_link . "\n      " . $noscript_link;
    //      $link = $alternate_link;

    // List Box array generation:
    $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => "\n      " . $link);
    $col ++;
    if ($col > (IMAGES_AUTO_ADDED -1)) {
      $col = 0;
      $row ++;
    }
  } // end for loop
} // endif

main_product_image.php

<?php
/**
 * main_product_image module
 *
 * @package templateSystem
 * @copyright Copyright 2005-2006 Tim Kroeger
 * @copyright Portions Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: main_product_image.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
 * Last modified by DerManoMann 2010-05-31 23:41:53
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = preg_replace('/'.$products_image_extension . '$/', '', $products_image);
$products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
$products_image_large  = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE .  $products_image_extension;

  /*
    echo
    'Base ' . $products_image_base . ' - ' . $products_image_extension . '<br>' .
    'Medium ' . $products_image_medium . '<br><br>' .
    'Large ' . $products_image_large . '<br><br>';
  */
// to be built into a single variable string
7 Jan 2011, 5:04 PM
#6236
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Zippers:

Yeah i can understand that :) You can always just pm me and i'll give you a login to check though haha :P

:laugh:

Wish I could, but no can do..:no: Got a BUSY weekend of paid work coming up.. (actually it's started now..) Site launch, begin new site build, site updates for clients, and OVERTIME work for my regular day job to boot.. Gonna be a LONG weekend for moi..:yes:

Zippers:

Either way i'm guessing you mean the 2 files that come with the modules and then my template folder (and yes i did change the name :P )

addicitional_images.php

<?php /** * additional_images module * * Prepares list of additional product images to be displayed in template * * @package templateSystem * @copyright Copyright 2003-2010 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: additional_images.php 16913 2010-07-16 03:38:06Z ajeh $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes'); $images_array = array(); // do not check for additional images when turned off if ($products_image != '' && $flag_show_product_info_additional_images != 0) { // prepare image name $products_image_extension = substr($products_image, strrpos($products_image, '.')); $products_image_base = str_replace($products_image_extension, '', $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 = str_replace($products_image_extension, '', $products_image_match) . '_'; $products_image_base = $products_image_match; } $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/'))); if ($products_image_directory != '') { $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/"; } else { $products_image_directory = DIR_WS_IMAGES; } // Check for additional matching images $file_extension = $products_image_extension; $products_image_match_array = array(); if ($dir = @dir($products_image_directory)) { while ($file = $dir->read()) { if (!is_dir($products_image_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { if(preg_match("/" . $products_image_base . "/i", $file) == '1') { if ($file != $products_image) { if ($products_image_base . str_replace($products_image_base, '', $file) == $file) { //echo 'I AM A MATCH ' . $file . '<br />'; $images_array[] = $file; } else { // echo 'I AM NOT A MATCH ' . $file . '<br />'; } } } } } } if (sizeof($images_array)) { sort($images_array); } $dir->close(); } } // Build output based on images found $num_images = sizeof($images_array); $list_box_contents = ''; $title = ''; if ($num_images) { $row = 0; $col = 0; if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) { $col_width = floor(100/$num_images); } else { $col_width = floor(100/IMAGES_AUTO_ADDED); } for ($i=0, $n=$num_images; $i<$n; $i++) { $file = $images_array[$i]; $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension; // Begin Image Handler changes 1 of 2 // $flag_has_large = file_exists($products_image_large); $flag_has_large = true;//file_exists($products_image_large); // End Image Handler changes 1 of 2 $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file); $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large); $base_image = $products_image_directory . $file; $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); // Begin Image Handler changes 2 of 2 remove additional single quotes from image attributes (important!) $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes); // End Image Handler changes 2 of 2 $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large); // Link Preparation: $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>'; $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>'; // $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; $link = $script_link . "\n " . $noscript_link; // $link = $alternate_link; // List Box array generation: $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => "\n " . $link); $col ++; if ($col > (IMAGES_AUTO_ADDED -1)) { $col = 0; $row ++; } } // end for loop } // endif ```main_product_image.php > > ``` <?php /** * main_product_image module * * @package templateSystem * @copyright Copyright 2005-2006 Tim Kroeger * @copyright Portions Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: main_product_image.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $ * Last modified by DerManoMann 2010-05-31 23:41:53 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $products_image_extension = substr($products_image, strrpos($products_image, '.')); $products_image_base = preg_replace('/'.$products_image_extension . '$/', '', $products_image); $products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extension; $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension; /* echo 'Base ' . $products_image_base . ' - ' . $products_image_extension . '<br>' . 'Medium ' . $products_image_medium . '<br><br>' . 'Large ' . $products_image_large . '<br><br>'; */ // to be built into a single variable string ``` I don't see anything out of the ordinary, but that that doesn't mean that something is not amiss.. I can't help but wonder if your template is a contributory factor.. Again without seeing the template files, it's hard to guess what might be the source of the issue..:frusty: Hopefully someone else can chime in here..
9 Jan 2011, 5:50 PM
#6237
stmonk avatar

stmonk

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

I have a problem with the image urls

If i try to use the image handler manager, the picture thumbnails won't work. The url looks like below, they are missing the / after bmz_cache and e

localhost/bmz_cachebbb4f0d7b85341cdd3b06a9156dbae30c.image.80x60.jpg[/url]

this should be

localhost/bmz_cache/b/bb4f0d7b85341cdd3b06a9156dbae30c.image.80x60.jpg[/url]

I have tried to delete the image handler files and replace them and uninstall the database using the image handler admin page. No luck so far.

Im using zencart v1.3.9d and image handler 2.0 Rev 8d

9 Jan 2011, 6:24 PM
#6238
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Not an issue with IH2 at all.. My guess is that your Zen Cart configure.php is not setup correctly and is missing a required "/" somewhere..

stmonk:

I have a problem with the image urls

If i try to use the image handler manager, the picture thumbnails won't work. The url looks like below, they are missing the / after bmz_cache and e

localhost/bmz_cachebbb4f0d7b85341cdd3b06a9156dbae30c.image.80x60.jpg[/url]

this should be

localhost/bmz_cache/b/bb4f0d7b85341cdd3b06a9156dbae30c.image.80x60.jpg[/url]

I have tried to delete the image handler files and replace them and uninstall the database using the image handler admin page. No luck so far.

Im using zencart v1.3.9d and image handler 2.0 Rev 8d

9 Jan 2011, 7:41 PM
#6239
stmonk avatar

stmonk

New Zenner

Join Date:
Jan 2011
Posts:
7
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Hmm, everything else seems to work fine, except the images that point to bmz-cache folder. I checked the configure files and I havent noticed anything wrong in there.

9 Jan 2011, 7:53 PM
#6240
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

stmonk:

Hmm, everything else seems to work fine, except the images that point to bmz-cache folder. I checked the configure files and I havent noticed anything wrong in there.
The images are supposed to point to the bmz_cache folder.. The missing / after bmz_cache is likely due to a missing slash in your configure.php file.. This isn't anything that IH2 would remove or alter..

and as always when posting issues in this support thread..

We need the USUAL compliment of information that we always ask for here..

  • Link to your site (specifically links DIRECTLY to the products which work correctly AND links to the ones that don't -- please don't ask folks to fish through your site looking for the issue)
  • What are your image settings??
    Providing this when you post helps cut down on back and forth guess sessions.. Much better if you provide FULL information up front.. Thanks:wink2:

However, that said you need to re-check your configure.php file.. I'm pretty sure that you will find that you are indeed missing a / somewhere in there..