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,399

Results 5,741 to 5,760 of 7,094
9 Sep 2010, 8:02 PM
#5741
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

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

Oh, yea......I forgot to give ZC & IH versions on this little 'bug'.

Zen-Cart version: 1.3.9d
Image Handler version: 2.0 Rev 8b

9 Sep 2010, 9:11 PM
#5742
jeffey avatar

jeffey

Zen Follower

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

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

1.38a with Zen lightbox too.

Finally got around to installing this and wish I had sooner.

Working just great but in Admin I don't see all the options. In particular the image hotzone & hotzone gravity controls but also the image filetypes.

Here's what I see with 2.0 Rev 8b :
IH resize images
IH small image filetype
IH small image background
IH watermark small images
IH zoom small images
IH small image compression quality
IH medium image filetype
IH medium image background
IH watermark medium images
IH medium image compression quality
IH large image filetype
IH large image background
IH watermark large images
IH large image compression quality
IH large image maximum width
IH large image maximum height
IH watermark gravity

I've checked the files again and everything seems to uploaded. Have it on two sites with same Admin issue.

Not a super big deal as things are working including the default zoom on small images but I would like to have the controls and maybe tweak them. I don't see the mentioned overlay which is good but thought I should mention that too.

9 Sep 2010, 10:31 PM
#5743
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

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

Jeffey:

1.38a with Zen lightbox too.

Finally got around to installing this and wish I had sooner.

Working just great but in Admin I don't see all the options. In particular the image hotzone & hotzone gravity controls but also the image filetypes.

Here's what I see with 2.0 Rev 8b :
IH resize images
IH small image filetype
IH small image background
IH watermark small images
IH zoom small images
IH small image compression quality
IH medium image filetype
IH medium image background
IH watermark medium images
IH medium image compression quality
IH large image filetype
IH large image background
IH watermark large images
IH large image compression quality
IH large image maximum width
IH large image maximum height
IH watermark gravity

I've checked the files again and everything seems to uploaded. Have it on two sites with same Admin issue.

Not a super big deal as things are working including the default zoom on small images but I would like to have the controls and maybe tweak them. I don't see the mentioned overlay which is good but thought I should mention that too.

Hotzone was removed, it should be in your readme, not sure what you mean by "overlay" do you mean the watermarking?

10 Sep 2010, 12:08 AM
#5744
jeffey avatar

jeffey

Zen Follower

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

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

Duh! Sorry, though I read it and lots of stuff here I must have missed the change section and made assumptions based on other postings.

I thought you could modify/switch the hoover which started the whole question. It's fine as is.

Teaches me for adding on a whim at 5am! :shocking:

Thanks for the quick response, sounds like all is well with my setup.

10 Sep 2010, 2:02 AM
#5745
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

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

Get Em Fast:

Oh, yea......I forgot to give ZC & IH versions on this little 'bug'.

Zen-Cart version: 1.3.9d
Image Handler version: 2.0 Rev 8b

Are you sure you are using IH r8b, as just from checking you have the javascript from version IH 7, not that that should make a difference to your problem, have you tested just the base install of image handler without lightbox added, as the code seems to be a shade odd

10 Sep 2010, 2:10 AM
#5746
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

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

Nope it seems to be happening to me to

http://nigel.geek.nz/sbo_shop/index.php?main_page=product_info&cPath=863&products_id=4285

There is a known bug with additional images, although as i don't use extra images i haven't paid much attention to it

was mentioned around 40 - 50 posts back

http://www.zen-cart.com/forum/showpost.php?p=924596&postcount=5705

10 Sep 2010, 5:22 AM
#5747
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

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

nigelt, Oops........you were right about one thing......the IH version. I installed this a couple of months ago on this site, and didn't realize it was updated since then.......my bad! I've been soooo busy lately...........I have since updated IH on this site, but yea......it's still doing the same thing.

It's not really a 'biggie' with this particular client, as he says. But, I still think it's a bug that needs 'squashed' because one of these days a client's going to say...."you say you guarantee 100% satisfaction, yet I can't even put an apostrophe in my product names and have them hover!?".....you know what I mean?

Thanks for the responses, though, and I'll keep trying to help find it, too.......it's probably one of those little things like a double quote where it should be single, or a bracket where it should be a parentheses or some little thing like that, that's going to take forever to track down.....you know how that goes, too?

Thanks,
Robert

11 Sep 2010, 3:31 AM
#5748
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

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

There is a hack you can use, for some bizarre reason its the only thing i can get to work

this is a hack, there is probably a better way to do this, BUT

in this file

includes/classes/bmz_image_handler.class.php

around line 690

//escape possible quotes if they're not already escapped
$alt = preg_replace("/([^\\])'/", '$1\'', $alt);
$alt = str_replace('"', '"', $alt);
add the following directly underneath (cut and paste it), basically it replaces any single quote apostrophe with a single fancy quote
//replace apostrophe with fancy quote
$alt = str_replace("'", "‘", $alt);

as always use at your own risk, i have tested it on my site and it seems to work fine

It isn't the most elegant, however this is a weird bug, all the apostrophes in the javascript code are being escaped, but only on the additional images bit, and i can't find the cause

and before you say it, i did try changing ' to ' but it didn't work

11 Sep 2010, 5:02 PM
#5749
jabbawest avatar

