You are here

function fbu_load in Drupal for Facebook 7.3

Implementation of a %wildcard_load(). http://drupal.org/node/224170

Handles menu items with %fbu in the path. Simply returns the numerical id.

File

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

Code

function fbu_load($id) {
  if (is_numeric($id)) {
    return $id;
  }
  elseif ($id == 'me') {

    // Drupal stupidly calls this before fb_init()! So _fb may not be initialized.
    if ($GLOBALS['_fb_app'] && !$GLOBALS['_fb']) {
      $fb = fb_api_init($GLOBALS['_fb_app']);
      $fbu = fb_facebook_user($fb);
    }
    else {
      $fbu = fb_facebook_user();
    }
    return $fbu;
  }
  return NULL;
}