自定义汽泡评论内容:
<?php function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass .= ' comment-by-author'; //如果是文章作者的评论添加 .comment-by-author 样式
} else {
$commentClass .= ' comment-by-user'; //如果是评论作者的添加 .comment-by-user 样式
}
}
$commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级
?>
<li id="<?php $comments->theId(); ?>" class="comment mb-1">
<article id="div-<?php $comments->theId(); ?>" class="comment-body">
<div class="comment-avatar flex-avatar disabled me-2 me-md-3">
<?php $comments->gravatar('48', ''); ?>
</div>
<div class="comment-content">
<div>
<div class="comment-chat bg-light">
<div class="comment-info d-flex flex-fill align-items-center mb-1">
<?php $comments->author(); ?>
</div>
<div class="comment-text text-secondary">
<?php $comments->content(); ?>
</div>
</div>
</div>
<div class="d-flex flex-fill align-items-center text-xs text-muted mx-2 mt-2">
<?php $comments->date('Y-m-d H:i'); ?>
</div>
</div>
</article></li>
<?php } ?>
<?php $this->comments()->to($comments); ?>
<ul class="comment-list mt-2 mt-md-3 mt-md-5">
<?php $comments->listComments(); ?>
</ul>
评论已关闭