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)

nfc5382 05-27-2007 11:11 AM

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/"...

nfc5382 05-28-2007 05:19 PM

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}

Keebz 06-12-2007 10:13 AM

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

JWait 06-18-2007 04:43 AM

Re: Easy dynamic thumbnail generation
 
This mod does what you want. I don't know about anything "quicker".

dub713 06-18-2007 05:49 AM

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

JWait 06-18-2007 06:09 AM

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.

dub713 06-18-2007 07:14 PM

Re: Easy dynamic thumbnail generation
 
1 Attachment(s)
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

Steve-C 07-26-2007 06:14 AM

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

Zaja 07-26-2007 08:27 AM

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

Steve-C 07-26-2007 10:20 AM

Re: Easy dynamic thumbnail generation
 
Thanks Zaja.
Looks like that rules me out !


All times are GMT -8. The time now is 12:25 PM.

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