function fb_form_group_member_options in Drupal for Facebook 6.2
Same name and namespace in other branches
- 5.2 fb_form.module \fb_form_group_member_options()
- 5 fb_form.module \fb_form_group_member_options()
- 6.3 fb_form.module \fb_form_group_member_options()
- 7.3 fb_form.module \fb_form_group_member_options()
File
- ./
fb_form.module, line 270 - This module defines facebook-specific form elements for use with Drupal's form API.
Code
function fb_form_group_member_options($fbg, $fbu) {
global $_fb;
$query = "SELECT uid FROM group_member WHERE gid={$fbg}";
// FQL not SQL, no {curly_brackets}!
$result = $_fb->api_client
->fql_query($query);
$query = "SELECT uid, first_name, last_name FROM user WHERE uid IN (SELECT uid FROM group_member WHERE gid={$fbg})";
// FQL not SQL, no {curly_brackets}
$result = $_fb->api_client
->fql_query($query);
// TODO: sort results by name
$options = array();
foreach ($result as $data) {
if ($data['uid'] != $fbu) {
$options[$data['uid']] = $data['first_name'] . ' ' . $data['last_name'];
}
}
return $options;
}