You are here

function fb_graph_user_view in Drupal for Facebook 7.3

Implements hook_user_view().

File

./fb_graph.module, line 377
Open Graph Helpers

Code

function fb_graph_user_view($account, $view_mode, $langcode) {
  if ($view_mode == 'full') {

    // Add smart default tags.
    $tags = fb_graph_get_tags();
    if (!isset($tags['og:type']) && variable_get(FB_GRAPH_VAR_SMART_TAGS, TRUE)) {
      fb_graph_set_tag('og:type', 'profile');

      // http://developers.facebook.com/docs/beta/opengraph/objects/builtin/
      fb_graph_set_tag('og:url', url('user/' . $account->uid, array(
        'absolute' => TRUE,
      )), FALSE);
      fb_graph_set_tag('profile:username', $account->name, FALSE);
    }
  }
}