解决Typecho 1.0 Gravatar头像被墙问题
众所周知,Gravatar头像被认证很久了,默认使用Gravatar都会打不开头像,需要缓存到本地,或者是使用其他地址代替。
修改方法如下:
找到/var/Widget/Abstract 下的 Comments.php 文件,将390行的gravatar函数换成下面的:
public function gravatar($size = 32, $default = NULL)
{
if ($this->options->commentsAvatar && 'comment' == $this->type) {
$rating = $this->options->commentsAvatarRating;
$this->pluginHandle(__CLASS__)->trigger($plugged)->gravatar($size, $rating, $default, $this);
if (!$plugged) {
//$url = Typecho_Common::gravatarUrl($this->mail, $size, $rating, $default, $this->request->isSecure());
$mailHash = NULL;
if (!empty($this->mail)) {
$mailHash = md5(strtolower($this->mail));
}
$url = 'http://gravatar.duoshuo.com/avatar/';
if (!empty($this->mail)) {$url .= $mailHash;}
$url .= '?s=' . $size;
$url .= '&r=' . $rating;
$url .= '&d=' . $default;
echo '<img class="avatar" src='/index/thumb.png' data-original="' . $url . '" alt="' .
$this->author . '" width="' . $size . '" height="' . $size . '" />';
}
}
} 转载本站原创文章请注明:文章转自 挨踢路,链接: https://itlu.net/articles/2129.html
直接去掉www,加上https就可以了。
还是多说吧,国内速度比较快