summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2020-07-10 22:58:49 +0800
committerBigCoke233 <hi@guhub.cn>2020-07-10 22:58:49 +0800
commit4901b642cd90a9124a4ca5732210707caa030290 (patch)
tree5bb5954a5b306e88e5125d4b44a80710c1f146c0 /includes
parent39b4e65156bb35e5a23ef1904d16716cd9562ab1 (diff)
:zap: Perf: 兼容 typecho 自带反垃圾功能,并优化代码结构
Diffstat (limited to 'includes')
-rw-r--r--includes/comments.php19
-rw-r--r--includes/footer.php4
-rw-r--r--includes/head.php4
-rw-r--r--includes/header.php4
4 files changed, 15 insertions, 16 deletions
diff --git a/includes/comments.php b/includes/comments.php
index 1b5ace5..b414021 100644
--- a/includes/comments.php
+++ b/includes/comments.php
@@ -28,7 +28,7 @@ echo $commentClass;
<span class="comment-reply">
<?php $comments->reply('<i class="iconfont icon-return"></i>'); ?>
</span>
- <?php getCommentHF($comments->coid); echo Contents::parseEmo($comments->content); ?>
+ <?php Comments::getCommentHF($comments->coid); echo Contents::parseEmo($comments->content); ?>
</div>
<p class="comment-meta">
<span class="comment-author"><a href="<?php echo $comments->url; ?>" target="_blank"><?php echo $comments->author; ?></a></span>
@@ -63,8 +63,8 @@ echo $commentClass;
'dateFormat' => 'Y-m-d H:i'
)); ?>
<div class="comment-pagenav">
- <?php $comments->pageNav('<i class="iconfont icon-chevron-left comment-pagenav-icon"></i>', '<i class="iconfont icon-chevron-right comment-pagenav-icon"></i>'); ?>
- </div>
+ <?php $comments->pageNav('<i class="iconfont icon-chevron-left comment-pagenav-icon"></i>', '<i class="iconfont icon-chevron-right comment-pagenav-icon"></i>'); ?>
+ </div>
</div>
<?php endif;//有无评论判断结束?>
@@ -103,11 +103,10 @@ echo $commentClass;
</form>
</div>
<!-- 若当前文章不允许进行评论 -->
- <?php else: ?>
- <div class="comment-hidden"><?php _e('博主已关闭本页面的评论功能'); ?></div>
- <!-- 防止找不到 owo 容器而报错 -->
- <div style="display:none" class="OwO"></div>
- <?php endif; ?>
+ <?php else: ?>
+ <div class="comment-hidden"><?php _e('博主已关闭本页面的评论功能'); ?></div>
+ <?php endif; ?>
</div>
- </div>
- \ No newline at end of file
+ </div>
+ <?php //兼容 typecho 反垃圾
+ if ($this->options->commentsAntiSpam) { Comments::AntiSpam($this); } ?> \ No newline at end of file
diff --git a/includes/footer.php b/includes/footer.php
index 64f8c7c..e9e0c08 100644
--- a/includes/footer.php
+++ b/includes/footer.php
@@ -24,7 +24,7 @@
<?php
$js_files=array("jquery","pjax.jquery","gazeimg","nprogress","OwO.min","highlight","highlight-line-number","pangu","qrcode.min","details-element-polyfill");
if($this->options->customCDN): $custom=$this->options->customCDN; else: $custom=Helper::options()->themeUrl("","Miracles"); endif;
- generate_require($js_files,"js",$this->options->CDN,$custom);
+ Utils::addRequires($js_files,"js",$this->options->CDN,$custom);
?>
<!-- Options -->
<script>var navSlide = <?php if($this->options->navSlide==1):?>false<?php else:?>true<?php endif;?>;
@@ -42,7 +42,7 @@
<?php
$js_files=array("miracles.min","cmt.miracles");
if($this->options->customCDN): $custom=$this->options->customCDN; else: $custom=Helper::options()->themeUrl("","Miracles"); endif;
- generate_require($js_files,"js",$this->options->CDN,$custom);
+ Utils::addRequires($js_files,"js",$this->options->CDN,$custom);
?>
<!-- JavaScript -->
<script>
diff --git a/includes/head.php b/includes/head.php
index e39cce1..e3e7a93 100644
--- a/includes/head.php
+++ b/includes/head.php
@@ -40,13 +40,13 @@
$this->options->bannerUrl();
endif;}?>" />
<link rel="icon" id="icon" type="image/png" href="<?php if($this->options->favicon):$this->options->favicon();else:echo Utils::indexTheme('favicon.ico');endif; ?>" />
- <?php $this->header('description=&commentReply='); ?>
+ <?php $header->header('generator=&pingback=&xmlrpc=&wlw=&commentReply=&description=&antiSpam='); ?>
<?php $this->options->headerEcho(); ?>
<!-- css -->
<?php
$css_files=array("codestyle","owo.min","nprogress","gazeimg","main/miracles.min");
if($this->options->customCDN): $custom=$this->options->customCDN; else: $custom=Helper::options()->themeUrl("","Miracles"); endif;
- generate_require($css_files,"css",$this->options->CDN,$custom);
+ Utils::addRequires($css_files,"css",$this->options->CDN,$custom);
?>
<!-- icon font -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1165190_1djdjjwge4m.css" />
diff --git a/includes/header.php b/includes/header.php
index c38fb55..56c0db1 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -147,10 +147,10 @@
</div>
<div class="header-meta-line-two">
<i class="iconfont icon-clock" title="该文章发布于 <?php $this->date(); ?>"></i> <?php $this->date(); ?>&emsp;
- <i class="icon-view iconfont" title="该文章被浏览 <?php get_post_view($this) ?> 次"></i> <?php get_post_view($this) ?>
+ <i class="icon-view iconfont" title="该文章被浏览 <?php Contents::postViews($this) ?> 次"></i> <?php Contents::postViews($this) ?>
</div>
<?php else: ?>
- <?php $this->fields->meta(); ?><div style="display:none"><?php get_post_view($this) ?></div>
+ <?php $this->fields->meta(); ?><div style="display:none"><?php Contents::postViews($this) ?></div>
<?php endif; ?>
</div>
<?php elseif($this->is('archive')): ?>