From 88434bea621477289e8937e43271183738e7046d Mon Sep 17 00:00:00 2001
From: wehao <30787186+wehaox@users.noreply.github.com>
Date: Tue, 6 Aug 2024 23:20:06 +0800
Subject: [PATCH] =?UTF-8?q?qq=E5=A4=B4=E5=83=8F=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
functions.php | 27 ++-------------------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/functions.php b/functions.php
index 2e0a550..e49ed9a 100644
--- a/functions.php
+++ b/functions.php
@@ -519,35 +519,12 @@ function getGravatar($email, $name, $comments_a, $s = 96, $d = 'mp', $r = 'g')
{
preg_match_all('/((\d)*)@qq.com/', $email, $vai);
if (empty($vai['1']['0'])) {
- // $hasGravatar = hasGravatar($email);
- // if($hasGravatar){
- // $url = 'https://gravatar.loli.net/avatar/';
$url = Helper::options()->GravatarSelect;
$url .= md5(strtolower(trim($email)));
$url .= "?s=$s&d=$d&r=$r";
$imga = '';
- // }else{
- // $imga = '';
- // }
} else {
- $qquser = $vai['1']['0'];
- $db = Typecho_Db::get();
- if (!array_key_exists('qqk', $db->fetchRow($db->select()->from('table.comments')))) {
- $db->query('ALTER TABLE `' . $db->getPrefix() . 'comments` ADD `qqk` varchar(64) DEFAULT NULL;');
- }
- $dbk = $db->fetchRow($db->select('qqk')->from('table.comments')->where('mail=?', $email))['qqk'];
- if ($dbk == NULL) {
- $geturl = 'http://qqk.wehao.org/?uin=' . $qquser;
- $qqurl = file_get_contents($geturl);
- $json = json_decode($qqurl, true);
- if (isset($json['code']) && $json['code'] == 200) {
- $k = $json['k'].'&kti='.$json['kti'];
- $db->query($db->update('table.comments')->rows(array('qqk' => $k))->where('mail=?', $email));
- }
- $url = 'https://q1.qlogo.cn/headimg_dl?dst_uin=' . $qquser . '&spec=100';
- } else {
- $url = 'https://q1.qlogo.cn/g?b=qq&k=' . $dbk . '&s=100';
- }
+ $url = 'https://cravatar.cn/avatar/'.md5(strtolower(trim($email)));
$imga = '';
}
return $imga;
@@ -1194,4 +1171,4 @@ function darkTimeFunc(){
}
$timeSlot = explode('-', $time);
echo "e >= $timeSlot[0] || e <= $timeSlot[1]";
-}
\ No newline at end of file
+}