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

Results 6,281 to 6,300 of 7,094
14 Jan 2011, 1:09 PM
#6281
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

nagelkruid:

Hi,
are you sure about this?
I thought that zoom stuff was something that is broken and not used in the current image handler version.
Ok,
hate to answer my own questions, but despite the confusing naming conventions this is exactly where the script line for the hover function is prepared.

This is also where the problem with utf-8 originates as alt names with a ' in it get converted in this line (same function)

//replace apostrophe with fancy quote
        $alt = str_replace("'", "‘", $alt);
```Does anybody know what good this may do?
The quote is allready escaped in the previous lines so what purpose would it serve to make it a fancy quote?

I found that commenting out this line does solve my problem with the utf-8, but i wonder what i may be breaking?

Any input please?
14 Jan 2011, 3:08 PM
#6282
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

Go to Page 575 and follow the discussion about why this was added to the current IH2 release..

nagelkruid:

Ok,
hate to answer my own questions, but despite the confusing naming conventions this is exactly where the script line for the hover function is prepared.

This is also where the problem with utf-8 originates as alt names with a ' in it get converted in this line (same function)

//replace apostrophe with fancy quote
$alt = str_replace("'", "‘", $alt);

> The quote is allready escaped in the previous lines so what purpose would it serve to make it a fancy quote?
>  
> I found that commenting out this line does solve my problem with the utf-8, but i wonder what i may be breaking?
>  
> Any input please?
14 Jan 2011, 3:47 PM
#6283
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

DivaVocals:

Go to Page 575 and follow the discussion about why this was added to the current IH2 release..
Ahhh, thank you for this fine example of having a rock solid memory sir, i am impressed :smile:
Now that i understand why it is there i feel much better leaving it commented as is.

thanks!
Jeroen

14 Jan 2011, 3:58 PM
#6284
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

nagelkruid:

Ahhh, thank you for this fine example of having a rock solid memory sir, i am impressed :smile:
Now that i understand why it is there i feel much better leaving it commented as is.

thanks!
JeroenAhem.. Technically it's ma'am:laugh:..

DIVAVocals

diva
Definition
di·va

di·vas Plural

NOUN

woman opera singer: a distinguished woman singer, especially one who sings in operas

successful woman: a successful woman performer

[ Late 19th century. Via Italian < Latin, "goddess" ]

Glad I could help though..

14 Jan 2011, 9:45 PM
#6285
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

DivaVocals:

Ahem.. Technically it's ma'am:laugh:..
DIVAVocals
Glad I could help though..
Woops, today turns out to be a learning curve :laugh:
thanks ma'am

14 Jan 2011, 10:44 PM
#6286
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

DivaVocals:

Go to Page 575 and follow the discussion about why this was added to the current IH2 release..
i wonder what result would be achieved with the additional images if the code would be rewritten like this:

//escape possible quotes if they're not already escapped
        //$alt = preg_replace("/([^\\\\])'/", '$1\\\'', $alt);
        //$alt = str_replace('"', '"', $alt);
        $alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));

I cant reproduce because i am showing medium images as additionals in my shop, but if someone is willing to take a look i would be interested to hear.

cheers,
jeroen

14 Jan 2011, 11:20 PM
#6287
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

nagelkruid:

i wonder what result would be achieved with the additional images if the code would be rewritten like this:

//escape possible quotes if they're not already escapped
//$alt = preg_replace("/([^\\])'/", '$1\'', $alt);
//$alt = str_replace('"', '"', $alt);
$alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));

>  
> I cant reproduce because i am showing medium images as additionals in my shop, but if someone is willing to take a look i would be interested to hear.
>  
> cheers,
> jeroenOkay.. You KNOW I'm code challenged.. :laugh: I could go home, have a glass of wine and figure it out..
 
or
 
I can cheat and ask you to 'splain it to me..:laugh:
14 Jan 2011, 11:30 PM
#6288
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

DivaVocals:

Okay.. You KNOW I'm code challenged.. :laugh: I could go home, have a glass of wine and figure it out..
or
I can cheat and ask you to 'splain it to me..:laugh:
As you are throwing a glass of wine into the discussion i would say that option would always win it in my book hehe...

Just can't get my head around why the code would be a problem for the additional images. I might be tempted to run a default cart in my xampp and see for myself, if i wasn't drinking my last can of beer i would have probably allready done so....ahhh...:wacko: i should probably go to bed :yes:

16 Jan 2011, 12:27 AM
#6289
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

nagelkruid:

i wonder what result would be achieved with the additional images if the code would be rewritten like this:

//escape possible quotes if they're not already escapped
//$alt = preg_replace("/([^\\])'/", '$1\'', $alt);
//$alt = str_replace('"', '"', $alt);
$alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));


It works fine on my test setup, 
Set up a wamp server on your local machine, makes testing a heck of a lot easier
I tried similar with html entities but my knowledge of PHP isn't that great, 
hence the hack which I knew would work, as expecting people not to use apostrophes in product names is a bit daft really.

Nice to see my hack replaced with some nice correct code
16 Jan 2011, 1:45 AM
#6290
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

nagelkruid:

As you are throwing a glass of wine into the discussion i would say that option would always win it in my book hehe...

Just can't get my head around why the code would be a problem for the additional images. I might be tempted to run a default cart in my xampp and see for myself, if i wasn't drinking my last can of beer i would have probably allready done so....ahhh...:wacko: i should probably go to bed :yes:There's ALWAYS wine in the discussion when I'm working from home!:laugh:

nigelt74:

It works fine on my test setup,
Set up a wamp server on your local machine, makes testing a heck of a lot easier
I tried similar with html entities but my knowledge of PHP isn't that great,
hence the hack which I knew would work, as expecting people not to use apostrophes in product names is a bit daft really.

Nice to see my hack replaced with some nice correct code
So ladies and gentlemen.. Are we convinced that this is the change that should be made to the code?? If so I'll update the files and submit an update... I'll test too of course, but I trust your findings.. I can simply make the change and submit it without having to test myself..

16 Jan 2011, 11:49 AM
#6291
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

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

DivaVocals:

So ladies and gentlemen.. Are we convinced that this is the change that should be made to the code?? If so I'll update the files and submit an update... I'll test too of course, but I trust your findings.. I can simply make the change and submit it without having to test myself..
Please make sure you also comment out the fancy quote line so it looks like this when you test it:

//escape possible quotes if they're not already escapped
        //   $alt = preg_replace("/([^\\\\])'/", '$1\\\'', $alt);
        //   $alt = str_replace('"', '"', $alt);
         //replace apostrophe with fancy quote
         //$alt = str_replace("'", "‘", $alt);
        $alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));  

second:
there is another problem in this function, the filename gets extracted with substr but it is extracted with the / included.
This makes the final path to the hover image have 2 slashes in the path which is incorrect. (you can see it in the page source)
This can be corrected by:

//old line in this function
//$products_image_filename = substr($src, strrpos($src, '/'), strlen ($src) - strrpos ($src, '/') - strlen ($this->extension));
//corrected
$products_image_filename = substr($src, strrpos($src, '/') + 1, strlen ($src) - (strrpos ($src, '/') + 1) - strlen ($this->extension));
16 Jan 2011, 6:59 PM
#6292
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

nagelkruid:

Please make sure you also comment out the fancy quote line so it looks like this when you test it:

//escape possible quotes if they're not already escapped
// $alt = preg_replace("/([^\\])'/", '$1\'', $alt);
// $alt = str_replace('"', '"', $alt);
//replace apostrophe with fancy quote
//$alt = str_replace("'", "‘", $alt);

$alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));

Yes I understand.. I actually will probably just make it a clean inclusion and leave out the old commented out sections altogether.. Seems they are obsolete at this point..


> **nagelkruid:**
>
> second:
> there is another problem in this function, the filename gets extracted with substr but it is extracted with the / included.
> This makes the final path to the hover image have 2 slashes in the path which is incorrect. (you can see it in the page source)
> This can be corrected by:
> ```
//old line in this function
//$products_image_filename = substr($src, strrpos($src, '/'), strlen  ($src) - strrpos ($src, '/') - strlen ($this->extension));
//corrected
$products_image_filename = substr($src, strrpos($src, '/') + 1, strlen  ($src) - (strrpos ($src, '/') + 1) - strlen ($this->extension));

