From 398f881a414557a2ff957ea699ab2b234cd4354f Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 29 Nov 2013 20:38:17 +0800 Subject: [PATCH 1/4] 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); From 6b4ac97135c32cc614b6c57e9eafcd9f475b4ed7 Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 29 Nov 2013 21:02:10 +0800 Subject: [PATCH 2/4] fixed #89 --- admin/editor-js.php | 11 +- admin/js/marked.js | 1192 ---------------------------- admin/js/pagedown-extra.js | 789 +++++++++++++++++++ admin/js/pagedown.js | 1497 +++++++++++++++++++++++++++++++++++- 4 files changed, 2286 insertions(+), 1203 deletions(-) delete mode 100644 admin/js/marked.js create mode 100644 admin/js/pagedown-extra.js diff --git a/admin/editor-js.php b/admin/editor-js.php index b91f1af2..ed4bdc52 100644 --- a/admin/editor-js.php +++ b/admin/editor-js.php @@ -1,7 +1,7 @@ markdown && (!$content->have() || $content->isMarkdown)): ?> - +