uc_catalog_image_load

Function uc_catalog_image_load() in uc_catalog.module:
<?php
   uc_catalog_image_load
($term)
?>

Description:

Loads an image from a row from the table uc_catalog_images keyed off $term->tid. This row contains the following keys commonly associated with file objects:

  • fid - the file id. This id should not be found in the {files} table.
  • tid - the term id for the catalog category.
  • filename - the image file's name.
  • filepath - the path to the file relative to the web root.
  • filemime - the MIME type of the image file.
  • filesize - the size of the file in bytes.
Parameters:
  • $term - an integer term id, or a term object or array with a tid property or key.
Return value:
A "standard" file object. $file->filepath should be the most useful property.

Example:
<?php
 
if (module_exists('imagecache') && $file = uc_catalog_image_load($catalog->tid)){
   
$imagecache_path file_create_url(file_directory_path() .'/imagecache/category/'. $file->filepath);
   
$info = image_get_info($imagecache_path);
   
$catalog->image = $info;
   
$catalog->image['filepath'] = $file->filepath;
  }
?>