jabbawest

Zen Follower

Join Date:
Oct 2009
Location:
Texas
Posts:
197
Plugin Contributions:
0

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

DivaVocals:

IF you are having issues with additional images AND you are running Rev8b (this is FIXED if you are running Rev8c) make the following MINOR change:
Find this around line 47

      if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
> ```
          if(preg_match("/" . $products_image_base . "/i", $file) == '1') {

Still using IH2 Ver2-0rev7 on ZC 1.3.8a and have been bugged by this for some time.
Looking at my additional_images.php file, it shows that I have the suggested fix, but I'm still having the additional image issue.

What is the function difference between the line that's commented out and the line that's being used?

//          if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
          if(preg_match("/" . $products_image_base . "/i", $file) == '1') {

Thanks,
Stephen

11 Sep 2010, 6:41 PM
#5750
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

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

nigelt..........Thanks for the 'quick-fix hack'. It seems to be working perfectly!

There may be a better way, but if it works.........................

13 Sep 2010, 5:31 PM
#5751
gaffettape avatar

gaffettape

Zen Follower

Join Date:
May 2009
Posts:
433
Plugin Contributions:
0

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

Just wanted to check something..

I have just installed the latest version of IH2 (Ver2 Rev8c). I also had previously installed Fual Slimbox. I have added/deleted the relevant new IH2 files and then I added the following code to roughly line #99 of the includes/modules/your_template/additional_images.php file which is included in the latest IH2 files:

  // bof Zen Lightbox v1.4 aclarke 2007-09-22
  if (ZEN_LIGHTBOX_STATUS == 'true' || FUAL_SLIMBOX == 'true') {
  
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
  
  } else {
      
    $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>';
  
  }
  // eof Zen Lightbox v1.4 aclarke 2007-09-22

So now my WHOLE includes/modules/your_template/additional_images.php file looks like this:

<?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:
  // bof Zen Lightbox v1.4 aclarke 2007-09-22
  if (ZEN_LIGHTBOX_STATUS == 'true' || FUAL_SLIMBOX == 'true') {
  
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
  
  } else {
      
    $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>';
  
  }
  // eof Zen Lightbox v1.4 aclarke 2007-09-22

    $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

Everything seems to be working fine, I just wanted to check with the experts that the above is ok :smile:

Thanks.

14 Sep 2010, 12:51 AM
#5752
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

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

Hi, I'm getting an error when i try to upload...it was working fine. Here is the error:

Error!

Unable to determine the page link!

Function used:

zen_href_link('', '', 'NONSSL')

How do I fix this? Thank you!

14 Sep 2010, 1:08 AM
#5753
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

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

joyjoy:

Hi, I'm getting an error when i try to upload...it was working fine. Here is the error:

Error!

Unable to determine the page link!

Function used:

zen_href_link('', '', 'NONSSL')

How do I fix this? Thank you!
Normally this is caused by invalid characters in your filename, things like brackets (), filenames should only contain alphanumeric characters as well as underscores and dashes

Unfortunately brackets Mean something in php code, therefore when a filename that contains brackets or other special characters, it send image handler into a spin

14 Sep 2010, 1:15 AM
#5754
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

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

Thank you for the response. I've tried to upload the pictures with renamed files that contained no special characters. Still getting the error....:frusty:

14 Sep 2010, 1:31 AM
#5755
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

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

I've figured it out, it was an image that Image Handler allowed to upload previously with "()" marks. I've deleted it out of my files, it's working well again.:smile:

16 Sep 2010, 12:03 AM
#5756
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

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

Hi All..

Just a quick question is ver 2.0 8b suitable to install on zen 1.3.8a

Thanks

RR

16 Sep 2010, 1:28 AM
#5757
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

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

Hello all,

I'm new in zen cart v1.3.9f. Glad to know IH2. I want to make sure before installing.

Since there are many same folder names and perhaps files with existing zen cart original fold, Do I need to choose override all while installing? or skip all? I worry corrupt my original zen cart program
if do override all.

Any help, Thanks.

16 Sep 2010, 9:44 AM
#5758
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

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

Hi I installed IH version 2.0 Rev 8b on zen 1.3.8a, the installation proved successful or at least i think it is.

Though I a puzzled as to why I have different image sizes in my store Subcategory Image width is 120 as is height. PLS see Url http://www.colourshield.com/store

The only thing that fixes them is if I set the following to 0
Image - Use Proportional Images on Products and Categories
However on doing so..the Product Info - Image disappears, has anyone seen this problem and know how to fix it.

Thanks

RR

16 Sep 2010, 10:45 AM
#5759
giancalr avatar

giancalr

Zen Follower

Join Date:
Jul 2010
Location:
L'Aquila
Posts:
113
Plugin Contributions:
1

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

I installed on my site https://www.erboristeriabio.com IH and does not work,
I installed it on the sub directory and it works practically images created in bmz_cache are not read:

http://www.erboristeriabio.com/bmz_cache445be2f8c827da7283c96cc4e96bcfdf8.image.100x56.png

the two to be omitted / / between the folder and sub folder
help

16 Sep 2010, 3:11 PM
#5760
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

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

People saying Somehow Google had problems with IH2 links, the problem fixed?

Moreover, what happen when installing upgrade Zen cart? I worry need to re-install IH2 again, it causes a lot of work.