View Single Post
  #101  
Old 05-27-2007, 11:11 AM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default Re: Easy dynamic thumbnail generation

Thanks for the info. This is a great mod. Had to debug it slightly to get it to work.

Here is my file for 4.0.x:

Code:
{* $Id: product_images.tpl,v 1.12 2004/05/28 12:21:05 max Exp $ *} {if $images ne ""} {capture name=dialog} <script language="JavaScript" type="text/javascript"> {section name=image loop=$images} {if $images[image].image_path} Image{$images[image].imageid} = new Image(); Image{$images[image].imageid}.src = "{$images[image].image_path|replace:"var/www/html/":""}"; {/if} {/section} </script> <table width="100%"> <tr> <td> <table> {section name=image loop=$images} {if $images[image].image_path} <tr> <td> <a href="{$images[image].image_path|replace:"var/www/html/":""}" onmouseover="document.main_image.src=Image{$images[image].imageid}.src;">{thumb file=`$images[image].image_path` longside="100" link="false" html="alt='`$product.product`' border='0'"}</a> </td> </tr> {/if} {/section} </table> </td> <td> <img src="{$images[0].image_path|replace:"var/www/html/":""}" sharpen="false" class="NoBorder" name="main_image" alt="{$product.product}" /> </td> </tr> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"} {/if}

Few things....

1. There is an updated plugin. Get it here: http://www.cerdmann.com/xtras/smarty/function.thumb.php

2. The link to # didn't work well with my CDSEO site. If you click on the link, the page would go back to the site root. For CDSEO I had to modify the link
from

Code:
<a href="#" onmouseover="document.main_image.src=Image{$images[image].imageid}.src;">{thumb file=`$images[image].image_path` longside="100" link="false" html="alt='`$product.product`' border='0'"}</a>

to
Code:
<a href="{$cdseo_prod}/{$product.cdseo_url}#" onmouseover="document.main_image.src=Image{$images[image].imageid}.src;">{thumb file=`$images[image].image_path` longside="100" link="false" html="alt='`$product.product`' border='0'"}</a>

3. my 'server path to remove' is obviously "var/www/html/"...
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote