Gravatar头像被墙?

综合话题讨论

版主: le720

回复
mybg
帖子: 508
注册时间: 2010年 5月 27日 16:20
联系:

Gravatar头像被墙?

帖子 mybg »

昨天发现评论的头像不能正常显示了,看到好多图片都是XX,应该是http://0.gravatar.com被墙了,但www.gravatar.com可以正常打开。

在WP论坛上看见了一篇文章,改动后可以正常显示头像。

拿过来改一下,在Typecho下同样适用,也可以达到正常显示头像这个目地。

打开/var/Widget/Abstract/Comments.php,
搜索:(在403行)

代码: 全选

$host = 'http://0.gravatar.com';

改为:

代码: 全选

$host = 'https://secure.gravatar.com';

搜索:(在405行)

代码: 全选

http://%d.gravatar.com
改为:

代码: 全选

http://www.gravatar.com
完了,是不是简单呢?你再刷新下评论,头像已能正常显示了吧?
withrock
帖子: 17
注册时间: 2010年 6月 23日 14:20
联系:

Re: Gravatar头像被墙?

帖子 withrock »

我也发现这个问题了
现在就去改
http://mktime.tk
Vanish
帖子: 83
注册时间: 2010年 7月 1日 17:12
联系:

Re: Gravatar头像被墙?

帖子 Vanish »

谢谢分享!~
yaoge
帖子: 307
注册时间: 2010年 6月 5日 08:09
联系:

Re: Gravatar头像被墙?

帖子 yaoge »

原来这样,怪不得呢!我们伟大的“墙”很快要就能实现世界最大的局域网了
withrock
帖子: 17
注册时间: 2010年 6月 23日 14:20
联系:

Re: Gravatar头像被墙?

帖子 withrock »

代码: 全选

                if ($this->request->isSecure()) {
                    $host = 'https://secure.gravatar.com';
                } else {
                    if (empty($this->mail)) {
                        $host = 'http://0.gravatar.com';
                    } else {
                        $host = sprintf( "http://%d.gravatar.com", (hexdec($mailHash{0}) % 2));
                    }
                }

这是重点
好像还不行喔~
http://mktime.tk
awu
帖子: 4
注册时间: 2010年 10月 8日 08:02

Re: Gravatar头像被墙?

帖子 awu »

将 if (empty($this->mail)) {

$host = 'http://0.gravatar.com';

} else {

$host = sprintf( "http://%d.gravatar.com", (hexdec($mailHash{0}) % 2));

}

修改为:$host = 'http://www.gravatar.com';

然后保存即可。

http://www.awuit.com/typecho/the-solution-of-Typecho-the-Gravatar-can-not-show.html
mybg
帖子: 508
注册时间: 2010年 5月 27日 16:20
联系:

Re: Gravatar头像被墙?

帖子 mybg »

怎么会不行?我改了后,就正常显示了
rebill
帖子: 14
注册时间: 2009年 8月 6日 07:54
联系:

Re: Gravatar头像被墙?

帖子 rebill »

代码: 全选

if ($this->request->isSecure()) {
                    $host = 'https://secure.gravatar.com';
                } else {
                    $host = 'http://www.gravatar.com';
                    /*
                    if (empty($this->mail)) {
                        $host = 'http://0.gravatar.com';
                    } else {
                        $host = sprintf( "http://%d.gravatar.com", (hexdec($mailHash{0}) % 2));
                    }
                     */
                }                   

把那段代码注释掉,然后换成

代码: 全选

$host = 'http://www.gravatar.com';

就可以了。

http://blog.rebill.info/archives/Typecho-Theme-Prower-V3-for-typecho0-8.html
头像
m4go
帖子: 857
注册时间: 2010年 3月 29日 02:33
来自: https://www.vpshu.com
联系:

Re: Gravatar头像被墙?

帖子 m4go »

我用的缓存插件,没发现有这些问题啊。
percy
帖子: 7
注册时间: 2010年 10月 1日 02:48

Re: Gravatar头像被墙?

帖子 percy »

回复