api_key . "&per_page=20&content_type=1&text=" . rawurlencode($search . " concert"); debug_event($this->name, 'Calling ' . $url, '5'); $request = Requests::get($url); if ($request->status_code == 200) { $xml = simplexml_load_string($request->body); if ($xml) { foreach ($xml->photos->photo as $photo) { $photos[] = array( 'title' => $photo->title, 'url' => "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . "_m.jpg", ); } } } return $photos; } /** * load * This loads up the data we need into this object, this stuff comes * from the preferences. */ public function load($user) { $user->set_preferences(); $data = $user->prefs; if (strlen(trim($data['flickr_api_key']))) { $this->api_key = trim($data['flickr_api_key']); } else { debug_event($this->name,'No Flickr api key, photo plugin skipped','3'); return false; } return true; } // load } // end Ampacheflickr ?>