Got it.. will add this to the changes to be made.. (excluding the commented out obsolete sections..)

20 Jan 2011, 12:45 AM
#6293
arty101 avatar

arty101

New Zenner

Join Date:
Aug 2010
Posts:
22
Plugin Contributions:
0

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

Hi guys, I have very few basic questions regarding that. I luckily installed it on my site and looks like its installed correctly.
But the problem is where I can add additional picture for each product that i have on my website?
I read the IH documentation but it does not tell in detail. anyone has any site where these additional pictures are showing?
I thought it will add additional column in main product page where we can browse another picture from computer?
Can you please help me in this regard,
Thanks

20 Jan 2011, 3:52 AM
#6294
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

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

arty101:

Hi guys, I have very few basic questions regarding that. I luckily installed it on my site and looks like its installed correctly.
But the problem is where I can add additional picture for each product that i have on my website?
I read the IH documentation but it does not tell in detail. anyone has any site where these additional pictures are showing?
I thought it will add additional column in main product page where we can browse another picture from computer?
Can you please help me in this regard,
Thanks

when you go to tools/image handler to get its controls---or click the little pink i in the product listing page you will get the place to add your additional images

they must have the same type of image as the primary one...jpg with jpg--png with png --- gif with gif...no mix and match or the additional ones will not show up.

