rsvp_list_buddylist($rid)
rsvp/rsvp.module, line 1356
Returns user's buddylist.
$uid int The RSVP ID.
string The user's buddylist.
<?php
function rsvp_list_buddylist($rid) {
global $user;
$rsvp = rsvp_load($rid);
$content = t('<h3>You may invite your buddylist:</h3>');
$rows = array();
$header = array(t('Buddy'), array('data' => t('Operations')));
$query = db_query("SELECT DISTINCT(b.buddy), u.name FROM {buddylist} b INNER JOIN {users} u ON b.buddy = u.uid WHERE b.uid = %d ORDER BY u.name ASC", $user->uid);
while ($buddy = db_fetch_object($query)) {
$rows[] = array(
$buddy->name,
l(t('Add'), NULL,
array('onclick' => '$("#edit-invite-list").val($("#edit-invite-list").val() + "'. $buddy->name .'\r\n"); return false;'),
NULL,
'add'
),
);
}
$content .= theme('table', $header, $rows);
return $content;
}
?>