Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
mc12345678
The code originally posted and seeming to work is provided here below and at the associated link:
There is a small issue.. I'm getting errors coming from the additional_images.php.. Here's what the logs say:
Quote:
[23-Aug-2013 20:32:35 America/Phoenix] PHP Warning: Missing argument 5 for handle_image(), called in /xxxx/xxxxxx/xxxxxxxx/html/includes/modules/theme298/additional_images.php on line 86 and defined in /xxxx/xxxxxx/xxxxxxxx/html/includes/functions/extra_functions/functions_bmz_image_handler.php on line 51
Line 86 reads:
Code:
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
DivaVocals
There is a small issue.. I'm getting errors coming from the
additional_images.php.. Here's what the logs say:
Line 86 reads:
Code:
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
That's a shame that it throughs an error considering it has a default value. Don't know if it might be a specfic php version thing or not, but should be able to put a comma after the height assignment. If still get errors, then , '' (comma and two single quotes.)
So close. :P
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
mc12345678
That's a shame that it throughs an error considering it has a default value. Don't know if it might be a specfic php version thing or not, but should be able to put a comma after the height assignment. If still get errors, then , '' (comma and two single quotes.)
So close. :P
Ummmmm yeah.. :laugh:
Can ya SHOW me what the line SHOULD look like..
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
DivaVocals
Ummmmm yeah.. :laugh:
Can ya SHOW me what the line SHOULD look like..
So probably the most stable and programmer assigned version would be as below (provided again as a unit to minimize searching for the latest):
[QUOTE=mc12345678;1215719]So here is the code that works for the includes/modules/YOUR_TEMPLATE/additional_images.php:
Code:
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
//next line is commented out for Image Handler
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
list($src, $alt, $width, $height, $parameters) = $newimg;
$products_image_large = zen_output_string($src);
}
$flag_has_large = file_exists($products_image_large);
// End Image Handler changes 1 of 2
To be coupled with the following code in the includes/templates/YOUR_TEMPLATE/popup_image_additional/tpl_main_page.php file:
Code:
<?php
/**mod Image Handler 4.1
* Override Template for common/tpl_main_page.php
*
* @package templateSystem
* @copyright Copyright 2005-2006 Tim Kroeger
* @copyright Copyright 2003-2005 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: tpl_main_page.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
*/
?>
<body id="popupAdditionalImage" class="centeredContent" onload="resize();">
<div>
<?php
// $products_values->fields['products_image']
//Begin Image Handler changes 1 of 2
//the next line is commented out for Image Handler 3
if (file_exists($_GET['products_image_large_additional'])) {
//End Image Handler changes 1 of 2
echo '<a href="javascript:window.close()">' . zen_image($_GET['products_image_large_additional'], $products_values->fields['products_name'] . ' ' . TEXT_CLOSE_WINDOW) . '</a>';
//Begin Image Handler changes 2 of 2
//the next three lines are commented out for Image Handler 3
} else {
echo '<a href="javascript:window.close()">' . zen_image(DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, POPUP_ADDITIONAL_NO_IMAGE . ' ' . TEXT_CLOSE_WINDOW) . '</a>'; /*v4.3.1c-lat9*/
}
//End Image Handler changes 2 of 2
?>
</div>
</body>
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
mc12345678
So probably the most stable and programmer assigned version would be as below (provided again as a unit to minimize searching for the latest):
Quote:
Originally Posted by
mc12345678
So here is the code that works for the includes/modules/YOUR_TEMPLATE/additional_images.php:
Code:
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
//next line is commented out for Image Handler
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
list($src, $alt, $width, $height, $parameters) = $newimg;
$products_image_large = zen_output_string($src);
}
$flag_has_large = file_exists($products_image_large);
// End Image Handler changes 1 of 2
To be coupled with the following code in the includes/templates/YOUR_TEMPLATE/popup_image_additional/tpl_main_page.php file:
Code:
<?php
/**mod Image Handler 4.1
* Override Template for common/tpl_main_page.php
*
* @package templateSystem
* @copyright Copyright 2005-2006 Tim Kroeger
* @copyright Copyright 2003-2005 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: tpl_main_page.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
*/
?>
<body id="popupAdditionalImage" class="centeredContent" onload="resize();">
<div>
<?php
// $products_values->fields['products_image']
//Begin Image Handler changes 1 of 2
//the next line is commented out for Image Handler 3
if (file_exists($_GET['products_image_large_additional'])) {
//End Image Handler changes 1 of 2
echo '<a href="javascript:window.close()">' . zen_image($_GET['products_image_large_additional'], $products_values->fields['products_name'] . ' ' . TEXT_CLOSE_WINDOW) . '</a>';
//Begin Image Handler changes 2 of 2
//the next three lines are commented out for Image Handler 3
} else {
echo '<a href="javascript:window.close()">' . zen_image(DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, POPUP_ADDITIONAL_NO_IMAGE . ' ' . TEXT_CLOSE_WINDOW) . '</a>'; /*v4.3.1c-lat9*/
}
//End Image Handler changes 2 of 2
?>
</div>
</body>
Sorry for the late response.. I was out having dinner.. :smile:
This worked.. No more errors.. The line highlighted in blue is the only change I made.. The line highlighted in red needs Torvista's changes applied though..
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
DivaVocals
Given the issue EHSI is having I still suggest a rollback and re-install..
Good morning,
I rolled back to the original installation of ZC with only my custom template added to ZC files. Then I installed IH4 transferring it file by file to the server and I received a message that the installation of IH4 was successful. I proceeded then to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.
Having no success with ZC + custom template installation, I installed ZC without my template and then uploaded IH4 (file by file) to the server. The current installation is http://www.augustica.com/Store/index.php the plane ZC with IH4. I tried to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.
I have no idea what is wrong. It is obviously my fault since I have seen IH4 to re size my image(s) when I installed it the first time several days ago. I just cannot pinpoint the problem.
I need some help here and some extra eyes and brains to figure this one out.
Thank you.
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
EHSI
Good morning,
I rolled back to the original installation of ZC with only my custom template added to ZC files. Then I installed IH4 transferring it file by file to the server and I received a message that the installation of IH4 was successful. I proceeded then to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.
Having no success with ZC + custom template installation, I installed ZC without my template and then uploaded IH4 (file by file) to the server. The current installation is
http://www.augustica.com/Store/index.php the plane ZC with IH4. I tried to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.
I have no idea what is wrong. It is obviously my fault since I have seen IH4 to re size my image(s) when I installed it the first time several days ago. I just cannot pinpoint the problem.
I need some help here and some extra eyes and brains to figure this one out.
Thank you.
Have you tried in the catalog to upload your picture then go into IH4 to see the results? Or gone into the IH4 admin to reset/clear the bmz cache? (I forget what the specific action title is, but it is to clear the IH4 images and then they get recreated?) Or tried using the site to see if the images get updated and then check the IH4 results again?
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
mc12345678
Have you tried in the catalog to upload your picture then go into IH4 to see the results? Or gone into the IH4 admin to reset/clear the bmz cache? (I forget what the specific action title is, but it is to clear the IH4 images and then they get recreated?) Or tried using the site to see if the images get updated and then check the IH4 results again?
Thank you for the reply.
I did both. I uploaded my image through the Catalog, not IH4, and prior to that I cleared bmz cache. then I went to check out what IH4 did with the image. The result was the same - all three images were/are 191K.
Re: Image Handler 4 (for v1.5.x) Support Thread
Quote:
Originally Posted by
EHSI
Thank you for the reply.
I did both. I uploaded my image through the Catalog, not IH4, and prior to that I cleared bmz cache. then I went to check out what IH4 did with the image. The result was the same - all three images were/are 191K.
Sorry for what may be a repeat question/answer, but is your site running ver 1.5.x (0 or 1)? Trying to go back to the basics, because this plugin routinely works straight out of the box. (Will work even better after the recent update(s) are applied, but that's a different matter.)
Re: Image Handler 4 (for v1.5.x) Support Thread
Thank you.
I am running ZC 1.5.1 and IH4 which I downloaded a week ago and which does not include recent update (if there were any during this week).
I was running ZC 1.5.1 a week ago when I installed IH4 and it was running properly.