You are here

function fb_get_fbu in Drupal for Facebook 5

Same name and namespace in other branches
  1. 5.2 fb.module \fb_get_fbu()
  2. 6.3 fb.module \fb_get_fbu()
  3. 6.2 fb.module \fb_get_fbu()
  4. 7.3 fb.module \fb_get_fbu()

Given a local user id, find the facebook id.

11 calls to fb_get_fbu()
action_fb_set_profile_fbml in ./fb_actions.module
Implementation of an Action. See Actions module.
action_fb_write_minifeed in ./fb_actions.module
Implementation of an Action. See Actions module.
fb_actions_minifeed in ./fb_actions.module
fb_actions_profile_fbml in ./fb_actions.module
fb_app_user in ./fb_app.module
Implementation of hook_user.

... See full list

File

./fb.module, line 278

Code

function fb_get_fbu($uid, $fb_app = NULL) {

  // default to current app (only set if we're in a FB callback)
  if (!$fb_app) {
    $fb_app = $GLOBALS['fb_app'];
  }

  // Accept either a user object or uid passed in.
  if (is_object($uid) && $uid->fbu) {
    return $uid->fbu;
  }
  else {
    if (is_object($uid)) {
      $uid = $uid->uid;
    }
  }

  // User management is handled by another module.  Use our hook to ask for mapping.
  $fbu = _fb_invoke($fb_app, FB_OP_GET_FBU, NULL, array(
    'uid' => $uid,
  ));
  return $fbu;
}