You are here

function fb_get_link in Drupal for Facebook 7.4

Helper function determines facebook URL for data returned from fb_graph(). Sometimes graph data includes 'link' and sometimes not. If not, the ID is usually enough to find the object. Note however that whether the link succeeds may depend on whether the user who follows the link is logged into facebook and whether they have permission to see the object.

2 calls to fb_get_link()
fb_admin_tokens_form in ./fb.admin.inc
fb_admin_token_info in ./fb.admin.inc
Display detailed information about a token.

File

./fb.module, line 1731

Code

function fb_get_link($graph_data) {
  if (!empty($graph_data['link'])) {
    return $graph_data['link'];
  }
  elseif (!empty($graph_data['id'])) {
    return 'http://www.facebook.com/' . $graph_data['id'];
  }
  else {
    return '';
  }
}