[2023-01-23] 4images 1.10 released
0 Members and 1 Guest are viewing this topic.
maybe its done in a wrong place?
Then try insert in categories.php belowCode: [Select]$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);This block:Code: [Select]$cat_image = ""; if ($cat_cache[$cat_id]['cat_image']) { $sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id FROM ".IMAGES_TABLE." WHERE image_id = ".$cat_cache[$cat_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); } } } $site_template->register_vars("cat_image", $cat_image);
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$cat_image = ""; if ($cat_cache[$cat_id]['cat_image']) { $sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id FROM ".IMAGES_TABLE." WHERE image_id = ".$cat_cache[$cat_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); } } } $site_template->register_vars("cat_image", $cat_image);
Second method:Do Step 6Then got to ACP -> Edit images -> find an image -> edit.In the single image edit screen (not the group image edit!) at the bottom, u sould see a new option "Category Image (yes/no)" simply select "yes" to set that image as "Category Image".Also if any image was previousle set as "Category Image" u should see its thumbnail and image name.