解决Typecho后台评论头像不显示的问题

Admin
2025-07-24 / 0 评论 / 1 阅读 / 正在检测是否收录...

  • 打开 /admin/manage-comments.php 第123行可见如下代码;
<?php $comments->gravatar(40); ?>
  • 将上述代码替换成如下代码即可;
<span itemprop="image">
 <?php $number=$comments->mail;
  if(preg_match('|^[1-9]\d{3,11}@qq\.com$|i',$number)){
  echo '<img src="https://thirdqq.qlogo.cn/g?b=qq&nk='.$number.'&s=100" width="46px" height="46px" 
  style="border-radius: 50%;float: left;margin-top: 0px;margin-right: 10px;margin-bottom:-2px">'; 
  }
  else
  {
  echo '<img src="https://gravatar.helingqi.com/wavatar/'.$number.'" width="46px" height="46px" 
  style="border-radius: 50%;float: left;margin-top: 0px;margin-right: 10px;margin-bottom:-2px">';
  }
 ?>
</span>
0

评论 (0)

取消