Re: Image Handler 2 Support
Quote:
Originally Posted by
BlessIsaacola
Okay, I just checked our production installation. The file that they both shared is \includes\modules\YOUR-TEMPLATE-FOLDER\additional_images.php
Both IH2 and Zen Lightbox touches this file so you want to merge the changes.
Pasted below is the file in my override folder.
PHP Code:
<?php
/**
* additional_images module
*
* Prepares list of additional product images to be displayed in template
*
* @package templateSystem
* @copyright 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: additional_images.php 5369 2006-12-23 10:55:52Z drbyte $
*/
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();
if ($products_image != '') {
// prepare image name
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = ereg_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 = ereg_replace($products_image_extension, '', $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_extension;
$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) {
//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];
$file_extension = substr($file, strrpos($file, '.'));
$products_image_large = ereg_replace('^' . DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . ereg_replace($file_extension . '$', '', $file) . IMAGE_SUFFIX_LARGE . $file_extension;
$flag_has_large = true;
$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);
// remove additional single quotes from image attributes (important!)
$thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
$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') {
$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
?>
Thanks, lots of info for me to deal, you would think these 2 programs IH2 and zen lightbox can be install and work without this sort of problems. I am not sure how to solve the problem with the info you have provided.
More help required please.
Re: Image Handler 2 Support
Copy the code I pasted and save it as additional_images.php and then compare it to your file to see what's different. Like I said, it works just fine on our site.
Assuming you're using override, the file you want to compare to is located at:
\includes\modules\YOUR-TEMPLATE-FOLDER\additional_images.php
Again, I am assuming that everything else is working fine except for additional image.
Re: Image Handler 2 Support
Quote:
Originally Posted by
lukemcr
Hi,
I'm having an annoying little problem. IH is working great for me on the front end, but a lot of the product images on the backend are broken. The reason why the images are broken is that IH is giving the wrong relative URL.
My site is at
www.domain.com/new/, but IH is saying that the relative URLs for the images on the backend are at /new//new/index.php instead of /new/index.php
Anybody have any idea how to change this?
Thanks a lot,
Luke
So, any ideas?
Re: Image Handler 2 Support
Quote:
Originally Posted by
Jatocar
Thanks, lots of info for me to deal, you would think these 2 programs IH2 and zen lightbox can be install and work without this sort of problems. I am not sure how to solve the problem with the info you have provided.
More help required please.
Tried your info still can't get IH2 to work.
Any other options????
Thanks
Re: Image Handler 2 Support
Been using 1.3.7 very happily. PLanning to upgrade soon. The store runs smooth so I haven't needed to roll up my sleeves for several months. My holiday is over.
1. Noticed a few Category images were not showing.
2. Cleared bmz_cache and lost 25% of my category images.
3. View source and missing Cat images says something like: bmz_cache/a/a896d5f859e244349d82ed5a7d755ffb.image.99x57.png
When I look on the server, the above file is there BUT it is empty. 0Kb
4. Delete the above image from the server and get this error once:
Code:
Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in /home/musicpla/public_html/catalogue/includes/classes/bmz_image_handler.class.php on line 646
Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in /home/musicpla/public_html/catalogue/includes/classes/bmz_image_handler.class.php on line 646
5. Refresh screen. Error is gone but another 0Kb image with the SAME name is is produced in it's place.
To my limited understanding it looks like IH2 doesn't have permissions to create new images however, I can add new product no with problem.
Any ideas?
Rob
Re: Image Handler 2 Support
Quote:
Originally Posted by
AndyII
If instead of
safe_mode, you set an
open_basedir directory then all file operations will be limited to files under the specified directory. .....
----perhaps host has set new restrictions----
It was the host, the upgraded a control panel.
Thanks for the replies.
Re: Image Handler 2 Support
Hi BlessIsaacola
I have installed a new template Cherry Zen which works OK apart from IH2 as you can see here at http://www.indigosilvergems.com.
I still can't get IH2 to work on this template either or the Classic Contemporary Green, I have reinstall IH2 to both templates as in the readme file.
When I sign up to my hosting company for my Zen Cart site they had installed their own template which works with IH2 and Zen Lightbox OK.
I can't understand why it won't work with the other 2 templates.
Help Please ..... what have I done wrong.
:(
Re: Image Handler 2 Support
Code:
includes/templates/template_default/jscript/jscript_imagehover.js
Do you have the file above installed.. not showing as available
when your website loads.
Re: Image Handler 2 Support
Quote:
Originally Posted by
misty
Code:
includes/templates/template_default/jscript/jscript_imagehover.js
Do you have the file above installed.. not showing as available
when your website loads.
Hi misty
The file above was installed OK.
Good news...... I've now got IH2 working with Zen lightbox here how, these 3 files listed below were missing from these 2 template folders /includes/templates/cherry_zen/jscript/ and /includes/templates/classic/jscript/.
I copy these files into the above folders all working OK.
jscript_imagehover.js
loadNodes.js
treeview.js
Thanks for pointing me in the general direction.
:clap::D
Re: Image Handler 2 Support
Is it possible to make the additional images smaller on the product info page?
Cal