改pluginflickr.class.php裡下面的程式碼,從fopen改成curl
$f = @fopen($file,"r"); // Open remote source file
if (!$f) // Remote file couldn't be opened
{
return @file_get_contents ($cache_filename); // Return the file contents from the cache
}
$f2 = @fopen($cache_filename,"w+"); // Open local cache file
while ($r = @fread($f,8192)) // Loop through remote source file
{
@fwrite($f2,$r); // Write to the local cache
}
@fclose($f2);
@fclose($f);
改成curl後程式碼
$curl_handle = curl_init();
if( !$curl_handle ) {
return @file_get_contents ($cache_filename); // Return the file contents form the cache
}
curl_setopt ($curl_handle, CURLOPT_URL, $file);
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl_handle, CURLOPT_CONNECTTIMEOUT, 1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
$f2 = @fopen($cache_filename,"w+"); // Open local cache file
fwrite($f2,$buffer); // Write to the local cache
@fclose($f2);
就可以了