From d3978f3b60fad2cc7777b8851a997a80ee3ec846 Mon Sep 17 00:00:00 2001 From: Tijn Kuyper Date: Wed, 2 Oct 2019 14:45:50 +0200 Subject: [PATCH] Closes #3680 - Add message on pages when global comments are enabled but comments for specific page are disabled --- e107_core/shortcodes/batch/page_shortcodes.php | 12 ++++++++++++ e107_languages/English/lan_page.php | 3 +-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index 0fbd9ca9f..f3545f090 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -163,6 +163,18 @@ class cpage_shortcodes extends e_shortcode { $com = $this->var['comments']; $comflag = $this->var['page_comment_flag']; + + if(e107::getPref('comments_disabled') == 0 && !$comflag) + { + if(BOOTSTRAP) + { + return e107::getMessage()->addInfo(LAN_PAGE_17)->render(); + } + else + { + return "
".LAN_PAGE_17."
"; + } + } //if($parm && isset($com[$parm])) return $com[$parm]; if($comflag) diff --git a/e107_languages/English/lan_page.php b/e107_languages/English/lan_page.php index 8314e6744..90abe5b3d 100644 --- a/e107_languages/English/lan_page.php +++ b/e107_languages/English/lan_page.php @@ -25,6 +25,5 @@ define("LAN_PAGE_13", "Page"); define("LAN_PAGE_14", "Other Articles"); define("LAN_PAGE_15", "Articles"); define("LAN_PAGE_16", "There are no chapters in this book"); - - +define("LAN_PAGE_17", "Comments on this page are locked.") ?> \ No newline at end of file