Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Easy dynamic thumbnail generation

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 07-10-2006, 12:48 PM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

It's probably the quotes that is messing it up. Try it with " quotes.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #42  
Old 07-11-2006, 07:59 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

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
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
  #43  
Old 07-11-2006, 11:15 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

Replace "server path to remove" with the part you want to cut out. The second set of quotes after the : should be empty.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #44  
Old 07-12-2006, 03:39 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #45  
Old 07-12-2006, 06:16 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default 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]
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #46  
Old 07-12-2006, 06:45 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

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
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
  #47  
Old 07-12-2006, 07:32 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

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"'}
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #48  
Old 07-12-2006, 10:04 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

great thanks
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
  #49  
Old 07-13-2006, 01:57 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

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
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
  #50  
Old 07-19-2006, 08:03 PM
 
qinwubi qinwubi is offline
 

Member
  
Join Date: Jul 2006
Posts: 16
 

Default 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 the best,
Wubi
:::::::::
xcart gold v4.3.2 with lots of customizations
Linux
Php 5.2.4
MySQL: 4.1.22-standard
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020