We are using the fopen() function to check whether the file does still exist on the external server before we start our image manipulation.
Seems like url file access is blocked on your server. I don't know whether this is done via your provider or if you can switch it on in your php.ini
http://www.php.net/manual/en/filesys...figuration.php
That would be your first option.
Second option ist to replace this code:
Code:
$filehandle = fopen($article['previewimage'], 'r');
if(is_resource($filehandle))
{
fclose($filehandle);
with the curl based file check (your server needs to have cUrl for that.
Code:
$can_open_file = false;
if(strpos($article['previewimage'], 'http://') === false)
{
$can_open_file = is_readable($article['previewimage']);
}
else
{
// initialize a new curl resource
$ch = curl_init();
// set the url to fetch
curl_setopt($ch, CURLOPT_URL, $article['previewimage']);
//exclude the header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//exclude the body
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
// return the value instead of printing the response to browser
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//take the content as a instance
//$filehandle = curl_exec($ch);
if(!curl_errno($ch))
{
$can_open_file = true;
}
curl_close($ch);
}
if($can_open_file)
{
If that doesn't work you can try to ignore the file_check and see if the GD url access isn't blocked (like fopen() is).
So the third option would be:
Replace
Code:
$filehandle = fopen($article['previewimage'], 'r');
if(is_resource($filehandle))
{
fclose($filehandle);
with
If that doesn't work i'm out of options.
P.S.: On my testsite i have the curl option running right now.