1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fix forum replies/topic count styling on sub forums.

This commit is contained in:
Cameron 2021-10-10 09:15:16 -07:00
parent fd116c177a
commit da219c31ae
3 changed files with 12 additions and 7 deletions

View File

@ -2367,7 +2367,10 @@ class e107forum
$replace = array(ltrim($forumInfo['forum_name'], '*'), e107::url('forum', 'forum', $forumInfo));
$FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']);
if(isset($threadInfo['thread_id']))
{
$threadInfo['thread_id'] = intval($threadInfo['thread_id']);
}
$search = array('{THREAD_TITLE}', '{THREAD_HREF}');
$replace = array(vartrue($threadInfo['thread_name']), ''); // $thread->threadInfo - no reference found

View File

@ -312,7 +312,7 @@ function init()
}
//XXX What is this?
if(substr($forumInfo['forum_name'], 0, 1) == '*')
if(!empty($forumInfo['forum_name']) && (substr($forumInfo['forum_name'], 0, 1) == '*'))
{
$forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
$container_only = true;
@ -322,7 +322,7 @@ function init()
$container_only = false;
}
if(substr($forum_info['sub_parent'], 0, 1) == '*')
if(!empty($forum_info['sub_parent']) && (substr($forum_info['sub_parent'], 0, 1) == '*'))
{
$forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1);
}

View File

@ -459,15 +459,17 @@
function sc_sub_threadsx()
{
$badgeThreads = ($this->var['forum_replies']) ? "badge-info" : "";
return "<span class='badge {$badgeThreads}'>" . $this->var['forum_threads'] . "</span>";
return e107::getParser()->toBadge($this->var['forum_threads']);
// $badgeThreads = ($this->var['forum_replies']) ? "badge-info" : "";
// return "<span class='badge {$badgeThreads}'>" . $this->var['forum_threads'] . "</span>";
}
function sc_sub_repliesx()
{
$badgeReplies = ($this->var['forum_replies']) ? "badge-info" : "";
return "<span class='badge {$badgeReplies}'>" . $this->var['forum_replies'] . "</span>";
return e107::getParser()->toBadge($this->var['forum_replies']);
// $badgeReplies = ($this->var['forum_replies']) ? "badge-info" : "";
//return "<span class='badge {$badgeReplies}'>" . $this->var['forum_replies'] . "</span>";
}