function signup_list_user_signups in Signup 5.2
Same name and namespace in other branches
- 5 signup.module \signup_list_user_signups()
- 6.2 includes/no_views.inc \signup_list_user_signups()
Return an array of all nodes the specified user has signed up for.
Parameters
$uid: The ID of the user to generate a list of signups for.
Return value
Array of all nodes the given user has signed up for. The array is indexed by node ID, and contains titles as links to each node.
3 calls to signup_list_user_signups()
- signup_block in includes/
views.none.inc - Implementation of hook_block().
- signup_user_schedule in includes/
views.none.inc - Print a schedule of the given user's signups.
- _signup_user_no_views in includes/
views.none.inc - Private helper as a partial implementation of hook_user().
File
- includes/
views.none.inc, line 119 - Provides all the code for required UI elements for sites that do not have views.module enabled. If views is enabled, there are default views for all of these things (which are therefore customizable and more powerful) in signup/views/views.inc.
Code
function signup_list_user_signups($uid) {
$titles = array();
// We don't want to return anything for anon users.
if ($uid != 0) {
$sql = "SELECT n.nid, n.title FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid WHERE s_l.uid = %d ORDER BY n.nid";
$result = db_query(db_rewrite_sql($sql), $uid);
while ($node = db_fetch_array($result)) {
$titles[$node['nid']] = l($node['title'], 'node/' . $node['nid']);
}
}
return $titles;
}