just a little tweak of this great mod:
if you'd like to show the category image smaller, than the thumbnail,
replace the code from step 3 by this:
(includes/functions.php)
//cat image
$cat_image = "";
if ($cat_cache[$category_id]['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$cat_cache[$category_id]['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
$file_info = @getimagesize($cat_image);
$dim = 40;
$width = $file_info[0];
$height = $file_info[1];
if ($width && $height) {
if ($width > $dim || $height > $dim) {
@$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dim;
$new_height = round(($dim/$width) * $height);
}else {
$new_width = round(($dim/$height) * $width);
$new_height = $dim;
}
}else{
$new_width = $width;
$new_height = $height;
}
}else{
$new_width = $dim;
$new_height = $dim;
}
$cat_image = "<img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\">";
}
}
}
$site_template->register_vars("cat_image", $cat_image);
//end cat image
and step 4 by:
{if cat_image}{cat_image}{endif cat_image}