function _media_flickr_photo_remote_url in Media: Flickr 7
Same name and namespace in other branches
- 7.2 includes/media_flickr.utilities.inc \_media_flickr_photo_remote_url()
This returns a cached photo stream from the Flickr farm servers.
1 call to _media_flickr_photo_remote_url()
File
- includes/
media_flickr.utilities.inc, line 30 - Utility functions for Media: Flickr.
Code
function _media_flickr_photo_remote_url($photo_id, $size) {
$getsize = _media_flickr_sets_request('flickr.photos.getSizes', array(
'photo_id' => $photo_id,
));
if ($getsize && $getsize['@attributes']['stat'] != 'fail') {
// If no size was requested, or if a size was requested that doesn't exist
// (e.g. for small images, the sizes 0..4 that _media_flickr_guess_size
// assumes may not actually be there), use the largest size available,
// which is the original image.
$number_of_sizes = count($getsize['sizes']['size']);
if (!isset($size) || $size >= $number_of_sizes) {
$size = $number_of_sizes - 1;
}
return $getsize['sizes']['size'][$size]['@attributes']['source'];
}
}