You are here

function _flickr_block_photoset_recent in Flickr 6

Recent from photoset block.

1 call to _flickr_block_photoset_recent()
flickr_block in block/flickr_block.module
Implements hook_block().

File

block/flickr_block.module, line 612

Code

function _flickr_block_photoset_recent($nsid, $show_n, $size, $media, $photoset_id) {

  // Get information about the photoset, including the owner.
  $info = flickr_photoset_get_info($photoset_id);
  if (!$info) {
    return;
  }
  $response = flickr_request('flickr.photosets.getPhotos', array(
    'photoset_id' => $photoset_id,
    'per_page' => $show_n,
    'extras' => 'owner',
    'media' => $media,
  ));
  if (!$response) {
    return;
  }
  $output = '';
  foreach ($response['photoset']['photo'] as $photo) {

    // Insert owner into $photo because theme_flickr_photo needs it.
    $photo['owner'] = $info['owner'];
    $output .= theme('flickr_block_photo', $photo, $size);
  }
  return $output;
}