You are here

function fb_devel_fbu_page in Drupal for Facebook 5

Same name and namespace in other branches
  1. 5.2 fb_devel.module \fb_devel_fbu_page()
  2. 6.3 fb_devel.module \fb_devel_fbu_page()
  3. 6.2 fb_devel.module \fb_devel_fbu_page()
  4. 7.3 fb_devel.module \fb_devel_fbu_page()

A page which tests function which work with facebook user ids

1 string reference to 'fb_devel_fbu_page'
fb_devel_menu in ./fb_devel.module

File

./fb_devel.module, line 97

Code

function fb_devel_fbu_page($fbu = NULL) {
  if ($fbu) {
    $output = "<p>Debug info about facebook id {$fbu}:</p>\n";
    $friends = fb_get_friends($fbu);

    //dpm($friends, "fb_get_friends($fbu) returned");
    $items = array();
    foreach ($friends as $_fbu) {
      $items[] = l($_fbu, "fb/devel/fbu/{$_fbu}");
    }
    if (count($items)) {
      $output .= "\n<p>Known friends:<ul><li>";
      $output .= implode("</li>\n  <li>", $items);
      $output .= "</li></ul></p>\n\n";
    }
    $local_friends = fb_user_get_local_friends($fbu);
    $items = array();
    foreach ($local_friends as $uid) {
      $account = user_load(array(
        'uid' => $uid,
      ));
      $items[] = theme('username', $account);
    }
    if (count($items)) {
      $output .= "\n<p>Local friends:<ul><li>";
      $output .= implode("</li>\n  <li>", $items);
      $output .= "</li></ul></p>\n\n";
    }
  }
  else {
    drupal_set_message("You have to specify a facebook user id.", 'error');
  }
  return $output;
}