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
  #101  
Old 05-27-2007, 11:11 AM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 480
 

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
  #102  
Old 05-28-2007, 05:19 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 480
 

Default Re: Easy dynamic thumbnail generation

You need to add the following around section loops to not show disabled pictures!

Code:
{if $images[image].avail eq "Y"}...{/if}
__________________
-----------------------
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
  #103  
Old 06-12-2007, 10:13 AM
 
Keebz Keebz is offline
 

Newbie
  
Join Date: Apr 2007
Posts: 4
 

Default Re: Easy dynamic thumbnail generation

Hi, great mod! I have it working perfectly as I want on the product detail pages.

I was wondering...has anyone incorporated this into product listing/subcategory indexes? I'm not sure if I should be editing customer/main/products.tpl or product_thumbnail.tpl, nor am I sure of what I'm supposed to be putting in there.

This snippet of code in either of those files results in an error {thumb file=`$images[image].image_path` longside="100" link="true"}. Says the file parameter is empty.

Any insight would be awesome.

**Edit
Found answer in this thread http://forum.x-cart.com/showthread.php?t=24233
__________________
Current version: 4.1.7
Reply With Quote
  #104  
Old 06-18-2007, 04:43 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

This mod does what you want. I don't know about anything "quicker".
__________________
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
  #105  
Old 06-18-2007, 05:49 AM
 
dub713 dub713 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 56
 

Default Re: Easy dynamic thumbnail generation

Quote:
Originally Posted by JWait
This mod does what you want. I don't know about anything "quicker".

am i really missing something here? but i just haven't seen how a mod that dynamically creates thumbnails from one large image handles the creation, layout and deployment of the rollovers. i thought the mod was purely for the thumbnail creation to help people from having to do the manual work in an editor. we've got our thumbnails already so that didn't matter to me.

i'll read back through in a sec and give it another test (i'm on 4.1.7) , but i may be back with some questions...

thanks,
j
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2
Reply With Quote
  #106  
Old 06-18-2007, 06:09 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

Check the tpls at the beginning of the thread. Our site is doing exactly what you are asking. We are using version 4.0.19, but I also have it working in 4.1.6. This "mod" creates thumbnails "on the fly" and you can call them wherever you like, and however you like.

Also see alltribes.com for an example of what I think you are looking for.
__________________
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
  #107  
Old 06-18-2007, 07:14 PM
 
dub713 dub713 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 56
 

Default Re: Easy dynamic thumbnail generation

okay...

finally. i'm somewhat there.

i've gotten a rollover to work. but, i need a bit more. i'll get to that in a sec.

i'm not stupid, really, but i've been up for a day trying to beat a deadline, so forgive me if i sound slow right now but these are some questions i have...

do we just install the images like normal, but just calling the same one for multiple image usages? i was tired and floundering around, so, upload one image, call it multiple times. does it have to end up in the normal image dir? with the T D C P and all that stuff?

also, the code that was posted to move the images up to the top section, into product, instead of product_images does not appear to work for 4.1.7. the code where you remove this...

Code:
{capture name=dialog}

and

Code:
{/capture} {include file="dialog.tpl" content=$smarty.capture.dialog extra='width="100%"'}

and the other chunk from another file.

i end up with the background removed from the lower images, and no rollovers at all for the top set in the new placment in product, and the old ones in product_images. see attached.


and i guess for now, here's my major problem...

it'll be easier to just see what's there now to understand what i need. i need the rollover to show the color variants, but those are not really the detail shots.

we only take one close-up, detailed shot that is cropped in on the artwork. since the large, and the fullsize images are not the same size, i'd like to have the rollovers for the 2 color variants, but if you click on either of the images, you get the standard pop up showing the close up view of th art. we don't want to have the large close up in the page with the rest of the images.

take a look here and you'll see what i mean.. http://www.gama-go.com click on men's tees and look at the variants and how they work.

anyone have something like that figured out? or have any ideas?

thanks,
j
Attached Thumbnails
Click image for larger version

Name:	screen.gif
Views:	285
Size:	8.5 KB
ID:	437  
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2
Reply With Quote
  #108  
Old 07-26-2007, 06:14 AM
 
Steve-C Steve-C is offline
 

Senior Member
  
Join Date: Jan 2006
Location: England
Posts: 172
 

Default Re: Easy dynamic thumbnail generation

Can anyone explain how to install GD Library, please? I can find where to get the download but just where do I put it in the filesystem.

I'm on a Linux server with PHP version 4.4.4 (Which it seems is supposed to have GD built in but I can't find it anywhere)

Thanks
__________________
X-Cart Gold v 4.3.2
X-AOM, Marketing Manager, On Sale
Reply With Quote
  #109  
Old 07-26-2007, 08:27 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default Re: Easy dynamic thumbnail generation

Quote:
Originally Posted by Steve-C
Can anyone explain how to install GD Library, please? I can find where to get the download but just where do I put it in the filesystem.

I'm on a Linux server with PHP version 4.4.4 (Which it seems is supposed to have GD built in but I can't find it anywhere)

Thanks

Read this:
http://www.onlamp.com/pub/a/php/2003/03/27/php_gd.html
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #110  
Old 07-26-2007, 10:20 AM
 
Steve-C Steve-C is offline
 

Senior Member
  
Join Date: Jan 2006
Location: England
Posts: 172
 

Default Re: Easy dynamic thumbnail generation

Thanks Zaja.
Looks like that rules me out !
__________________
X-Cart Gold v 4.3.2
X-AOM, Marketing Manager, On Sale
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:43 PM.

   

 
X-Cart forums © 2001-2020