汨新 發表於 2023-5-23 00:00:00

Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法

<p>
gravatar是“全球通用头像”,在任何支持gravatar的网站和博客中,填写填写申请注册gravatar头像用的这个email地址,你的头像就会出现在留言和评论系统中。</p>
<p>
笔者的博客核心是基于z-blog博客系统的,从今年6月底博客评论中的gravatar头像便无法正常显示,取而代之的是红色的“×”。刚开始几天一直以为是自己的网络问题,可大半个月过去了还是无法正常显示,心中不禁生疑,猜测可能是gravatar被gfw墙掉了。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" alt="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" border="0" data-bd-imgshare-binded="1" height="265" src="https://zhuji.jb51.net/uploads/img/202305/716310c4e0814346d128fa280de1b38f.jpg" width="520"></p>
<p>
博客中的gravatar头像无法正常显示</p>
<p>
总不能一直等着gravatar解封吧,猴年马月的事情!gravatar头像一直无法正常加载,严重影响博客的打开速度。这里我简单分享一下手动恢复gravatar头像的方法。</p>
<p>
<strong><font color="#ff0000">方法一:修改主题模板中的文章评论页面代码</font>,具体文件为template\b_article_comment.html</strong></p>
<p>
我们打开b_article_comment.html文件,找到代码中的“www.gravatar.com”,将其改为“en.gravatar.com”,或:“0.gravatar.com”、“1.gravatar.com”、“2.gravatar.com”、“3.gravatar.com”、“cn.gravatar.com”。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" alt="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" border="0" data-bd-imgshare-binded="1" height="175" src="https://zhuji.jb51.net/uploads/img/202305/4082d7cb73e51c4f581c7833297813ac.jpg" width="520"></p>
<p>
修改b_article_comment.html文件代码</p>
<p>
然后将修改后的b_article_comment.html文件上传至博客对应目录,登录博客后台进行“文件重建”即可。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" alt="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" border="0" data-bd-imgshare-binded="1" height="150" src="https://zhuji.jb51.net/uploads/img/202305/56f05c969b287928220aeecb93573411.jpg" width="520"></p>
<p>
z-blog博客中的“文件重建”功能</p>
<p>
<strong><font color="#ff0000">方法二:修改hosts文件</font></strong></p>
<p>
记事本方式打开hosts文件(默认位置为:c:\windows\system32\drivers\etc),在最下方添加一行:72.233.69.5 www.gravatar.com</p>
<p>
72.233.69.5是en.gravatar.com的ip地址,因此,我们稍微修改一下hosts文件并保存后关闭,然后打开浏览器,清除缓存,重新登录博客即可正常显示gravatar头像。en.gravatar.com的ip地址目前有4个,一般是72.233.69.5、72.233.69.4、72.233.61.123、72.233.61.125,这4个ip地址都可以使用。</p>
<p>
</p>
<p>
添加“72.233.69.5 www.gravatar.com”至hosts文件</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" alt="Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法" border="0" data-bd-imgshare-binded="1" height="265" src="https://zhuji.jb51.net/uploads/img/202305/e0a54da180af9e9a6dcdf992b8b3cc35.jpg" width="520"></p>
<p>
博客中的gravatar头像恢复正常显示。</p>
頁: [1]
查看完整版本: Z-Blog博客设置技巧:设置Gravatar头像无法显示的方法