1 (edited by 2012-10-17 18:56:42)

Topic: [BUG] Category icons when using multiple categories

CuteNews Compatibility: 1.4.5 - 1.4.7
Description: The category icons for articles inside multiple categories don't show. The code for showing icons was never updated when intoducing multiple categories.
Instructions:
in shows.inc.php find 2 times

if($cat_icon[$news_arr[6]] != ""){ $output = str_replace("{category-icon}", "<img style=\"border: none;\" alt=\"".$cat[$news_arr[6]]." icon\" src=\"".$cat_icon[$news_arr[6]]."\" />", $output); }
                        else{ $output = str_replace("{category-icon}", "", $output); }


and replace with

if($news_arr[6] == ""){ $output = str_replace("{category-icon}", "", $output); }

elseif($cat_icon[$news_arr[6]] != ""){ $output = str_replace("{category-icon}", "<img style=\"border: none;\" alt=\"".$cat[$news_arr[6]]." icon\" src=\"".$cat_icon[$news_arr[6]]."\" />", $output); }

else{ $icons = explode(",",$news_arr[6]);
$show_icons="";
for($counter = 0; $counter < sizeof($icons); $counter++){
if(strlen(trim($cat[$icons[$counter]])))
$show_icons = $show_icons."<img style=\"border: none;\" alt=\"".$cat[$icons[$counter]]." icon\" src=\"".$cat_icon[$icons[$counter]]."\" />";
}
$output = str_replace("{category-icon}", "$show_icons", $output);
}