Google Reader Widget 插件

星期一, 十月 8th, 2007

从暑假开始使用 Google Reader ,最初只是用它最基本的功能——订阅。渐渐地,不再满足于简单阅读,开始使用星标、分享等功能。前几天突然想把我的 Google Reader 的分享内容加到我的侧边栏里,于是搜索了一圈,试用了几个插件,最后选定了 Google Reader Widget 这个插件。这个插件带有 widget ,添加方便,而且可以设置显示的方式。 现在本地测试了一下,没什么问题,顺便修改了一下默认的显示设置。但是传到本站却显示不了任何条目。在站点里找到一个error_log文件,里面有如下警告: PHP Warning: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration in /.../wp-content/plugins/googlereader.php on line 56 原来我的服务器的php.ini里的设置导致 file_get_contents 函数不能以 URL 作为参数,但是我又无法更改这个设置。好在 WordPress 给我们提供了一个 Snoopy 类来完成这件事,我在 Fanfou Daily 这个插件里也用到了这个类。修改 googlereader.php 的第56行从 [sourcecode language="php"]$stories = file_get_contents($uri);[/sourcecode] 修改为 [sourcecode language="php"]require_once ABSPATH.WPINC.'/class-snoopy.php'; $client = ...