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 .= '