Skip to content

Commit

Permalink
修复了评论区 pingback 引用会显示两个头像的问题
Browse files Browse the repository at this point in the history
1. components/comments.php 修复了评论区 pingback 引用会显示两个头像的问题
2. components/sidebar.php 修复了侧边栏 pingback 引用会显示两个头像的问题
  • Loading branch information
changbin1997 committed Jul 30, 2024
1 parent 79d2261 commit 18540a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 6 additions & 4 deletions components/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ function threadedComments($comments, $options) {
<div class="comment-author clearfix">
<?php
// 普通评论头像
if ($GLOBALS['QQAvatar'] == 'show' && isQQEmail($comments->mail)) {
QQAvatar($comments->mail, $comments->author, 40);
}else {
gravatar($comments->mail, 50, $GLOBALS['gravatarUrl'], $comments->author);
if ($comments->type == 'comment') {
if ($GLOBALS['QQAvatar'] == 'show' && isQQEmail($comments->mail)) {
QQAvatar($comments->mail, $comments->author, 40);
}else {
gravatar($comments->mail, 50, $GLOBALS['gravatarUrl'], $comments->author);
}
}
// 引用头像
if ($comments->type == 'pingback') {
Expand Down
12 changes: 8 additions & 4 deletions components/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@
<?php while($comments->next()): ?>
<li class="media mb-2">
<?php
if ($this->options->QQAvatar == 'show' && isQQEmail($comments->mail)) {
QQAvatar($comments->mail, $comments->author, 40);
}else {
gravatar($comments->mail, 50, $this->options->gravatarUrl, $comments->author);
// 普通评论头像
if ($comments->type == 'comment') {
if ($this->options->QQAvatar == 'show' && isQQEmail($comments->mail)) {
QQAvatar($comments->mail, $comments->author, 40);
}else {
gravatar($comments->mail, 50, $this->options->gravatarUrl, $comments->author);
}
}
// 引用头像
if ($comments->type == 'pingback') {
echo '<div class="pingback avatar" role="img" aria-label="引用">引用</div>';
}
Expand Down

0 comments on commit 18540a8

Please sign in to comment.