You are here

function flickr_user_find_by_identifier in Flickr 7

Same name and namespace in other branches
  1. 5 flickr.inc \flickr_user_find_by_identifier()
  2. 6 flickr.inc \flickr_user_find_by_identifier()

Tries to match an 'identifier' onto a flickr nsid.

This function will first see whether $identifier is already a nsid (format check only, no api call). If it is not and the identifier has the format of an email, an api call will be made to check whether there is an nsid for that email. If this is not the case, the $identifier is treated as a username and an api call is made to find the nsid for that username.

If none of these succeed, the result will be false

Parameters

string $identifier: Identifier to find an NSID for.

Return value

array Valid NSID or false if none can be found.

10 calls to flickr_user_find_by_identifier()
flickr_admin_settings_submit in ./flickr.admin.inc
Submit form data.
flickr_admin_settings_validate in ./flickr.admin.inc
Validate user input.
flickr_block_save in block/flickr_block.module
Implements hook_block_save().
flickr_block_view in block/flickr_block.module
Implements hook_block_view().
flickr_filter_callback_album in filter/flickr_filter.module
Filter callback for a user or set.

... See full list

File

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

Code

function flickr_user_find_by_identifier($identifier) {
  if (flickr_is_nsid($identifier)) {

    // Identifier is an NSID.
    return $identifier;
  }
  if (valid_email_address($identifier) && ($user = flickr_people_findbyemail($identifier))) {
    return $user['nsid'];
  }
  if ($user = flickr_urls_lookupuser($identifier)) {
    return $user['id'];
  }
  if ($user = flickr_people_findbyusername($identifier)) {
    return $user['nsid'];
  }
  return FALSE;
}