Topic: CutePHP and category-icon problem
I have utilized "CutePHP" for a website I'm working on to manage my news updates. This is a great app, but I seem to be having problems with making it post (or inject?) a different news-type-icon with each different category post.
The admin control panel has this in it:
<div style="width:100%; margin:1em 0 30px 0;">
<div style="color:#0000ff;font-size:2em;">{category-icon} {date}: {title} </div>
<div style="text-align:justify;margin-bottom:1em; border-top:1px solid #D3D3D3;">{short-story}</div>
<div style="float: right;">[full-link]Read more •[/full-link] [com-link]{comments-num} Comments[/com-link]</div>
<div><em>Posted on {date} by {author}</em></div>
</div>
....while I've found some interesting code in the "shows.inc.php" file:
if($my_names[$news_arr[1]]){ $my_author = $my_names[$news_arr[1]]; }
else{ $my_author = $news_arr[1]; }
$output = str_replace("{title}", $news_arr[2], $template_full);
$output = str_replace("{date}", date($config_timestamp_active, $news_arr[0]), $output);
$output = str_replace("{author}", $my_author, $output);
$output = str_replace("{short-story}", $news_arr[3], $output);
$output = str_replace("{full-story}", $news_arr[4], $output);
if($news_arr[5] != ""){$output = str_replace("{avatar}", "<img alt=\"\" src=\"$news_arr[5]\" style=\"border: none;\" />", $output); }
else{ $output = str_replace("{avatar}", "", $output); }
$output = str_replace("{avatar-url}", "$news_arr[5]", $output);
$output = str_replace("{comments-num}", countComments($news_arr[0], $archive), $output);
$output = str_replace("{category}", catid2name($news_arr[6]), $output);
$output = str_replace("{category-id}", $news_arr[6], $output);
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); }
When I post news, it displays the "news icon", but if I select the urgent kind of news to post, it still posts the "news icon" regardless; and not the "urgent icon".
What am I doing wrong here? Any ideas? Thanks in advance.