Zen Cart Logo
Forums / All Other Contributions/Addons / Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Sticky

Views: 159,028

Results 41 to 60 of 765
23 Jan 2018, 3:38 PM
#41
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

mc12345678:

Umm... Do you need just the filename or do you need the html <img> tag that provides the image? (or even from that to pull the filename?) If you use the zen_image function to return the generated value, then you will receive the html tag that should contain all that is necessary to display the image. If it is the directory path only needed then the string can be parsed from the content (src parameter), if it is an image tag, then it is the entire returned value from the function.

I guess one could achieve this in the front store, and the images paths would be easy to get. And maybe I'll do that, still testing. I thought that using a json file, the searches would be faster. It's all very beautiful when testing with 50 books. But with the inteire catalog, that's when man's get separated from boys. A lot of jquery knowledge is needed, etc, etc.... And I'm a boy :)
Anyway, I leave my suggestion open, to use IH as a tool that could be use by other modules, etc.

Thanks

29 Jan 2018, 10:24 PM
#42
mrsensible avatar

mrsensible

New Zenner

Join Date:
Mar 2010
Posts:
11
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

New install of ZenCart 1.5.5f - installed IH 4.3.2.
Decided to change to IH 5.5.0.
Uninstalled 4.3.2 and installed 5.5.0.

No 'Turn on IH' in Admin>Configuration>Images - just a reference to version number..

As per post #23 above, deleted the IH version row in the database..

Now have 'IH resize images' (set to 'yes') and the expected IH options..

But:

No IH icons appear in Admin Category/Product area (next to 'copy', 'move'..) and IH functionality only possible from Admin>Tools>Image Handler5

Is this a 'feature' or is there something I missed?

30 Jan 2018, 11:36 AM
#43
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

MrSensible:

New install of ZenCart 1.5.5f - installed IH 4.3.2.
Decided to change to IH 5.5.0.
Uninstalled 4.3.2 and installed 5.5.0.

No 'Turn on IH' in Admin>Configuration>Images - just a reference to version number..

As per post #23 above, deleted the IH version row in the database..

Now have 'IH resize images' (set to 'yes') and the expected IH options..

But:

No IH icons appear in Admin Category/Product area (next to 'copy', 'move'..) and IH functionality only possible from Admin>Tools>Image Handler5

Is this a 'feature' or is there something I missed?
I've got that re-install issue corrected for the next version of IH5. If you're not seeing that image-handler icon on the categories/products listing, then something is "wrong".

Zen Cart 1.5.5f includes in its base "detection" of image-handler and IH5 expects that base operation to be present. Since you installed/uninstalled IH 4.3.2, it's possible that that uninstall script restored an older version of /admin/includes/modules/category_product_listing.php.

12 Feb 2018, 3:28 AM
#44
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

For some reason my template not showing additional images; here is my template code:

require(DIR_WS_MODULES . zen_get_module_directory('additional_images.php'));
 ?>
 <?php
 if ($flag_show_product_info_additional_images != 0 && $num_images > 0) {
		
		/*if($prodinfo_image_effects==2){
			unset($list_box_contents[0][0]);
			$list_box_contents[0] = array_values($list_box_contents[0]);
		}*/
		for($row=0;$row<sizeof($list_box_contents);$row++)
		{
			$params = "";
			//if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
			for($col=0;$col<sizeof($list_box_contents[$row]);$col++) 
			{
					$r_params = "";
				if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
				if (isset($list_box_contents[$row][$col]['text']['thumb'])) 
				{ 
					echo '<li' . $r_params . '>' . $list_box_contents[$row][$col]['text']['thumb'] .  '</li>';
				}
			}
		}
  }
?>
12 Feb 2018, 4:15 AM
#45
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

I traced it down to this in includes/modules/additional_images.php this is the code that seems to be the problem:

$num_images = count($images_array);
$list_box_contents = array();
$title = '';

