1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

#3680 - Show message on news items when comments disabled while global comments are enabled

This commit is contained in:
Tijn Kuyper
2019-10-02 14:39:57 +02:00
parent eea2a552a3
commit 62f8e91be9

View File

@@ -1289,12 +1289,25 @@ class news_front
$comment_edit_query = 'comment.news.'.$news['news_id']; $comment_edit_query = 'comment.news.'.$news['news_id'];
$text = e107::getComment()->compose_comment('news', 'comment', $news['news_id'], null, $news['news_title'], false, 'html'); $text = e107::getComment()->compose_comment('news', 'comment', $news['news_id'], null, $news['news_title'], false, 'html');
if(!empty($text)) if(!empty($text))
{ {
return $text; return $text;
} }
}
else
{
// Only show message if global comments are enabled, but current news item comments are disabled
if(e107::getPref('comments_disabled') == 0 && $news['news_allow_comments'] == 1)
{
if(BOOTSTRAP)
{
return e107::getMessage()->addInfo(COMLAN_328)->render();
}
else
{
return "<br /><div style='text-align:center'><b>".COMLAN_328."</b></div>";
}
}
} }
$this->addDebug("Failed", "renderComments()"); $this->addDebug("Failed", "renderComments()");