Gravatar头像被墙之后,Typecho头像就显示不出来了
解决方案如下:
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 = 'https://secure.gravatar.com/avatar/';
if (!empty($this->mail)) {$url .= $mailHash;}
$url .= '?s=' . $size;
$url .= '&r=' . $rating;
$url .= '&d=' . $default;
echo '<img class="avatar" src="' . $url . '" alt="' .
$this->author . '" width="' . $size . '" height="' . $size . '" />';
}
}
}
这个方法有意思.
@筛宝 是啊,没想到那么简单就搞定了
我看看
@一零网赚 是可以用的,亲测了
能告知这是模板下文件还是内核文件呢?