From 6e66fc28a4f67745d621b4709cd793826274b6fe Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 19 Oct 2017 12:29:07 +0200 Subject: [PATCH] Update plugin.php --- bl-plugins/disqus/plugin.php | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/bl-plugins/disqus/plugin.php b/bl-plugins/disqus/plugin.php index d5973604..e5f253f7 100644 --- a/bl-plugins/disqus/plugin.php +++ b/bl-plugins/disqus/plugin.php @@ -5,7 +5,9 @@ class pluginDisqus extends Plugin { public function init() { $this->dbFields = array( - 'shortname'=>'' + 'shortname'=>'', + 'enablePages'=>false, + 'enablePosts'=>true ); } @@ -14,24 +16,44 @@ class pluginDisqus extends Plugin { global $Language; $html = '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + return $html; } public function pageEnd() { global $pages; - global $Url; + global $Url, $Page; $page = $pages[0]; if (empty($page)) { return false; } - if ( (!$Url->notFound()) && ($Url->whereAmI()=='page') && ($page->allowComments()) ) { + if ( !$Url->notFound() && + ( + ($this->getDbField('enablePosts') && $Page->status()=='published') || + ($this->getDbField('enablePages') && $Page->status()=='static') + ) && + $page->allowComments() ) { $html = '
'; $html .= '