if ($num_images > 0) {

If I leave it like this:

$temp_num_images=sizeof($images_array);
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';

if ($num_images) {

it displays the additional images any clue why>?

12 Feb 2018, 4:56 AM
#46
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

I figured it out I had one line that had sizeof($images_array)

12 Mar 2018, 12:06 AM
#47
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

I had the same issue as per post #23 and #42 above. Had to delete the IH Version number from the database and that refreshed the install.

Warning for anyone else watch out for this as that got me too:

Since you installed/uninstalled IH 4.3.2, it's possible that that uninstall script restored an older version of /admin/includes/modules/category_product_listing.php

Now on to the problem I can't solve. All is OK when I click on a category and it lists the products. IH pop-up works there. If I click to view a product though I get a white screen from just below the breadcrumbs and in the error log I have:

PHP Fatal error: Call to undefined function zen_lightbox() in includes/classes/observers/FualSlimboxObserver.php on line 44
Line 44:

$image_link = zen_lightbox($products_image_large, $products_name, LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);

Through testing I have ascertained that this code breaks things:
/includes/modules/MYTEMPLATE/additional_images.php

//-bof-image_handler-lat9  *** 4 of 4 ***
        // -----
        // This notifier gives notice that an additional image's script link is requested.  A monitoring observer sets
        // the $p2 value to boolean true if it has provided an alternate form of that link; otherwise, the base code will
        // create that value.
        //
        // $p1 ... (r/o) ... An associative array, containing the 'flag_display_large', 'products_name', 'products_image_large' and 'thumb_slashes' values.
        // $p2 ... (r/w) ... A reference to the $script_link value, set here to boolean false; if an observer modifies that value, the
        //                     this module's processing is bypassed.
        //
        $script_link = false;
        $zco_notifier->notify(
            'NOTIFY_MODULES_ADDITIONAL_IMAGES_SCRIPT_LINK',
            array(
                'flag_display_large' => $flag_display_large,
                'products_name' => $products_name,
                'products_image_large' => $products_image_large,
                'thumb_slashes' => $thumb_slashes
            ),
            $script_link
        );
        if ($script_link === false) {
    $script_link = '<script type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . str_replace($products_image_large, urlencode(addslashes($products_image_large)), $large_link) . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
        }
//-eof-image_handler-lat9  *** 4 of 4 ***

I used to have Zen Lightbox installed but I'm working on an upgrade to V1.5.5f and I started with a stock install so there will be no remnants of Lightbox left. I have also run the uninstall sql to remove references from my database.

Running PHP Version 5.5.38 and MySQL 5.5.58. If that could be playing a part? Upgrading my store so I can go to PHP 7.

The site is not open to the outside world yet but I can enable it if needs be. Before I do that does any one have any ideas?

Brent

PS there are slight differences with /includes/modules/MYTEMPLATE/additional_images.php and the stock file. These don't appear to be intentional but wasn't sure. For example line 86:

        if (count($images_array) > 0) {
``` vs ```php
    if (sizeof($images_array)) {

line 97:

$num_images = count($images_array);
``` vs ```php
$num_images = sizeof($images_array);

line 101:

if ($num_images > 0) {
``` vs ```php
if ($num_images) {
12 Mar 2018, 1:01 PM
#48
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Somewhere, remaining in your configuration is one of two settings, either ZEN_LIGHTBOX_STATUS (set to 'true') or FUAL_SLIMBOX (set to 'true').

You can use your admin's Tools->Developer's Tool Kit to search (using the Look-up CONSTANT or language defines section) to search and change those settings to 'false'. That will get you going, then you need to run the SQL uninstall script for Zen Lightbox or Fual Slimbox (whichever was installed) and/or use your site's phpMyAdmin to locate and delete those configuration settings.

12 Mar 2018, 2:07 PM
#49
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Thanks for getting back to me and giving me a few pointers!

I did do a search using the tool kit and includes/classes/observers/FualSlimboxObserver.php was the only place I found ZEN_LIGHTBOX or FUAL_SLIMBOX.

I also ran the uninstall sql for Zen Lightbox twice just to be sure my database was clean.

What I didn't do was search my database for config settings left behind. I have just taken a peak in a backup and there are indeed some settings left over so I'll clear them out.

I now understand what is going wrong. All obvious once you see the light :blush:

Brent

12 Mar 2018, 2:37 PM
#50
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Brent, I'll also "stiffen-up" that observer processing so that the presence of that function is also required (as well as the partial uninstall of the older IH versions).

Thanks to you for the report.

12 Mar 2018, 3:32 PM
#51
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

My pleasure. Thanks to you I'm pleased to confirm all is now working. :clap: It also highlighted the fact I had a lot of other junk in the database left over from uninstall scripts that only partially worked.

When you are next looking at the mod can you check:

/includes/modules/MYTEMPLATE/additional_images.php
Should the changes in the stock file be pulled across? I posted the snippets above but see my screen shot which is easier to view.

Attachment 17733

Brent

12 Mar 2018, 6:01 PM
#52
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Both code-bits provide the same function; the ones in IH5 are currently more "recent" and specific than those in your "stock" file.

12 Mar 2018, 7:07 PM
#53
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Thank you. Your code it is then.

I did tried both versions and they both seemed to work but I like to sort things like this out as if ignored they have a habit of coming back to bite you years later.

12 Mar 2018, 7:39 PM
#54
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Brent:

Thank you. Your code it is then.

I did tried both versions and they both seemed to work but I like to sort things like this out as if ignored they have a habit of coming back to bite you years later.
Amen to that! Due diligence is a good thing.

13 Mar 2018, 9:39 AM
#55
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Count or sizeof:

I did tried both versions and they both seemed to work
They are the same thing. sizeof is just an alias of count. So, makes more sense to use count as it is the "real" function.

25 Mar 2018, 7:11 PM
#56
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

I'm back for a few more pointers :)

I had Image Handler 5 working in my test store on V1.5.5f. My store upgrade was ready so I delete my V1.5.1 files, copy the new ones across and run the database upgrade.

On the new live site though Image Handler is playing up. No copies of my images are placed in my bmz_cache unless I first open first open that product in my Admin by going to for example /image_handler.php?products_filter=1843&current_category_id=87. After this page has loaded the image is created in the cache.

Up to this point IH has created the correct link so if I view the image it displays the correct path but obviously no image. Go to IH in Admin view that product and the image is created.

I've compared the files in my live and test store and they are identical except for the configure files. I assume it is therefore my database again but I am stumped as the test site was started by exporting and importing my live database so it should be the same.

Brent

PS. I can't show you it in action on my site as I have IH disabled so assume a link will not be of use?

25 Mar 2018, 8:02 PM
#57
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Brent:

I'm back for a few more pointers :)

I had Image Handler 5 working in my test store on V1.5.5f. My store upgrade was ready so I delete my V1.5.1 files, copy the new ones across and run the database upgrade.

On the new live site though Image Handler is playing up. No copies of my images are placed in my bmz_cache unless I first open first open that product in my Admin by going to for example /image_handler.php?products_filter=1843¤t_category_id=87. After this page has loaded the image is created in the cache.

Up to this point IH has created the correct link so if I view the image it displays the correct path but obviously no image. Go to IH in Admin view that product and the image is created.

I've compared the files in my live and test store and they are identical except for the configure files. I assume it is therefore my database again but I am stumped as the test site was started by exporting and importing my live database so it should be the same.

Brent

PS. I can't show you it in action on my site as I have IH disabled so assume a link will not be of use?

There was an issue that I and others had upgrading IH5 - even after running the uninstall sql from IH4 something wonky happened with the new install and IH wouldn't perform - it was apparentlyed related to new IH version number table in the database configuration tables. The solution was to go into phpMyAdmin and delete that table (even though it looked correct version), then go into store admin, whereupon IH5 would reinstall itself correctly. Of course I backed up my db before doing this.

25 Mar 2018, 8:11 PM
#58
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Thanks for the feedback. Yes I too had to do that but that was to get all the correct configuration settings in my test site. In my live site it installed correctly the first time with all the correct settings. I've compared the entries in both databases and they are the same.

I'll give it a shot though as I have nothing to lose.

Brent

25 Mar 2018, 8:44 PM
#59
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

OK tried that but it is still the same. Also this time I had to remove all the other config entries and not just the version number to get it to install again.

So unfortunately my issue is still as in post #56 above. Also to add to that I get no entries in my error log :(

26 Mar 2018, 11:59 AM
#60
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread

Check your IH-5 settings, since you've reinstalled ... the default for IH resize images is 'no'; you should change that to 'yes' to enable storefront operation.