Active
Project:
Signup
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2009 at 14:21 UTC
Updated:
27 Nov 2009 at 14:21 UTC
This sort of code appears several times and it could really do to be put into an API function:
// See if the user is already signed up for this node.
$signup = db_fetch_object(db_query("SELECT sl.*, n.title, u.name, u.mail FROM {signup_log} sl INNER JOIN {node} n ON sl.nid = n.nid INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.uid = %d AND sl.nid = %d", $user->uid, $node->nid));
if (empty($signup)) {
Should this also handle retrieving a user's signup details? I don't know the code well enough to know if this would be useful too.
"ack 'SELECT.*{signup_log}'' suggests that there aren't any places where details for a given user and node are loaded.