Additional images zoom broken by apostrophe in product name
IH2 appears to have a bug, specifically in the way the zoom javascript breaks whenever the product name contains an apostrophe. See what I mean on the caboose playhouse page, compared to the barn style garage page. The javascript on the offending playhouse page throws an error in IE7: Expected ')' -- which seems to indicate one of the apostrophes in the alt/title tags isn't correctly escaped.
Worth noting that the small image on the index page zooms as it should, apostrophes and all. The difference appears to be that the index page doesn't invoke the javascript ...
HTML Code:
<a href="http://shedkitstore.com/index.php?main_page=product_info&cPath=74&products_id=179"><img src="bmz_cache/8/8075439ce70514ab472d999283da0e4f.image.120x82.jpg" alt="Casey's Caboose wooden playhouse kit" title=" Casey's Caboose wooden playhouse kit " width="120" height="82" style="position:relative" onmouseover="showtrail('bmz_cache/0/0338ac26f0930bbbbafc3097a2935893.image.285x196.jpg','Casey\'s Caboose wooden playhouse kit',120,82,285,196,this,0,0,120,82);" onmouseout="hidetrail();" /></a>
... while the product info page does:
HTML Code:
<script language="javascript" type="text/javascript"><!--
document.write('<a href="javascript:popupWindow(\'http://shedkitstore.com/index.php?main_page=popup_image_additional&pID=179&pic=0&products_image_large_additional=images/large/KidKaboose_01_LRG.jpg\')"><img src="bmz_cache/2/2717d35263012ddce8d95e31808086fc.image.120x82.jpg" alt="Casey\'s Caboose wooden playhouse kit" title=" Casey\'s Caboose wooden playhouse kit " width="120" height="82" style="position:relative" onmouseover="showtrail(\'bmz_cache/b/bede9269e8716238777113eb9f9de673.image.285x196.jpg\',\'Casey\'s Caboose wooden playhouse kit\',120,82,285,196,this,0,0,120,82);" onmouseout="hidetrail();" /><br />Enlarge image</a>');
//--></script><a href="javascript:popupWindow('http://shedkitstore.com/index.php?main_page=popup_image_additional&pID=179&pic=0&products_image_large_additional=images/large/KidKaboose_01_LRG.jpg')"><img src="bmz_cache/2/2717d35263012ddce8d95e31808086fc.image.120x82.jpg" alt="Casey's Caboose wooden playhouse kit" title=" Casey's Caboose wooden playhouse kit " style="position: relative;" onmouseover="showtrail('bmz_cache/b/bede9269e8716238777113eb9f9de673.image.285x196.jpg','Casey's Caboose wooden playhouse kit',120,82,285,196,this,0,0,120,82);" onmouseout="hidetrail();" height="82" width="120"><br>Enlarge image</a>
<noscript><a href="http://shedkitstore.com/index.php?main_page=popup_image_additional&pID=179&pic=0&products_image_large_additional=images/large/KidKaboose_01_LRG.jpg" target="_blank"><img src="bmz_cache/2/2717d35263012ddce8d95e31808086fc.image.120x82.jpg" alt="Casey's Caboose wooden playhouse kit" title=" Casey's Caboose wooden playhouse kit " width="120" height="82" style="position:relative" onmouseover="showtrail(\'bmz_cache/b/bede9269e8716238777113eb9f9de673.image.285x196.jpg\',\'Casey\'s Caboose wooden playhouse kit\',120,82,285,196,this,0,0,120,82);" onmouseout="hidetrail();" /><br />Enlarge image</a></noscript>
My question, then, is how does a web monkey like me fix this?
Re: Image Handler 2 Support
I'm having an issue with additional images not showing up. I have tried the fix that was posted earlier, which does correct the additional images not showing up, but then the fancy hover doesn't work in Product listing. I tried the fix from jettrue too but then I get a parse error of unexpected end.....
I know nothing about PHP so after going cross eyed yesterday reading I finally gave up. Can anyone help with this issue?
Heather
Re: Image Handler 2 Support
Quote:
Originally Posted by
hdonald
I'm having an issue with additional images not showing up. I have tried the fix that was posted earlier, which does correct the additional images not showing up, but then the fancy hover doesn't work in Product listing. I tried the fix from jettrue too but then I get a parse error of unexpected end.....
I know nothing about PHP so after going cross eyed yesterday reading I finally gave up. Can anyone help with this issue?
Heather
You may have copied and pasted incorrectly. Try my code adjustment again, and be careful to REPLACE the code correctly. Replace ONLY line 701 (leave the '}' that is on the following line):
Code:
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "'$products_image_zoom','$alt',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
with this (be sure to copy it all):
Code:
if (!($_GET['main_page']==FILENAME_PRODUCT_INFO)) {
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "'$products_image_zoom','$alt',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
} else {
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "\'$products_image_zoom\',\'$alt\',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
}
IF you still get the error, reply here, and let me see your site with the error.
Re: Image Handler 2 Support
Or, to put it another way, how would someone who is NOT a web-monkey like me fix this?
Re: Additional images zoom broken by apostrophe in product name
Quote:
Originally Posted by
tvadpro
IH2 appears to have a bug, specifically in the way the zoom javascript breaks whenever the product name contains an apostrophe.
Try adding this:
$alt = str_replace("\'", '', $alt);
right after this:
$alt = str_replace('"', '"', $alt);
in includes/classes/bmz_image_handler.class.php
Re: Image Handler 2 Support
Quote:
Originally Posted by
Ryk
Nice looking site - shame you've gone to extreme lengths to remove all references to ZenCart.
He missed the "zenid=" in the URL... SHHHHhhhhhhhh !
Nice and clean looking site indeed.
Re: Additional images zoom broken by apostrophe in product name
Thanks, jettrue! Bravo! :thumbsup:
Quote:
Originally Posted by
jettrue
Try adding this:
$alt = str_replace("\'", '', $alt);
right after this:
$alt = str_replace('"', '"', $alt);
in includes/classes/bmz_image_handler.class.php
Re: Image Handler 2 Support
Quote:
Originally Posted by
jettrue
You may have copied and pasted incorrectly. Try my code adjustment again, and be careful to REPLACE the code correctly. Replace ONLY line 701 (leave the '}' that is on the following line):
Code:
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "'$products_image_zoom','$alt',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
with this (be sure to copy it all):
Code:
if (!($_GET['main_page']==FILENAME_PRODUCT_INFO)) {
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "'$products_image_zoom','$alt',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
} else {
return $parameters . 'style="position:relative" onmouseover="showtrail(' . "\'$products_image_zoom\',\'$alt\',$width,$height,$zoomwidth,$zoomheight,this," . $this->zoom['startx'].','.$this->zoom['starty'].','.$this->zoom['width'].','.$this->zoom['height'].');" onmouseout="hidetrail();" ';
}
IF you still get the error, reply here, and let me see your site with the error.
Thank you, thank you, thank you. I must have missed one of those pesky '}' It works like a charm now!
Heather
Re: Image Handler 2 Support
I have IH2 installed on both of my sites. Site 1 is fine and dandy, works well and settings are good. I mirrored those settings in Site 2 and everything seems OK but when I hover over the little x in the corner of the small photo, a medium photo does not appear. Both sites are running 1.3.6. Site 2 is built using the Apple Zen Template.
Any idea what I'm missing? The site in question is PittiVintage
Thanks!
Tim
Re: Image Handler 2 Support
Quote:
Originally Posted by
MeltDown
I have IH2 installed on both of my sites. Site 1 is fine and dandy, works well and settings are good. I mirrored those settings in Site 2 and everything
seems OK but when I hover over the little x in the corner of the small photo, a medium photo does not appear. Both sites are running 1.3.6. Site 2 is built using the Apple Zen Template.
Any idea what I'm missing? The site in question is
PittiVintage
Thanks!
Tim
You don't have everything uploaded. WHen I look at your source, I don't see these two referenced:
<link rel="stylesheet" type="text/css" href="includes/templates/YOUR_TEMPLATE/css/style_imagehover.css" />
<script type="text/javascript" src="includes/templates/YOUR_TEMPLATE/jscript/jscript_imagehover.js"></script>