diff options
| author | Eltrac Koalar <hi@guhub.cn> | 2022-08-23 21:45:59 +0800 |
|---|---|---|
| committer | Eltrac Koalar <hi@guhub.cn> | 2022-08-23 21:45:59 +0800 |
| commit | 9216f36964a08a031ef8b28867e9b3f0e0058ec7 (patch) | |
| tree | 8c547b6156b681668f8c5c78622affbb647cf362 /functions.php | |
| parent | c24e3cd10ec30b3939c04e9bd6d1b33105c69eb6 (diff) | |
:computer: Add: 主题初始化,避免无法评论
Diffstat (limited to 'functions.php')
| -rw-r--r-- | functions.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/functions.php b/functions.php index 746d813..645cb41 100644 --- a/functions.php +++ b/functions.php @@ -11,4 +11,13 @@ require_once('libs/Options.php'); require_once('libs/Comments.php'); Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('Matcha','parseContent'); -Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('Matcha','parseContent');
\ No newline at end of file +Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('Matcha','parseContent'); + +function themeInit($archive) { + if ($archive->hidden) header('HTTP/1.1 200 OK');//暴力解决访问加密文章会被 pjax 刷新页面的问题 + Helper::options()->commentsAntiSpam = false; 关闭反垃圾 + Helper::options()->commentsMaxNestingLevels = '9999';//最大嵌套层数 + Helper::options()->commentsPageDisplay = 'first';//强制评论第一页 + Helper::options()->commentsOrder = 'DESC';//将最新的评论展示在前 + Helper::options()->commentsCheckReferer = false;//关闭检查评论来源URL与文章链接是否一致判断(否则会无法评论) +}
\ No newline at end of file |
