一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Typecho Gravatar头像不能打开问题解决办法

时间:2014-12-24 编辑:简简单单 来源:一聚教程网

还有个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 '' .<br /></a>
                $this->author . '';
            }
        }
    }


好了,就这样了~

热门栏目