emlog评论头像不显示解决方案
Gravatar头像被墙之后,EMLOG头像显示不出来解决方案。
修改/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;
}
其实就是把http://www.gravatar.com改为http://cn.gravatar.com
刷新浏览器缓存就能看出效果了。
来源:贝壳IT