From 01d211b813de9f0b9ddb02408591b568bedc30ff Mon Sep 17 00:00:00 2001 From: Skywt2003 Date: Fri, 8 Oct 2021 15:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E7=94=A8=E6=88=B7=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=94=AF=E6=8C=81=20QQ=20=E5=A4=B4=E5=83=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comments.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/comments.php b/comments.php index 8451c4f..12ee47c 100644 --- a/comments.php +++ b/comments.php @@ -17,7 +17,19 @@
- gravatar(64, '', '', 'avatar'); ?> + mail); + // 原计划如果是 QQ 邮箱并且没有 Gravatar 头像设置,则显示为 QQ 头像, + // 但是好像没法把 QQ 头像调用的 API 设置成 gravatar 的 default,返回 400 错误 + // 只好采用 是 QQ 邮箱就显示 QQ 头像 的方案 + if (strstr($comments->mail, "qq.com") && is_numeric($qq) && strlen($qq) < 11 && strlen($qq) > 4){ + $avatarUrl = 'https://q3.qlogo.cn/g?b=qq&nk='.$qq.'&s=100'; + } else { + $avatarUrl = __TYPECHO_GRAVATAR_PREFIX__; + if (!empty($comments->mail)) { $avatarUrl .= md5(strtolower(trim($comments->mail))); } + $avatarUrl .= '?s='. '64' . '&r=' . Helper::options()->commentsAvatarRating . '&d=' . Helper::options()->themeUrl.'/assets/visitor.png'; + } + ?> + <?php echo $comments->author; ?>';
author(); ?> authorId == $comments->ownerId): ?>