You are here

function flickr_get_user_info in Flickr 7

Returns Flickr detialed data based on nsid. An elaboration of flickr_people_getinfo.

Parameters

string $nsid: A valid Flickr numerical user ID. Should be validated before arriving here.

Return value

array $people HTML with a Flickr user's name that links to their Flickr profile. Real name if it exists, if not the username.

3 calls to flickr_get_user_info()
flickr_album in ./flickr.inc
Render multiple photos as an album.
flickr_block_view in block/flickr_block.module
Implements hook_block_view().
theme_flickr_photo in ./flickr.module
Theme Flickr photo.

File

./flickr.inc, line 516
The Flickr API functions.

Code

function flickr_get_user_info($nsid) {
  $info = flickr_people_getinfo($nsid);
  $people = array();
  $people['name'] = !empty($info['realname']['_content']) ? l($info['realname']['_content'], $info['profileurl']['_content'], array(
    'attributes' => array(
      'title' => t('View user on Flickr.'),
      'target' => '_blank',
    ),
  )) : l($info['username']['_content'], $info['profileurl']['_content'], array(
    'attributes' => array(
      'title' => t('View user on Flickr.'),
      'target' => '_blank',
    ),
  ));
  $username = strip_tags($people['name']);
  $people['photostream'] = l(t("!user on Flickr", array(
    '!user' => $username,
  )), $info['photosurl']['_content'], array(
    'attributes' => array(
      'title' => t('View Flickr photostream.'),
      'target' => '_blank',
    ),
    'html' => TRUE,
  ));
  $people['photosurl'] = $info['photosurl']['_content'];
  $people['profileurl'] = $info['profileurl']['_content'];
  $people['count'] = $info['photos']['count']['_content'];
  return $people;
}