Maak Van Jouw Probleem Niet Mijn Probleem

Recent Posts

Most Popular Tags

werk 2008 vakantie Stagehands Maarten 2007 2006 2010 prive Scouting foto huis OJW wintersport auto menorah kerk muziek Gedicht school itunes nieuws 2009 multatuli Pater-Moeskroen cwi sporten vrienden apple operatie internet telefoon uitkering eten trouwerij

Archief

Meta

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

Write a comment