还有个Typecho的站,因为Gravatar头像被墙,也无法显示了,下面是解决的办法,修改原文件,有人说,一升级版本,又变回去了,但是...Typecho本来更新的就慢,这个没什么了~~~可以这么改!
找到/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 = '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 . '" />'; } } }
好了,就这样了~
$url = Typecho_Common::gravatarUrl($this->mail, $size, $rating, $default, $this->request->isSecure());
只要在在这个函数最后一个参数$this->request->isSecure()改为true 就行了.