View Single Post
  #38  
Old 01-22-2004, 12:24 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

Sorry I have missed this post for so long... but here is what you should do to get it to work with thumbnails...

random.php should be:

Code:
<? $images = func_query("select * from $sql_tbl[thumbnails] ORDER BY RAND() limit 1"); if ($current_area != "C" && is_array($images)) { foreach($images as $k=>$v) { $images[$k]["type"] = (eregi("gif",$v["image_type"])?"GIF":(eregi("png",$v["image_type"])?"PNG":"JPG")); } } # # Get thumbnail's URL (uses only if images stored in FS) # if ($config["Images"]["thumbnails_location"] == "FS") if ($current_area == "C" && is_array($images)) { foreach($images as $k=>$v) if (eregi("^(http|ftp)://", $v["image_path"])) # image_path is an URL $images[$k]["tmbn_url"] = $v["image_path"]; elseif (eregi($xcart_dir, $v["image_path"])) { # image_path is an locally placed image $images[$k]["tmbn_url"] = $http_location.ereg_replace($xcart_dir, "", $v["image_path"]); } } print_r ($images); $smarty->assign("images",$images); ?>


and randoms.tpl should be:

Code:
<a href=product.php?productid={$images[0].productid}> {if $images[0].tmbn_url} [img]{$images[0].tmbn_url}[/img] {else} [img]../product_image.php?imageid={$images[0].imageid}[/img] {/if} </a>

Basicaly all I changed was the database table that it was looking at, changed the config variable (to check where the thumbnails were stored) and changed the array variable used in the template.
Reply With Quote