click the ? and it will give you another window where you will see the main image a bit larger and under it 3 buttons...clck the add image (something like that) button to then browse your computer for the next image for this product.

repeat the add image process with each additional image you wish to add.

I cheat though and upload them all to the server...nameing them as such:

mainimagenameherewithnospaces.jpg
mainimagenameherewithnospaces_01.jpg
mainimagenameherewithnospaces_02.jpg
mainimagenameherewithnospaces_03.jpg

for how ever many you are adding, then in the product page where you put the path for the main image the others will automatically show up when you are through---but you won't see them unless you are in image handler control area or the actual product page in your store.

hope that is what you were asking....head full of flu and meds=brainless

20 Jan 2011, 3:55 AM
#6295
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

DarkAngel:

I cheat though and upload them all to the server...nameing them as such:

mainimagenameherewithnospaces.jpg
mainimagenameherewithnospaces_01.jpg
mainimagenameherewithnospaces_02.jpg
mainimagenameherewithnospaces_03.jpg

Wanted to add this: for those who don't want to remember HOW to name images so that Zen Cart will recognize them as additional images, if you upload additional images through the IH2 admin controls, IH2 takes care to properly name your additional images so that Zen Cart recognizes them as such..

21 Jan 2011, 4:06 PM
#6296
matelots avatar

matelots

New Zenner

Join Date:
Mar 2010
Location:
Jurassic Coast United Kingdom
Posts:
38
Plugin Contributions:
0

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

hi i am running latest IH2, digital shop template with zencart 1.3.9h
can someone tell me if it is possible to have a hover image in my subcatagories as here "http://thearmysurplusstore.co.uk/shop/index.php?main_page=index&cPath=7" and also on the product listing here "http://thearmysurplusstore.co.uk/shop/index.php?main_page=index&cPath=7_51" i have seen it on a site.

also since installing ih when you click on a catagory the catagory image becomes fuzzy, how can i solve this?

hope this is all clear and thanks in advance for help.

21 Jan 2011, 4:15 PM
#6297
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

All of your questions/issues are resolved by making sure ALL of your image settings are correct..

Please go back to the IH2 readme and review that all of your image settings follow the recommendations in the IH2 readme.. The fuzzy category image for example is likely because you have image settings which are larger than the actual size of image being used.. (which would likely make the image fuzzy) my guess is that you do not have the correct "proportional images" setting..

matelots:

hi i am running latest IH2, digital shop template with zencart 1.3.9h
can someone tell me if it is possible to have a hover image in my subcatagories as here "http://thearmysurplusstore.co.uk/shop/index.php?main_page=index&cPath=7" and also on the product listing here "http://thearmysurplusstore.co.uk/shop/index.php?main_page=index&cPath=7_51" i have seen it on a site.

also since installing ih when you click on a catagory the catagory image becomes fuzzy, how can i solve this?

hope this is all clear and thanks in advance for help.

21 Jan 2011, 4:43 PM
#6298
matelots avatar

matelots

New Zenner

Join Date:
Mar 2010
Location:
Jurassic Coast United Kingdom
Posts:
38
Plugin Contributions:
0

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

Thanks will try again, although i thought i had followed the read me to the letter.

21 Jan 2011, 5:03 PM
#6299
matelots avatar

matelots

New Zenner

Join Date:
Mar 2010
Location:
Jurassic Coast United Kingdom
Posts:
38
Plugin Contributions:
0

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

thanks for your guidence all done.
i took out the hieght settings and all works as i want it too although i still have the fuzzy issue when static but not on rollover, but will persevere.

this is an excellent mod.

21 Jan 2011, 6:14 PM
#6300
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

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

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

I'm getting this trying to add additional images: Error: unable to determine the page link! Function used:zen_href_link(",",'NONSSL')

I found similar forum reply here:

http://www.zen-cart.com/forum/showthread.php?t=35913&highlight=Unable+determine+page+link&page=576

In the noted case it was to do with an apostrophe in the name of the image.

In my particular case I have a + sign in the title, which corresponds to a product size, as in M+ for Medium Plus. In the product listing I use &#43 for the sign as that doesn't muck up my Ceon SEO. In the main photo name I've used the actual + sign.

When I get the error message in the IH window I am, at the same time, getting a 'file successfully uploaded' message up top of the zen main window.

I don't use a lot of additional images. And I just happened to updge to IH 2.8d yesterday, on zc 1.3.9h; many mods including Zen Lightbox. Everything else seems to be working ok after the update.

Is there a symbol I could use in the hack on page 576 to make this annoying little plus sign play nice?