function fb_app_user in Drupal for Facebook 5
Same name and namespace in other branches
- 5.2 fb_app.module \fb_app_user()
- 6.3 fb_app.module \fb_app_user()
- 6.2 fb_app.module \fb_app_user()
- 7.3 fb_app.module \fb_app_user()
Implementation of hook_user.
File
- ./
fb_app.module, line 371 - Defines a custom node type that stores a facebook application configuration.
Code
function fb_app_user($op, &$edit, &$account, $category = NULL) {
$items = array();
if ($op == 'view') {
$result = _fb_app_query_all();
while ($fb_app = db_fetch_object($result)) {
// Learn this user's FB id
$fbu = fb_get_fbu($account->uid, $fb_app);
if ($fbu) {
// The drupal user is a facebook user. Now, learn more from facebook.
$fb = fb_api_init($fb_app, FB_FBU_ANY);
if (fb_facebook_user($fb)) {
$info = $fb->api_client
->users_getInfo(array(
$fbu,
), array(
'about_me',
'affiliations',
'name',
'is_app_user',
'pic_big',
'profile_update_time',
'status',
));
}
if (count($info)) {
$output = theme('fb_app_user_info', $fb_app, $info[0]);
$items[$fb_app->label] = array(
'title' => $fb_app->title,
'value' => $output,
'class' => 'fb_app',
);
}
else {
fb_report_errors($fb);
}
}
}
if (count($items)) {
return array(
t('Facebook') => $items,
);
}
}
}