summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorEltrac <45323514+BigCoke233@users.noreply.github.com>2020-01-22 12:53:11 +0800
committerGitHub <noreply@github.com>2020-01-22 12:53:11 +0800
commit0d1875937ecd3288c4a4b2d3a2a953be0921fccc (patch)
tree2e65631a5cbd164fbd78243d5b3f52f235041c85 /includes
parentfbe4897802db60ba6558e9350ad451cdf6066890 (diff)
📩 Add: 评论列表自定义隐藏功能(样式)
Diffstat (limited to 'includes')
-rw-r--r--includes/comments.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/comments.php b/includes/comments.php
index 4a0baff..721c4cf 100644
--- a/includes/comments.php
+++ b/includes/comments.php
@@ -45,10 +45,11 @@ echo $commentClass;
<?php } ?>
<div class="comment">
<?php $this->comments()->to($comments); ?>
+ <?php if($this->fields->commentShow == 0)://如果显示评论列表 ?>
<h3 class="comment-title">
<?php $this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?>
</h3>
- <?php if ($comments->have()): ?>
+ <?php if ($comments->have())://如果有评论 则显示 ?>
<div class="comment-container">
<?php $comments->listComments(array(
'before' => '<div class="comment-list">',
@@ -60,7 +61,10 @@ echo $commentClass;
<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 endif; ?>
+ <?php endif;//有无评论判断结束?>
+ <?php else: //如果不显示评论列表 ?>
+ <div class="comment-hidden">博主已关闭本页面的评论显示<?php if($this->allow('comment')): ?>,您评论后将不会看到您的评论内容<?php endif; ?></div>
+ <?php endif;//是否显示判断结束 ?>
<div class="comment-form">
<!-- 判断设置是否允许对当前文章进行评论 -->