You are here

function image_ncck_flickr_data in Embedded Media Field 5

1 call to image_ncck_flickr_data()
image_ncck_flickr_import in contrib/image_ncck/providers/flickr.inc
This allows flickr photosets to be imported into nodes

File

contrib/image_ncck/providers/flickr.inc, line 126

Code

function image_ncck_flickr_data($field, $item) {
  $data = array();

  // use the page id, since we'll have that in most cases (except in embed pastes, which gets parsed during extraction)
  // we use this to get an rss feed w/ all the info for the video. interesting reading ;)
  $xml = image_ncck_flickr_request('flickr.photos.getInfo', array(
    'photo_id' => $item['value'],
  ));
  $data['owner'] = $xml['photo']['owner']['nsid'];
  $data['title'] = $xml['photo']['title']['_content'];
  $data['description'] = $xml['photo']['description']['_content'];
  $data['tags'] = array();
  if (is_array($xml['photo']['tags']['tag'])) {
    foreach ($xml['photo']['tags']['tag'] as $tag) {
      $data['tags'][] = $tag['raw'];
    }
  }
  return $data;
}