X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Easy dynamic thumbnail generation (https://forum.x-cart.com/showthread.php?t=22308)

Alltribes 07-10-2006 12:48 PM

It's probably the quotes that is messing it up. Try it with " quotes.

tahirfayyaz 07-11-2006 07:59 AM

I have tried all the following possibilities and still it does not work and the image location is always wrong

Quote:

{* $Id: product_images.tpl,v 1.12 2004/05/28 12:21:05 max Exp $ *}
{if $images ne ""}
{capture name=dialog}
<table width=100%>
<tr>
<td>
<table>
{section name=image loop=$images}
{if $images[image].image_path|replace:"server path to remove":"http://www.urbanretro.co.uk/home/tahir786/public_html/urbanretro-co-uk/xcart/images/detailed"}
<tr><td>{thumb file=`$images[image].image_path` longside="100" link="false"}</td></tr>


{/if}
{/section}
</table>
</td>
<td>
<img src={$images[0].image_path|replace:"server path to remove":"http://www.urbanretro.co.uk/home/tahir786/public_html/urbanretro-co-uk/xcart/images/detailed"} name="main_image"/>
</td>
</tr>
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra='width="100%"'}
{/if}

Quote:

{* $Id: product_images.tpl,v 1.12 2004/05/28 12:21:05 max Exp $ *}
{if $images ne ""}
{capture name=dialog}
<table width=100%>
<tr>
<td>
<table>
{section name=image loop=$images}
{if $images[image].image_path|replace:"server path to remove":"http://www.urbanretro.co.uk/home/tahir786/public_html/urbanretro-co-uk/"}
<tr><td>{thumb file=`$images[image].image_path` longside="100" link="false"}</td></tr>


{/if}
{/section}
</table>
</td>
<td>
<img src={$images[0].image_path|replace:"server path to remove":"http://www.urbanretro.co.uk/home/tahir786/public_html/urbanretro-co-uk/"} name="main_image"/>
</td>
</tr>
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra='width="100%"'}
{/if}

Quote:

{* $Id: product_images.tpl,v 1.12 2004/05/28 12:21:05 max Exp $ *}
{if $images ne ""}
{capture name=dialog}
<table width=100%>
<tr>
<td>
<table>
{section name=image loop=$images}
{if $images[image].image_path|replace:"server path to remove":"home/tahir786/public_html/urbanretro-co-uk/"}
<tr><td>{thumb file=`$images[image].image_path` longside="100" link="false"}</td></tr>


{/if}
{/section}
</table>
</td>
<td>
<img src={$images[0].image_path|replace:"server path to remove":"home/tahir786/public_html/urbanretro-co-uk/"} name="main_image"/>
</td>
</tr>
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra='width="100%"'}
{/if}

I have even tried all 3 of the above with single quotes instead but it still does not work. The image source just keeps coming out wrong with that added home/tahir786/public_html/urbanretro-co-uk/ in the middle that is not needed. Is there any other way apart from the above to say where the img src is in the code.

Thanks.

Tahir

Alltribes 07-11-2006 11:15 AM

Replace "server path to remove" with the part you want to cut out. The second set of quotes after the : should be empty.

JWait 07-12-2006 03:39 AM

Re: Easy dynamic thumbnail generation
 
Quote:

Originally Posted by Alltribes
This isn't a mod for x-cart really. It's a plugin for Smarty: http://www.cerdmann.com/thumb/

See the above link for info on how to use the various paramaters. You'll need to create a images/cache/ directory, or edit the php to point to where you want the thumbnails to be cached.



Where would I edit the code? I presently have my images in the "files" directory and there is already a "cache" directory inside it.

The first image is the default (no image available). Whenever I click on the thumbnail on the product page, I now get a 404 error in the popup window. I used the first example of your product_images.tpl in xcart version 4.1.2.

Also, how would I get just a "stack" of the detail image thumbnails with the main product thumbnail at the top of the stack... like this;

Product Thumbnail

Detail Thumbnail

Detail Thumbnail

... and have the popup window open on the detail photo of which ever is clicked.

Alltribes 07-12-2006 06:16 AM

Re: Easy dynamic thumbnail generation
 
Quote:

Originally Posted by JWait
Where would I edit the code? I presently have my images in the "files" directory and there is already a "cache" directory inside it.


The cache directory is defined here:
Code:

### ц°bergebene Parameter auswerten und verifizieren
  if (empty($params['cache'])) $_CONFIG['cache'] = 'images/cache/';


Below this you can aslo set certain paramaters to default to the settings you want, so you don't have to set them in the templates themselves.

Quote:

Originally Posted by JWait
The first image is the default (no image available). Whenever I click on the thumbnail on the product page, I now get a 404 error in the popup window. I used the first example of your product_images.tpl in xcart version 4.1.2.

Also, how would I get just a "stack" of the detail image thumbnails with the main product thumbnail at the top of the stack... like this;

Product Thumbnail

Detail Thumbnail

Detail Thumbnail

... and have the popup window open on the detail photo of which ever is clicked.


In my first product_images.tpl, the first image is not a detailed product image, it's the product's main image, you probably don't have that set if it's not loading.

Getting a stack of thumbs like you want is possible, but you'd need to rewrite the product_images.tpl.

It would be easiest to remove the link the the main image entirely and just use the default product_images.tpl. Just replace the image links with the {thumb} function.[/code]

tahirfayyaz 07-12-2006 06:45 AM

Hey Alltribes. Thanks so much I got it all working now. My first mod and its a beauty.

Sorry for being a pain but I need to know 1 last thing, something simple. How do you set the border to 0. I have put border="0" in the product_images.tpl in every place possible but the border does not go. Where exactly do I put border="0" to get rid of the border?

Thanks a million

Tahir

Alltribes 07-12-2006 07:32 AM

To get rid of the border put the border="0" in the html parameter. Here's an example:

Code:

{thumb file="images/visuals/rallyewm02/Rallye142.jpg" width="150" link="false" html='border="0"'}

tahirfayyaz 07-12-2006 10:04 AM

great thanks

tahirfayyaz 07-13-2006 01:57 AM

I have got this all working now. Thanks for all the help alltribes. When my site is launched I will place a link so people can see it in action

qinwubi 07-19-2006 08:03 PM

that's COOL
 
thanks Alltribes. I'm in debt.
To others, here's a live site showing the effect, using exactly the technology as explained by Alltribes. I made some cosmetic modifications though. Still under development, only 2 dummy products. Hopefully it helps.


All times are GMT -8. The time now is 09:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.