I am using a custom Icon for the forums and I have created another Icon with an indicator to show that there are unread posts in that forum when in group view.
I have used the iconUnread facility in forum view with no problems and copied what I did into spGroupView.php but to no avail.
Here’s the code from the relevant section of the sp-group-view-functions.php file. Why is my alternate icon not being displayed? I figure it may have something to do with the first if statement but ![]()
function sp_ForumIndexIcon($args='') {
global $spThisForum;
$defs = array('tagId' => 'spForumIndexIcon%ID%',
'tagClass' => 'spRowIcon',
'icon' => 'sp_ForumIcon.png',
'iconUnread' => 'sp_ForumIcon_new_post.png',
'echo' => 1,
'get' => 0,
);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_ForumIndexIcon_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$tagId = esc_attr($tagId);
$tagClass = esc_attr($tagClass);
$echo = (int) $echo;
$get = (int) $get;
$tagId = str_ireplace('%ID%', $spThisForum->forum_id, $tagId);
# Check if a custom icon
if (!empty($spThisForum->forum_icon)) {
$icon = SFCUSTOMURL.$spThisForum->forum_icon;
} else {
if ($spThisForum->unread) $icon = $iconUnread;
$icon = SPTHEMEICONS.sanitize_file_name($icon);
}
if ($get) return $icon;
$out = "<img id='$tagId' class='$tagClass' src='$icon' alt='' />n";
$out = apply_filters('sph_ForumIndexIcon', $out, $a);
if ($echo) {
echo $out;
} else {
return $out;
}
Of course the icon is in the theme images folder, the custom icon is still displayed for the forum.