updating photoshelter gallery widget plugin to curl
It seems that my hoster has decided to block external file_get_contents requests for the safety of the system.
Good idea, only some of the plug-ins i have running on http://www.kitesurfpics.com are using that function to get update’s from the photo gallery that is hosted somewhere else.
To fix the code in the photoshelter gallery widget plugin you have to do the following:
Change this line (line 51) of code:
$rssXML = file_get_contents($rssUrl);
into this:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $rssUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$rssXML = curl_exec($ch);
curl_close($ch);
and instead of file_get_contents you are using the safer curl function
Posted: November 17th, 2011 under Site.
Comments: none
Write a comment