This commit is contained in:
joyqi 2013-11-29 20:38:17 +08:00
parent 51e79138a7
commit 398f881a41
2 changed files with 14 additions and 6 deletions

View File

@ -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')
));
}
/**

View File

@ -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);