From 398f881a414557a2ff957ea699ab2b234cd4354f Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 29 Nov 2013 20:38:17 +0800 Subject: [PATCH] fixed #90 --- var/Widget/Archive.php | 16 ++++++++++++---- var/Widget/Comments/Archive.php | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/var/Widget/Archive.php b/var/Widget/Archive.php index 6f3e6eb0..5483219f 100644 --- a/var/Widget/Archive.php +++ b/var/Widget/Archive.php @@ -1370,8 +1370,13 @@ class Widget_Archive extends Widget_Abstract_Contents */ public function comments() { - $parameter = array('parentId' => $this->hidden ? 0 : $this->cid, 'parentContent' => $this->row, - 'respondId' => $this->respondId, 'commentPage' => $this->request->filter('int')->commentPage); + $parameter = array( + 'parentId' => $this->hidden ? 0 : $this->cid, + 'parentContent' => $this->row, + 'respondId' => $this->respondId, + 'commentPage' => $this->request->filter('int')->commentPage, + 'allowComment' => $this->allow('comment') + ); return $this->widget('Widget_Comments_Archive', $parameter); } @@ -1384,8 +1389,11 @@ class Widget_Archive extends Widget_Abstract_Contents */ public function pings() { - return $this->widget('Widget_Comments_Ping', array('parentId' => $this->hidden ? 0 : $this->cid, - 'parentContent' => $this->row)); + return $this->widget('Widget_Comments_Ping', array( + 'parentId' => $this->hidden ? 0 : $this->cid, + 'parentContent' => $this->row, + 'allowPing' => $this->allow('ping') + )); } /** diff --git a/var/Widget/Comments/Archive.php b/var/Widget/Comments/Archive.php index fda0082a..1c6d9992 100644 --- a/var/Widget/Comments/Archive.php +++ b/var/Widget/Comments/Archive.php @@ -63,7 +63,7 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments public function __construct($request, $response, $params = NULL) { parent::__construct($request, $response, $params); - $this->parameter->setDefault('parentId=0&commentPage=0&commentsNum=0'); + $this->parameter->setDefault('parentId=0&commentPage=0&commentsNum=0&allowComment=1'); /** 初始化回调函数 */ if (function_exists('threadedComments')) { @@ -456,7 +456,7 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments */ public function reply($word = '') { - if ($this->options->commentsThreaded && !$this->isTopLevel) { + if ($this->options->commentsThreaded && !$this->isTopLevel && $this->parameter->allowComment) { $word = empty($word) ? _t('回复') : $word; $this->pluginHandle()->trigger($plugged)->reply($word, $this);