You are here

function fb_facebook_user in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 5 fb.module \fb_facebook_user()
  2. 6.3 fb.module \fb_facebook_user()
  3. 6.2 fb.module \fb_facebook_user()
  4. 7.4 fb_devel.module \fb_facebook_user()
  5. 7.3 fb.module \fb_facebook_user()

Returns the facebook user id currently visiting a canvas page, or if set_user has been called. Unlike fb_get_fbu(), works only on canvas pages or when infinite session has been initialized.

11 calls to fb_facebook_user()
fb_app_user in ./fb_app.module
Implementation of hook_user.
fb_devel_canvas_info in ./fb_devel.module
fb_form_friend_selector_process in ./fb_form.module
A selector allowing the user to choose from their friends. This must behave differently depending on whether the form is displayed on an FBML canvas page, iframe canvas page, or regular HTML page.
fb_form_multi_add_invite_form in ./fb_form.module
Create a form allowing the user to invite friends to add the app.
fb_get_friends in ./fb.module
A convenience method for returning a list of facebook friends. This should work efficiently in canvas pages for finding friends of the current user. In other cases it tries to work, but will be an expensive operation and only succeed when the user…

... See full list

1 string reference to 'fb_facebook_user'
fb_user_load in ./fb.module

File

./fb.module, line 320

Code

function fb_facebook_user($fb = NULL) {
  if (!isset($fb)) {
    $fb = $GLOBALS['fb'];
  }
  if (!$fb) {
    return;
  }
  $fbu = $fb
    ->get_loggedin_user();
  if ($fb->api_client->error_code) {
    watchdog('fb', 'Failed to get Facebook user id.', 'error');
    if (function_exists('dprint_r')) {
      watchdog('fb', 'Failed to get Facebook user id.  detail:' . dprint_r($_REQUEST, 1), 'error');
    }
  }
  return $fbu;
}