You are here

function fb_user_view_page in Drupal for Facebook 7.3

Menu page callback. Send user to local profile page of a facebook user.

1 string reference to 'fb_user_view_page'
fb_user_menu in ./fb_user.module
Implements hook_menu().

File

./fb_user.module, line 109
This module manages relations between local Drupal user accounts and their accounts on facebook.com.

Code

function fb_user_view_page($fb_user) {
  if ($uid = fb_get_uid($fb_user['id'])) {

    // Send user to Drupal profile page. The primary purpose of this callback.
    drupal_goto("user/{$uid}");
  }

  // A very simple page.
  $output['picture'] = array(
    '#type' => 'markup',
    '#markup' => '<img src="//graph.facebook.com/' . $fb_user['id'] . '/picture" alt="' . $fb_user['name'] . '" />',
  );
  return $output;
}