You are here

function fb_get_fbu in Drupal for Facebook 7.3

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

Given a local user id, find the facebook id.

Invokes hook_fb(FB_OP_GET_FBU) in order to ask other modules what the fbu is. Typically, fb_user.module will answer the question.

11 calls to fb_get_fbu()
fb_app_user in ./fb_app.module
Implements hook_user.
fb_devel_info in ./fb_devel.module
fb_devel_page in ./fb_devel.module
Provides a page with useful debug info.
fb_devel_user_view in ./fb_devel.module
Implements hook_user_view().
fb_get_object_fbu in ./fb.module
Convenience function to learn the fbu associated with a user, node or comment. Used in theming (X)FBML tags.

... See full list

File

./fb.module, line 1111
This is the core required module of Drupal for Facebook.

Code

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

  // Accept either a user object or uid passed in.
  if (is_object($uid) && isset($uid->uid) && !empty($uid->fbu)) {
    return $uid->fbu;
  }
  elseif (is_object($uid)) {
    $uid = isset($uid->uid) ? $uid->uid : 0;
  }
  if ($uid) {

    // User management is handled by another module. Use our hook to ask for mapping.
    $fbu = fb_invoke(FB_OP_GET_FBU, array(
      'uid' => $uid,
      'fb' => $GLOBALS['_fb'],
    ));
  }
  else {
    $fbu = NULL;
  }
  return $fbu;
}