diff --git a/core/function.php b/core/function.php index 0cb7d09..e6826cd 100644 --- a/core/function.php +++ b/core/function.php @@ -2,7 +2,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "6.9.9"; + return "7.0.0"; }; /* 判断是否是手机 */ diff --git a/functions.php b/functions.php index f649e13..8236fcc 100644 --- a/functions.php +++ b/functions.php @@ -62,6 +62,21 @@ function themeConfig($form) $JLogo->setAttribute('class', 'joe_content joe_image'); $form->addInput($JLogo); + $JCommentStatus = new Typecho_Widget_Helper_Form_Element_Select( + 'JCommentStatus', + array( + 'on' => '开启(默认)', + 'off' => '关闭' + ), + '3', + '开启或关闭全站评论', + '介绍:用于一键开启关闭所有页面的评论
+ 注意:此处的权重优先级最高
+ 若关闭此项而文章内开启评论,评论依旧为关闭状态' + ); + $JCommentStatus->setAttribute('class', 'joe_content joe_global'); + $form->addInput($JCommentStatus->multiMode()); + $JNavMaxNum = new Typecho_Widget_Helper_Form_Element_Select( 'JNavMaxNum', array( diff --git a/package.json b/package.json index 49c026c..cf0db0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typecho-joe-next", - "version": "6.9.9", + "version": "7.0.0", "description": "A Theme Of Typecho", "main": "index.php", "keywords": [ diff --git a/public/comment.php b/public/comment.php index 407c32c..893ae1c 100644 --- a/public/comment.php +++ b/public/comment.php @@ -11,7 +11,7 @@ 当前文章受密码保护,无法评论 - allow('comment')) : ?> + allow('comment') && $this->options->JCommentStatus !== "off") : ?>
@@ -88,12 +88,14 @@ - 博主关闭了当前页面的评论 + options->JCommentStatus === "off") : ?> + 博主关闭了所有页面的评论 + + 博主关闭了当前页面的评论 +
- -