smartrss

成功安装上smartrss插件

Posted by admin on November 19, 2007 in 博客公告

dreamhost的主机默认不支持smartrss插件,查看了国外一些解决方案,找到了以下不错的办法,特分享给大家。
I solved this error with change file() and implode() function with curl function from wp_smartrss.php.
Look at line 29 at original source code(wp_smartrss.php), you can find :

$data = implode(“”, file($filename));

Replace with

if(ini_get(allow_url_fopen)){

$data = implode(“”, file($filename));

}elseif(function_exists(curl_init)){

?$ch = curl_init();

$timeout = 5; // set to zero for no timeout

?curl_setopt ($ch, CURLOPT_URL, $filename );

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

?curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

$data = [...]