diff --git a/bl-plugins/disqus/languages/en.json b/bl-plugins/disqus/languages/en.json index ff728f5a..b4b6f9af 100644 --- a/bl-plugins/disqus/languages/en.json +++ b/bl-plugins/disqus/languages/en.json @@ -4,5 +4,7 @@ "name": "Disqus", "description": "Disqus is a comment hosting service for web sites.
It's necessary to be registered on Disqus to use this service." }, - "disqus-shortname": "Disqus shortname" + "disqus-shortname": "Disqus shortname", + "enable-disqus-on-pages": "Disqus on static", + "enable-disqus-on-posts": "Disqus on published" } diff --git a/bl-plugins/disqus/languages/ru_RU.json b/bl-plugins/disqus/languages/ru_RU.json index 2dd66f3b..f96a82f1 100644 --- a/bl-plugins/disqus/languages/ru_RU.json +++ b/bl-plugins/disqus/languages/ru_RU.json @@ -5,7 +5,6 @@ "description": "Disqus это сервис комментариев для сайтов и блогов. Необходимо быть зарегистрированным на Disqus.com перед использованием плагина." }, "disqus-shortname": "Disqus shortname", - "enable-disqus-on-pages": "Включить Disqus на страницах", - "enable-disqus-on-posts": "Включить Disqus в записях", - "enable-disqus-on-default-home-page": "Включить Disqus на домашней странице" + "enable-disqus-on-pages": "Disqus на страницах", + "enable-disqus-on-posts": "Disqus в записях" } diff --git a/bl-plugins/disqus/plugin.php b/bl-plugins/disqus/plugin.php index d5973604..2880809f 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() && + ( $Url->whereAmI()=='page' && + (($this->getDbField('enablePosts') && $Page->status()=='published') || + ($this->getDbField('enablePages') && $Page->status()=='static')) + ) && + $page->allowComments() ) { $html = '
'; $html .= '