diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 36d1af545..af0f1fc35 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -42,8 +42,6 @@ class news_shortcodes extends e_shortcode $pref = e107::getPref(); $this->commentsDisabled = vartrue($pref['comments_disabled']); - - } function sc_newstitle() @@ -106,7 +104,7 @@ class news_shortcodes extends e_shortcode if($this->commentsDisabled) { - return; + return ''; } $news_item = $this->news_item; @@ -249,16 +247,20 @@ class news_shortcodes extends e_shortcode /** * {NEWSCOMMENTLINK: glyph=comments&class=btn btn-default btn-sm} + * */ function sc_newscommentlink($parm='') { + if($this->commentsDisabled) { return; } - + $class = varset($parm['class']) ? " ".$parm['class'] : ""; - $text = (!$this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "news_item)."'>".$this->param['commentlink'].''); + + // When news_allow_comments = 1 then it is disabled. Backward, but that's how it is in v1.x + $text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "news_item)."'>".$this->param['commentlink'].''); return $text; }