Gravatar头像被墙之后,头像显示不出来解决方案。修改为多说的缓存,也算是一个备胎。而且多说的速度相对于其他的来说速度更快。
1.修改/include/lib/function.base.php.
找到:
/** * 获取Gravatar头像 * http://en.gravatar.com/site/implement/images/ * @param $email * @param $s size * @param $d default avatar * @param $g */ function getGravatar($email, $s = 40, $d = 'mm', $g = 'g') { $hash = md5($email); $avatar = "http://www.gravatar.com/avatar/$hash?s=$s&d=$d&r=$g"; return $avatar; }
改为
/** * 获取Gravatar头像 * http://en.gravatar.com/site/implement/images/ * @param $email * @param $s size * @param $d default avatar * @param $g */ function getGravatar($email, $s = 40, $d = 'mm', $g = 'g') { $hash = md5($email); $avatar = "http://cn.gravatar.com/avatar/$hash?s=$s&d=$d&r=$g"; return $avatar; }
OK,刷新一下或者更新缓存即可。。
谢谢赞赏
(微信扫一扫或长按识别)