diff --git INSTALL.txt INSTALL.txt
index e5547ac..fb92936 100644
--- INSTALL.txt
+++ INSTALL.txt
@@ -106,6 +106,7 @@ the Drupal package and read the online documentation.
    the event module, you might want to add a filter to the 'current
    signups' view to restrict it to events that have not started yet.
 
+
 8. (Optional) Configure if and how you want a list of users signed up
    for each node to appear.  Under the 'Advanced settings' at
    admin/settings/signup, if the signup form and related information
diff --git README.txt README.txt
index 52e1fd9..89feb05 100644
--- README.txt
+++ README.txt
@@ -17,17 +17,17 @@ Both can receive confirmation and reminder emails, and registered
 users are optionally able to cancel or edit their own signups and view
 listings of their current signups.
 
-The Views module (http://druapl.org/project/views) is a dependency
+The Views module (http://drupal.org/project/views) is a dependency
 which is used to create various listings, and there is extensive views
 support for your own customizations.  Installing the View Bulk
-Operations (VBO) module (http://druapl.org/project/views_bulk_operations)
+Operations (VBO) module (http://drupal.org/project/views_bulk_operations)
 is strongly encouraged to facilitate various administrative tasks.
 There is also support to embed the signup form as a pane using panels
-(http://druapl.org/project/panels).
+(http://drupal.org/project/panels).
 
 Some add-on modules that enhance the basic functionality are available
 in the "modules" subdirectory, and there is a listing of other add-on
-modules on the Signup project page (http://druapl.org/project/signup).
+modules on the Signup project page (http://drupal.org/project/signup).
 
 For installation instructions, see INSTALL.txt.
 
--- includes/admin.settings.inc
+++ includes/admin.settings.inc
@@ -4,23 +4,24 @@
 
 /**
  * @file
- * Code required for the signup settings page (admin/settings/signup).
+ * Code required for the signup settings page (admin/config/people/signup).
  */
 
 /**
- * Form builder for the settings page under admin/setttings/signup
+ * Form builder for the settings page under admin/config/people/signup
  */
-function signup_settings_form() {
+function signup_settings_form($form, &$form_state) {
   module_load_include('inc', 'signup', 'includes/node_settings');
   if (signup_site_has_dates()) {
     $form['signup_close_early'] = array(
       '#title' => t('Close x hours before'),
       '#type' => 'textfield',
       '#default_value' => variable_get('signup_close_early', 1),
-      '#size' => 5, '#maxlength' => 10,
+      '#size' => 5,
+      '#maxlength' => 10,
       '#description' => t('The number of hours before the event which signups will no longer be allowed. Use negative numbers to close signups after the event start (example: -12).'),
     );
-  };
+  }
   $form['node_defaults'] = array(
     '#type' => 'fieldset',
     '#title' => t('Default signup information'),
@@ -44,7 +45,7 @@ function signup_settings_form() {
       'large' => t('Large'),
     ),
     '#default_value' => variable_get('signup_date_format', 'small'),
-    '#description' => t('Whenever this module needs to print a date (both in the administrative interface, and in the various e-mail messages it can send), this setting controls which date format string to use. The format strings are defined at the <a href="!settings_url">Date and time settings page</a>.', array('!settings_url' => url('admin/settings/date-time'))),
+    '#description' => t('Whenever this module needs to print a date (both in the administrative interface, and in the various e-mail messages it can send), this setting controls which date format string to use. The format strings are defined at the <a href="!settings_url">Date and time settings page</a>.', array('!settings_url' => url('admin/config/date-time'))),
   );
   $form['adv_settings']['signup_ignore_default_fields'] = array(
     '#type' => 'checkbox',
@@ -62,8 +63,7 @@ function signup_settings_form() {
       'none' => t('Do not display signup form'),
     ),
     '#default_value' => variable_get('signup_form_location', 'node'),
-    '#description' => t('On every signup-enabled node, users with permission to
- sign up can be presented with a form. This setting controls where this form should be displayed: either directly on the node itself, on a separate tab, or not at all.'),
+    '#description' => t('On every signup-enabled node, users with permission to sign up can be presented with a form. This setting controls where this form should be displayed: either directly on the node itself, on a separate tab, or not at all.'),
     '#prefix' => '<div class="signup-form-location-radios">',
     '#suffix' => '</div>',
   );
@@ -77,7 +77,7 @@ function signup_settings_form() {
   // form is being displayed.  We use jQuery to hide settings when they're not
   // relevant.
   $signup_path = drupal_get_path('module', 'signup');
-  drupal_add_js($signup_path .'/js/admin.settings.js');
+  drupal_add_js($signup_path . '/js/admin.settings.js');
 
   // For each setting that should be hidden, system.css will hide all the
   // settings on page load if JS is enabled.
@@ -88,10 +88,13 @@ function signup_settings_form() {
   $form['adv_settings']['signup_fieldset_collapsed'] = array(
     '#title' => t('Default fieldset behavior for per-node signup form'),
     '#type' => 'radios',
-    '#options' => array(1 => t('Collapsed'), 0 => t('Expanded')),
+    '#options' => array(
+      1 => t('Collapsed'),
+      0 => t('Expanded'),
+    ),
     '#default_value' => variable_get('signup_fieldset_collapsed', 1),
     '#description' => t('If the signup form is included on each node, the signup form will be encapsulated in a collapsible fieldset. This setting controls if that fieldset is expanded or collapsed by default.'),
-    '#prefix' => '<div class="'. $class .'">',
+    '#prefix' => '<div class="' . $class . '">',
     '#suffix' => '</div>',
   );
 
@@ -133,7 +136,7 @@ function signup_settings_form() {
     $class .= ' js-hide';
   }
   $form['adv_settings']['view_settings'] = array(
-    '#prefix' => '<div class="'. $class .'">',
+    '#prefix' => '<div class="' . $class . '">',
     '#suffix' => '</div>',
     '#weight' => 2,
   );
@@ -142,8 +145,11 @@ function signup_settings_form() {
   foreach ($views as $view) {
     foreach (array_keys($view->display) as $display_id) {
       if ($display_id != 'default' || 1) {
-        $key = $view->name .':'. $display_id;
-        $view_options[$key] = theme('signup_settings_view_label', $view, $display_id);
+        $key = $view->name . ':' . $display_id;
+        $view_options[$key] = theme('signup_settings_view_label', array(
+          'view' => $view,
+          'display_id' => $display_id,
+        ));
       }
     }
   }
@@ -160,7 +166,7 @@ function signup_settings_form() {
     $class .= ' js-hide';
   }
   $form['adv_settings']['admin_view_settings'] = array(
-    '#prefix' => '<div class="'. $class .'">',
+    '#prefix' => '<div class="' . $class . '">',
     '#suffix' => '</div>',
     '#weight' => 6,
   );
@@ -190,22 +196,26 @@ function signup_settings_form() {
  */
 function signup_settings_form_submit($form, &$form_state) {
   $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
-  if ($op == t('Save configuration') && db_result(db_query('SELECT COUNT(*) FROM {signup} WHERE nid = 0'))) {
-    $values = array(
-      $form_state['values']['signup_forwarding_email'],
-      $form_state['values']['signup_send_confirmation'],
-      $form_state['values']['signup_confirmation_email'],
-      $form_state['values']['signup_close_signup_limit'],
-    );
-    $values[] = isset($form_state['values']['signup_send_reminder']) ? $form_state['values']['signup_send_reminder'] : 0;
-    $values[] = isset($form_state['values']['signup_reminder_days_before']) ? $form_state['values']['signup_reminder_days_before'] : 0;
-    $values[] = isset($form_state['values']['signup_reminder_email']) ? $form_state['values']['signup_reminder_email'] : '';
-    $values[] = 0;  // "nid" of the row in {signup} for the global settings.
-    db_query("UPDATE {signup} SET forwarding_email = '%s', send_confirmation = %d, confirmation_email = '%s', close_signup_limit = %d, send_reminder = %d, reminder_days_before = %d, reminder_email = '%s' WHERE nid = %d", $values);
+  if ($op == t('Save configuration') && (bool) db_query_range('SELECT 1 FROM {signup} WHERE nid = :nid', 0, 1, array(':nid' => 0))->fetchField()) {
+    // TODO Please review the conversion of this statement to the D7 database API syntax.
+    db_update('signup')
+      ->fields(array(
+      'forwarding_email' => $form_state['values']['signup_forwarding_email'],
+      'send_confirmation' => $form_state['values']['signup_send_confirmation'],
+      'confirmation_email' => $form_state['values']['signup_confirmation_email'],
+      'close_signup_limit' => $form_state['values']['signup_close_signup_limit'],
+      'reminder_days_before' => isset($form_state['values']['signup_reminder_days_before']) ? $form_state['values']['signup_reminder_days_before'] : 0,
+      'send_reminder' => isset($form_state['values']['signup_send_reminder']) ? $form_state['values']['signup_send_reminder'] : 0,
+      'reminder_email' => isset($form_state['values']['signup_reminder_email']) ? $form_state['values']['signup_reminder_email'] : '',
+    ))
+      ->condition('nid', 0)
+      ->execute();
   }
   else {
     module_load_include('install', 'signup', 'signup');
-    db_query("DELETE FROM {signup} WHERE nid = 0");
+    db_delete('signup')
+      ->condition('nid', 0)
+      ->execute();
     signup_insert_default_signup_info();
   }
 
@@ -248,13 +258,16 @@ function signup_settings_form_submit($form, &$form_state) {
  *
  * @see signup_settings_form()
  */
-function theme_signup_settings_view_label($view, $display_id) {
+function theme_signup_settings_view_label($variables) {
+  $view = $variables['view'];
+  $display_id = $variables['display_id'];
+
   $display_title = check_plain($view->display[$display_id]->display_title);
   $label = $view->name;
-  $label .= ' ['. $display_title .']: ';
+  $label .= ' [' . $display_title . ']: ';
   $label .= $view->description;
   if (drupal_strlen($label) > 90) {
-    $label = drupal_substr($label, 0, 90) .'...';
+    $label = drupal_substr($label, 0, 90) . '...';
   }
   return $label;
 }
diff --git includes/admin.signup_administration.inc includes/admin.signup_administration.inc
index a1f281a..415c292 100644
--- includes/admin.signup_administration.inc
+++ includes/admin.signup_administration.inc
@@ -11,16 +11,22 @@
  * Print the admin signup overview page located at admin/content/signup.
  */
 function signup_admin_page() {
-  drupal_add_css(drupal_get_path('module', 'signup') .'/signup.css');
   $filter_status_form = drupal_get_form('signup_filter_status_form');
   $signup_admin_form = drupal_get_form('signup_admin_form');
-  return theme('signup_admin_page', $filter_status_form, $signup_admin_form);
+  return array(
+    '#theme' => 'signup_admin_page',
+    '#attached' => array(
+      'css' => array(drupal_get_path('module', 'signup') . '/signup.css'),
+    ),
+    '#filter_status_form' => $filter_status_form,
+    '#signup_admin_form' => $signup_admin_form,
+  );
 }
 
 /**
  * Form builder for the signup status filter on the signup administration page.
  */
-function signup_filter_status_form(&$form_state) {
+function signup_filter_status_form($form, &$form_state) {
   $options = array(
     'all' => t('All'),
     'open' => t('Open'),
@@ -35,8 +41,11 @@ function signup_filter_status_form(&$form_state) {
     '#options' => $options,
     '#default_value' => $_SESSION['signup_status_filter'],
   );
-  $form['submit'] = array('#type' => 'submit', '#value' => t('Filter'));
-//  $form['#redirect'] = FALSE;
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Filter'),
+  );
+  //  $form_state['#redirect'] = FALSE;
   return $form;
 }
 
@@ -50,16 +59,29 @@ function signup_filter_status_form_submit($form, &$form_state) {
 /**
  * Form builder for the main form on the signup administration page.
  */
-function signup_admin_form($form_state) {
+function signup_admin_form($form, &$form_state) {
   // Figure out if the current user has permission to use signup broadcast.
   $access_broadcast = user_access('email all signed up users');
 
   $header = array(
-    array('data' => t('Title'), 'field' => 'n.title', 'sort' => 'asc'),
-    array('data' => t('Signups'), 'field' => 'signup_total'),
-    array('data' => t('Limit'), 'field' => 'signup_close_signup_limit'),
-    array('data' => t('Status'), 'field' => 'signup_status'),
-    array('data' => t('Operations')),
+    'title' => array(
+      'data' => t('Title'),
+      'field' => 'n.title',
+      'sort' => 'asc',
+    ),
+    'total' => array(
+      'data' => t('Signups'),
+      'field' => 'signup_total',
+    ),
+    'limit' => array(
+      'data' => t('Limit'),
+      'field' => 'signup_close_signup_limit',
+    ),
+    'status' => array(
+      'data' => t('Status'),
+      'field' => 'signup_status',
+    ),
+    'operations' => array('data' => t('Operations')),
   );
 
   $start_column = signup_admin_form_header();
@@ -69,56 +91,61 @@ function signup_admin_form($form_state) {
 
   list($sql, $sql_count) = signup_admin_form_sql();
 
-  $form['header']['#value'] = $header;
-
-  $sql .= tablesort_sql($header);
-
-  $result = pager_query($sql, 25, 0, $sql_count);
+  $result = db_query_range($sql, 0, 25);
 
   // Loop through the signup nodes, and generate our form elements
-  while ($signup_node = db_fetch_object($result)) {
+  $rows = array();
+  foreach ($result as $signup_node) {
     $row = array();
     if (!empty($start_column)) {
       $row['start'] = signup_admin_form_extra($signup_node);
     }
-
     // Instead of duplicating the logic from the node/N/signups admin
     // form, we just call that form builder here and lift the elements
     // we need directly from that.
     module_load_include('inc', 'signup', 'includes/node_admin_summary');
-    $node_admin_form = signup_node_admin_summary_form(array(), $signup_node);
+    $new_form_state = array();
+    $node_admin_form = signup_node_admin_summary_form(array(), $new_form_state, $signup_node);
     $row['title'] = array(
-      '#type' => 'markup',
-      '#value' => l($signup_node->title, "node/$signup_node->nid"),
-    );
-    $row['status'] = $node_admin_form['status'];
-    unset($row['status']['#title']);
-    $row['total'] = array(
-      '#type' => 'markup',
-      '#value' => $signup_node->signup_total,
+      'data' => array(
+        '#type' => 'link',
+        '#title' => $signup_node->title,
+        '#href' => "node/$signup_node->nid",
+      ),
     );
-    $row['limit'] = $node_admin_form['limit'];
-    unset($row['limit']['#title']);
+    $row['status']['data'] = $node_admin_form['status'];
+    unset($row['status']['data']['#title']);
+    $row['total'] = $signup_node->signup_total;
+    $row['limit']['data'] = $node_admin_form['limit'];
+    unset($row['limit']['data']['#title']);
     $op_links = l(t('View signups'), "node/$signup_node->nid/signups");
     if ($access_broadcast) {
       $op_links .= '<br />';
       $options['attributes']['title'] = t('Send an email message to all users who signed up.');
       $op_links .= l(t('Signup broadcast'), "node/$signup_node->nid/signups/broadcast", $options);
     }
-    $row['operations'] = array(
-      '#type' => 'markup',
-      '#value' => $op_links,
-    );
-    $form['nids'][$signup_node->nid] = $row;
+    $row['operations'] = $op_links;
+    $rows[$signup_node->nid] = $row;
   }
   $form['#tree'] = TRUE;
+  $form['nids'] = array(
+    '#type' => 'tableselect',
+    '#header' => $header,
+    '#options' => $rows,
+    '#empty' => t('No signups available.'),
+  );
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Update'),
   );
+  $form['pager'] = array('#markup' => theme('pager'));
   return $form;
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_admin_form_header() {
   if (module_exists('date')) {
     // If we're using CCK date, we can't sort since the date field used for
@@ -133,13 +160,20 @@ function signup_admin_form_header() {
   return array();
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_admin_form_extra($signup_node) {
   return array(
-    '#type' => 'markup',
-    '#value' => signup_format_date($signup_node),
+    '#markup' => signup_format_date($signup_node),
   );
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_admin_form_sql() {
   $admin_common_sql = array(
     'primary' => '{node} n',
@@ -188,12 +222,18 @@ function signup_admin_form_sql() {
   $all_fragments = array_merge_recursive($admin_common_sql, $admin_sql);
   $sql_count = "SELECT COUNT(s.nid) FROM {signup} s";
   if (!empty($all_fragments['where'])) {
-    $sql_count .= ' WHERE '. implode(' AND ', $all_fragments['where']);
+    $sql_count .= ' WHERE ' . implode(' AND ', $all_fragments['where']);
   }
 
-  return array(db_rewrite_sql($sql), db_rewrite_sql($sql_count, 's'));
+  // TODO: This should be a dynamic query tagged 'node_access'.
+  return array($sql, $sql_count);
+  // return array(db_rewrite_sql($sql), db_rewrite_sql($sql_count, 's'));
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_admin_form_submit($form, &$form_state) {
   module_load_include('inc', 'signup', 'includes/node_admin_summary');
   foreach ($form_state['values']['nids'] as $nid => $values) {
diff --git includes/broadcast.inc includes/broadcast.inc
index 6648121..ffbbe09 100644
--- includes/broadcast.inc
+++ includes/broadcast.inc
@@ -13,11 +13,14 @@
  * @param $node
  *   The node that the broadcast form is being attached to.
  */
-function signup_broadcast_form($form_state, $node) {
+function signup_broadcast_form($form, $form_state, $node) {
+
+  drupal_set_title($node->title);
+
   $signups = signup_get_signups($node->nid);
   if (empty($signups)) {
     $form['no_users'] = array(
-      '#value' => t('No users have signup up for this %node_type.', array('%node_type' => node_get_types('name', $node->type))),
+      '#markup' => t('No users have signup up for this %node_type.', array('%node_type' => node_type_get_name($node->type))),
     );
     return $form;
   }
@@ -42,7 +45,7 @@ function signup_broadcast_form($form_state, $node) {
     '#type' => 'textarea',
     '#title' => t('Message body'),
     '#required' => TRUE,
-    '#description' => t('Body of the email message you wish to send to all users who have signed up for this %node_type. !token_description', array('%node_type' => node_get_types('name', $node->type), '!token_description' => $token_text)),
+    '#description' => t('Body of the email message you wish to send to all users who have signed up for this %node_type. !token_description', array('%node_type' => node_type_get_name($node->type), '!token_description' => $token_text)),
     '#rows' => 10,
   );
 
@@ -77,7 +80,7 @@ function signup_broadcast_form($form_state, $node) {
   }
   else {
     $form['from'] = array(
-      '#value' => t('This message will be sent from: %from', array('%from' => $user->mail)),
+      '#markup' => t('This message will be sent from: %from', array('%from' => $user->mail)),
       '#pre' => '<strong>',
       '#post' => '</strong>',
     );
@@ -157,7 +160,7 @@ function signup_send_broadcast($nid, $subject, $body, $from, $copy = FALSE, $sig
       }
       $language = user_preferred_language($signup);
       drupal_mail('signup', 'signup_broadcast_mail', $user_mail, $language, $params, $from);
-      watchdog('signup', 'Broadcast email for %title sent to %email.', array('%title' => $node->title, '%email' => $user_mail), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+      watchdog('signup', 'Broadcast email for %title sent to %email.', array('%title' => $node->title, '%email' => $user_mail), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
     }
     if ($copy) {
       $sender_email = _signup_get_email($user);
@@ -167,7 +170,7 @@ function signup_send_broadcast($nid, $subject, $body, $from, $copy = FALSE, $sig
         // If the token.module is enabled, also handle any tokens it provides.
         $message = token_replace_multiple($message, array('node' => $node, 'signup' => $signup, 'global' => NULL));
       }
-      $final_text = theme('signup_broadcast_sender_copy', $body, $message);
+      $final_text = theme('signup_broadcast_sender_copy', array('raw_message' => $body, 'cooked_message' => $message));
       $params = array(
         'subject' => $subject,
         'body' => $final_text,
@@ -175,7 +178,7 @@ function signup_send_broadcast($nid, $subject, $body, $from, $copy = FALSE, $sig
       );
       $language = user_preferred_language($user);
       drupal_mail('signup', 'signup_broadcast_mail', $sender_email, $language, $params, $from);
-      watchdog('signup', 'Broadcast email copy for %title sent to %email.', array('%title' => $node->title, '%email' => $sender_email), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+      watchdog('signup', 'Broadcast email copy for %title sent to %email.', array('%title' => $node->title, '%email' => $sender_email), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
       drupal_set_message(t('Sent a copy of this message to %email', array('%email' => $sender_email)));
     }
   }
diff --git includes/cron.inc includes/cron.inc
index 9635eb2..64a6241 100644
--- includes/cron.inc
+++ includes/cron.inc
@@ -47,13 +47,13 @@ function _signup_cron_send_reminders() {
 
     // Grab each node, construct the email header and subject, and query
     // the signup log to pull all users who are signed up for this node.
-    while ($node = db_fetch_object($result)) {
-      $subject = t('!node_type reminder: !title', array('!node_type' => node_get_types('name', $type), '!title' => $node->title));
-      $signups = db_query("SELECT u.name, u.mail, s_l.sid, s_l.anon_mail, s_l.form_data FROM {signup_log} s_l INNER JOIN {users} u ON u.uid = s_l.uid WHERE s_l.nid = %d", $node->nid);
+    foreach ($result as $node) {
+      $subject = t('!node_type reminder: !title', array('!node_type' => node_type_get_name($type), '!title' => $node->title));
+      $signups = db_query("SELECT u.name, u.mail, s_l.sid, s_l.anon_mail, s_l.form_data FROM {signup_log} s_l INNER JOIN {users} u ON u.uid = s_l.uid WHERE s_l.nid = :s_l.nid", array(':s_l.nid' => $node->nid));
 
       // Loop through the users, composing their customized message
       // and sending the email.
-      while ($signup = db_fetch_object($signups)) {
+      foreach ($signups as $signup) {
         $user_mail = _signup_get_email($signup);
         $params = array(
           'subject' => $subject,
@@ -66,12 +66,17 @@ function _signup_cron_send_reminders() {
         }
         $language = user_preferred_language($signup);
         drupal_mail('signup', 'signup_reminder_mail', $user_mail, $language, $params, $from);
-        watchdog('signup', 'Reminder for %title sent to %user_mail.', array('%title' => $node->title, '%user_mail' => $user_mail), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+        watchdog('signup', 'Reminder for %title sent to %user_mail.', array('%title' => $node->title, '%user_mail' => $user_mail), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
       }
 
       // Reminders for this node are all sent, so mark it in the
       // database so they're not sent again.
-      db_query("UPDATE {signup} SET send_reminder = 0 WHERE nid = %d", $node->nid);
+      // TODO Please review the conversion of this statement to the D7 database API syntax.
+      /* db_query("UPDATE {signup} SET send_reminder = 0 WHERE nid = %d", $node->nid) */
+      db_update('signup')
+        ->fields(array('send_reminder' => 0))
+        ->condition('nid', $node->nid)
+        ->execute();
     }
   }
 }
@@ -110,17 +115,18 @@ function _signup_cron_autoclose() {
 
   foreach ($type_autoclose_sql as $type => $autoclose_sql) {
     $sql = _signup_build_query($autoclose_common_sql, $autoclose_sql);
+    // TODO Please convert this statement to the D7 database API syntax.
     $result = db_query($sql, $type);
 
     // Loop through the results, calling the signup closing function.
-    while ($signup = db_fetch_object($result)) {
+    foreach ($result as $signup) {
       signup_close_signup($signup->nid, $cron = 'yes');
       $node = node_load($signup->nid);
       foreach (module_implements('signup_close') as $module) {
-        $function = $module .'_signup_close';
+        $function = $module . '_signup_close';
         $function($node);
       }
-      watchdog('signup', 'Signups closed for %title by cron.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+      watchdog('signup', 'Signups closed for %title by cron.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
     }
   }
 }
diff --git includes/date.inc includes/date.inc
index 62bcd1b..50229a5 100644
--- includes/date.inc
+++ includes/date.inc
@@ -23,11 +23,11 @@ function _signup_date_admin_sql($content_type) {
   $alias = 'signup_alias_' . db_escape_table($content_type);
 
   // See what fields to SELECT.
-  $fields[] = $alias .'.'. $field['database']['columns']['value']['column'];
+  $fields[] = $alias . '.' . $field['database']['columns']['value']['column'];
   if (isset($field['database']['columns']['timezone']['column'])) {
-    $fields[] = $alias .'.'. $field['database']['columns']['timezone']['column'];
+    $fields[] = $alias . '.' . $field['database']['columns']['timezone']['column'];
   }
-  $table = '{'. $field['database']['table'] ."} ". $alias;
+  $table = '{' . $field['database']['table'] . '} ' . $alias;
   return array(
     'fields' => $fields,
     'joins' => array("LEFT JOIN $table ON $alias.vid = n.vid"),
@@ -35,21 +35,43 @@ function _signup_date_admin_sql($content_type) {
   );
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_field_names($content_type = NULL) {
   $fields = array();
-  $content_type_info = _content_type_info();
-  if ($content_type_info['content types'][$content_type]) {
+  /*$content_type_info = _content_type_info();
+   if ($content_type_info['content types'][$content_type]) {
     foreach ($content_type_info['content types'][$content_type]['fields'] as $field) {
       if (in_array($field['type'], array('date', 'datestamp', 'datetime'))) {
         $fields[$field['field_name']] = $field['widget']['label'];
       }
     }
+   }*/
+
+  /* TODO: Test if this works, and if this is the optimum way of retrieving
+   * this information.
+   *
+   * @see http://api.drupal.org/api/drupal/modules--field--field.info.inc/7
+   */
+  $content_type_info = field_info_instances('node');
+  if ($content_type_info[$content_type]) {
+    foreach ($content_type_info[$content_type] as $field_name => $field) {
+      if ($field['widget']['module'] == 'date') {
+        $fields[$field_name] = $field['label'];
+      }
+    }
   }
   return $fields;
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_date_field($content_type) {
-  $field_name = variable_get('signup_date_field_'. $content_type, 0);
+  $field_name = variable_get('signup_date_field_' . $content_type, 0);
   if ($field_name === 0 || $field_name == '0') {
     // PHP is completely evil and 'none' == 0 is TRUE, hence the extra checks.
     return FALSE;
@@ -102,7 +124,7 @@ function _signup_date_get_node_scheduler($node) {
  */
 function signup_form_content_field_edit_form_alter(&$form, &$form_state) {
   $type = $form['type_name']['#value'];
-  if (in_array($form['#field']['type'], array('date', 'datestamp', 'datetime')) && variable_get('signup_node_default_state_'. $type, 'disabled') != 'disabled') {
+  if (in_array($form['#field']['type'], array('date', 'datestamp', 'datetime')) && variable_get('signup_node_default_state_' . $type, 'disabled') != 'disabled') {
     $form['signup'] = array(
       '#type' => 'fieldset',
       '#title' => t('Signup settings'),
@@ -124,10 +146,10 @@ function signup_form_content_field_edit_form_alter(&$form, &$form_state) {
 function _signup_date_field_form_submit($form, &$form_state) {
   $type = $form_state['values']['type_name'];
   if (empty($form_state['values']['signup_date_field'])) {
-    variable_del('signup_date_field_'. $type);
+    variable_del('signup_date_field_' . $type);
   }
   else {
-    variable_set('signup_date_field_'. $type, $form_state['values']['signup_date_field']);
+    variable_set('signup_date_field_' . $type, $form_state['values']['signup_date_field']);
   }
 }
 
@@ -137,10 +159,10 @@ function _signup_date_field_form_submit($form, &$form_state) {
  * @see signup_alter_node_type_form()
  */
 function _signup_date_alter_node_type_form(&$form, &$form_state) {
-  drupal_add_js(drupal_get_path('module', 'signup') .'/js/admin.content_types.js');
+  drupal_add_js(drupal_get_path('module', 'signup') . '/js/admin.content_types.js');
 
   $type = $form['#node_type']->type;
-  $default_signup_state = variable_get('signup_node_default_state_'. $type, 'disabled');
+  $default_signup_state = variable_get('signup_node_default_state_' . $type, 'disabled');
 
   // Add a div to the 'Signup options' radios for signup.date.js.
   $form['signup']['signup_node_default_state']['#prefix'] = '<div class="signup-node-default-state-radios">';
@@ -163,7 +185,7 @@ function _signup_date_alter_node_type_form(&$form, &$form_state) {
   }
 
   $form['signup']['signup_date_field'] = _signup_date_field_element($type);
-  $form['signup']['signup_date_field']['#prefix'] = '<div class="'. $class .'">';
+  $form['signup']['signup_date_field']['#prefix'] = '<div class="' . $class . '">';
   $form['signup']['signup_date_field']['#suffix'] = '</div>';
 }
 
@@ -184,7 +206,7 @@ function _signup_date_field_element($type) {
     '#type' => 'select',
     '#title' => t('Date field to use with signup'),
     '#options' => _signup_get_date_field_options($type),
-    '#default_value' => variable_get('signup_date_field_'. $type, 0),
+    '#default_value' => variable_get('signup_date_field_' . $type, 0),
     '#description' => t('Select the date field of this content type to use for signup time-based functionality, such as automatically closing signups when the start time has passed and sending reminder emails. Select "%none" to not use a date field for signup functionality at all.', array('%none' => t('None'))),
   );
 }
@@ -205,7 +227,7 @@ function _signup_date_field_element($type) {
  * @see signup_date_field_check_config()
  */
 function signup_date_check_node_types($type = NULL) {
-  $names = node_get_types('names');
+  $names = node_type_get_names();
   if (!empty($type)) {
     signup_date_field_check_config($type, $names[$type]);
   }
@@ -237,7 +259,7 @@ function signup_date_check_node_types($type = NULL) {
  * @see signup_help()
  */
 function signup_date_field_check_config($type, $name) {
-  $signup_default_state = variable_get('signup_node_default_state_'. $type, 'disabled');
+  $signup_default_state = variable_get('signup_node_default_state_' . $type, 'disabled');
   $signup_scheduler = _signup_get_node_type_scheduler($type);
   if ($signup_scheduler != 'event' && $signup_default_state != 'disabled') {
     // Signups aren't disabled on this node type, see if there's a date field.
@@ -247,8 +269,8 @@ function signup_date_field_check_config($type, $name) {
       $placeholders = array(
         '%node_type' => $name,
         '%signup_date_field' => t('Date field to use with signup'),
-        '@type_admin_url' => url('admin/content/node-type/'. $type_url),
-        '@type_add_field_url' => url('admin/content/node-type/'. $type_url .'/fields'),
+        '@type_admin_url' => url('admin/content/node-type/' . $type_url),
+        '@type_add_field_url' => url('admin/content/node-type/' . $type_url . '/fields'),
         '%none' => '<' . t('none') . '>',
       );
       // Administrator hasn't specifically turned off date support...
@@ -280,7 +302,7 @@ function signup_date_field_check_config($type, $name) {
 function _signup_get_date_field_options($type) {
   $options = array();
   // Add "Not specified" if the user never selected a field.
-  if (variable_get('signup_date_field_'. $type, 0) == 0) {
+  if (variable_get('signup_date_field_' . $type, 0) == 0) {
     $options = array(0 => '<' . t('Not specified') . '>');
   }
   // Add any date fields from this node type.
@@ -307,7 +329,7 @@ function _signup_date_reminder_sql($content_type) {
   // Find the current time in the appropriate TZ for this field.
   $now_date = date_now($compare_tz);
   // Need to enclose this in ' marks to use directly in the SQL.
-  $now = "'". date_format($now_date, DATE_FORMAT_DATETIME) ."'";
+  $now = "'" . date_format($now_date, DATE_FORMAT_DATETIME) . "'";
 
   // Extract the correct SQL to represent the start time.
   $start_time = $handler->sql_field($start_field);
@@ -330,7 +352,7 @@ function _signup_date_reminder_sql($content_type) {
   if (isset($field['database']['columns']['timezone']['column'])) {
     $fields[] = $field['database']['columns']['timezone']['column'];
   }
-  $table = '{'. $field['database']['table'] .'}';
+  $table = '{' . $field['database']['table'] . '}';
   return array(
     'fields' => $fields,
     'joins' => array("INNER JOIN $table ON $table.vid = n.vid"),
@@ -371,7 +393,7 @@ function _signup_date_autoclose_sql($content_type) {
   if (isset($field['database']['columns']['timezone']['column'])) {
     $fields[] = $field['database']['columns']['timezone']['column'];
   }
-  $table = '{'. $field['database']['table'] .'}';
+  $table = '{' . $field['database']['table'] . '}';
   return array(
     'fields' => $fields,
     'joins' => array("INNER JOIN $table ON $table.vid = n.vid"),
diff --git includes/event.6x-2.inc includes/event.6x-2.inc
index e838b8f..81af948 100644
--- includes/event.6x-2.inc
+++ includes/event.6x-2.inc
@@ -13,15 +13,15 @@ function _signup_event_reminder_sql($content_type) {
     case 'mysql':
     case 'mysqli':
       $where = array(
-        "('". gmdate('Y-m-d H:i:s') ."' > (". event_where_utc() ." - INTERVAL s.reminder_days_before DAY))",
-        "('". gmdate('Y-m-d H:i:s') ."' <= (". event_where_utc() ."))",
+        "('" . gmdate('Y-m-d H:i:s') . "' > (" . event_where_utc() . " - INTERVAL s.reminder_days_before DAY))",
+        "('" . gmdate('Y-m-d H:i:s') . "' <= (" . event_where_utc() . "))",
       );
       break;
 
     case 'pgsql':
       $where = array(
-        "('". gmdate('Y-m-d H:i:s') ."' > (". event_where_utc() ." - INTERVAL 's.reminder_days_before days'))",
-        "('". gmdate('Y-m-d H:i:s') ."' <= (". event_where_utc() ."))",
+        "('" . gmdate('Y-m-d H:i:s') . "' > (" . event_where_utc() . " - INTERVAL 's.reminder_days_before days'))",
+        "('" . gmdate('Y-m-d H:i:s') . "' <= (" . event_where_utc() . "))",
       );
       break;
   }
@@ -41,7 +41,7 @@ function _signup_event_autoclose_sql($content_type) {
   return array(
     'fields' => array(event_select(), 'e.timezone'),
     'joins' => array(event_join('s')),
-    'where' => array(event_where_utc() ." < '". gmdate('Y-m-d H:i:s', time() + (variable_get('signup_close_early', 1) * 3600)) ."'"),
+    'where' => array(event_where_utc() . " < '" . gmdate('Y-m-d H:i:s', REQUEST_TIME + (variable_get('signup_close_early', 1) * 3600)) . "'"),
   );
 }
 
@@ -71,7 +71,7 @@ function _signup_event_admin_sql($content_type = NULL) {
  */
 function _signup_event_node_completed($node) {
   if (isset($node->event)) {
-    $closing_time = gmdate('Y-m-d H:i:s', time() + (variable_get('signup_close_early', 1) * 3600));
+    $closing_time = gmdate('Y-m-d H:i:s', REQUEST_TIME + (variable_get('signup_close_early', 1) * 3600));
     if (event_is_later($closing_time, $node->event['start_utc'], 'string')) {
       return TRUE;
     }
diff --git includes/node_admin.inc includes/node_admin.inc
index a9efb5e..914e141 100644
--- includes/node_admin.inc
+++ includes/node_admin.inc
@@ -11,7 +11,7 @@
  * Print the signup administration tab for a single node.
  */
 function signup_node_admin_page($node) {
-  drupal_set_title(check_plain($node->title));
+  drupal_set_title($node->title);
 
   // Administrative table to control signups for this node.
   // We only want this if we're not in the middle of confirming a bulk
@@ -21,7 +21,8 @@ function signup_node_admin_page($node) {
   // based on if it's a certain kind of POST...
   if (empty($_POST['operation'])) {
     module_load_include('inc', 'signup', 'includes/node_admin_summary');
-    $signup_node_admin_summary_form = drupal_get_form('signup_node_admin_summary_form', $node);
+    $form = drupal_get_form('signup_node_admin_summary_form', $node);
+    $signup_node_admin_summary_form = drupal_render($form);
   }
   else {
     // We're either dealing with a validation error or on a confirm form, so
@@ -44,6 +45,6 @@ function signup_node_admin_page($node) {
     $signup_node_admin_details_form = '';
   }
 
-  return theme('signup_node_admin_page', $node, $signup_node_admin_summary_form, $signup_node_admin_details_form);
+  return theme('signup_node_admin_page', array('node' => $node, 'signup_node_admin_summary_form' => $signup_node_admin_summary_form, 'signup_node_admin_details_form' => $signup_node_admin_details_form));
 }
 
diff --git includes/node_admin_summary.inc includes/node_admin_summary.inc
index e40bef0..a7f91b8 100644
--- includes/node_admin_summary.inc
+++ includes/node_admin_summary.inc
@@ -7,11 +7,12 @@
  * Code related to the signup administration tab on each node.
  */
 
-function signup_node_admin_summary_form($form_state, $node) {
-  $form = array();
-  if ($node->signup_close_signup_limit &&
-    $node->signup_effective_total >= $node->signup_close_signup_limit
-  ) {
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function signup_node_admin_summary_form($form, &$form_state, $node) {
+  if (isset($node->signup_effective_total) && $node->signup_close_signup_limit && $node->signup_effective_total >= $node->signup_close_signup_limit) {
     $form['status'] = array(
       '#type' => 'item',
       '#title' => t('Signups are'),
@@ -22,7 +23,10 @@ function signup_node_admin_summary_form($form_state, $node) {
     $form['status'] = array(
       '#type' => 'select',
       '#title' => t('Signups are'),
-      '#options' => array(0 => t('Closed'), 1 => t('Open')),
+      '#options' => array(
+        0 => t('Closed'),
+        1 => t('Open'),
+      ),
       '#default_value' => $node->signup_status,
     );
     $form['submit'] = array(
@@ -34,17 +38,17 @@ function signup_node_admin_summary_form($form_state, $node) {
   $form['total_signups'] = array(
     '#type' => 'item',
     '#title' => t('Total signups'),
-    '#value' => isset($node->signup_total) ? $node->signup_total : 0,
+    '#markup' => isset($node->signup_total) ? $node->signup_total : 0,
   );
   $form['slots_used'] = array(
     '#type' => 'item',
     '#title' => t('Signup slots used'),
-    '#value' => isset($node->signup_effective_total) ? $node->signup_effective_total : 0,
+    '#markup' => isset($node->signup_effective_total) ? $node->signup_effective_total : 0,
   );
   $form['limit'] = array(
     '#type' => 'item',
     '#title' => t('Signup limit'),
-    '#value' => l($node->signup_close_signup_limit, 'node/'. $node->nid .'/signups/settings', array('fragment' => 'signup-limit')),
+    '#markup' => l($node->signup_close_signup_limit, 'node/' . $node->nid . '/signups/settings', array('fragment' => 'signup-limit')),
   );
   $form['nid'] = array(
     '#type' => 'value',
@@ -53,12 +57,23 @@ function signup_node_admin_summary_form($form_state, $node) {
   return $form;
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_node_admin_summary_form_submit($form, &$form_state) {
   $nid = $form_state['values']['nid'];
   $node = node_load($nid);
   $limit_status = 0;
   if (isset($form_state['values']['limit']) && ($form_state['values']['limit'] != $node->signup_close_signup_limit)) {
-    db_query("UPDATE {signup} SET close_signup_limit = %d WHERE nid = %d", $form_state['values']['limit'], $nid);
+    // TODO Please review the conversion of this statement to the D7 database API syntax.
+    /* db_query("UPDATE {signup} SET close_signup_limit = %d WHERE nid = %d", $form_state['values']['limit'], $nid) */
+    db_update('signup')
+      ->fields(array(
+          'close_signup_limit' => $form_state['values']['limit'],
+        ))
+      ->condition('nid', $nid)
+      ->execute();
     $node->signup_close_signup_limit = $form_state['values']['limit'];
     $limit_status = _signup_check_limit($node, 'limit');
   }
diff --git includes/node_form.inc includes/node_form.inc
index 1154bd4..5be7961 100644
--- includes/node_form.inc
+++ includes/node_form.inc
@@ -37,10 +37,18 @@ function signup_save_node($node, $op) {
   if ($op == 'update' && isset($node->signup_enabled)) {
     switch ($node->signup_enabled) {
       case 2: // Disabled, and delete {signup_log}, too
-        db_query("DELETE FROM {signup_log} WHERE nid = %d", $node->nid);
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query("DELETE FROM {signup_log} WHERE nid = %d", $node->nid) */
+        db_delete('signup_log')
+          ->condition('nid', $node->nid)
+          ->execute();
         // No break, fall through and remove from {signup} too.
       case 0: // Disabled, but leave {signup_log} alone
-        db_query("DELETE FROM {signup} WHERE nid = %d", $node->nid);
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query("DELETE FROM {signup} WHERE nid = %d", $node->nid) */
+        db_delete('signup')
+          ->condition('nid', $node->nid)
+          ->execute();
         // We're done.
         return;
     }
@@ -53,35 +61,44 @@ function signup_save_node($node, $op) {
   // the node type), see if we need to insert a new record into the {signup}
   // table for this node using the site-wide defaults.
   $needs_defaults = FALSE;
-  if ((isset($node->signup_enabled) && $node->signup_enabled == 1) || (!isset($node->signup_enabled) && variable_get('signup_node_default_state_'. $node->type, 'disabled') == 'enabled_on')) {
+  if ((isset($node->signup_enabled) && $node->signup_enabled == 1) || (!isset($node->signup_enabled) && variable_get('signup_node_default_state_' . $node->type, 'disabled') == 'enabled_on')) {
     if ($op == 'insert') {
       $needs_defaults = TRUE;
     }
     else {
       // Updating -- see if we already have a record for this node.
-      $has_record = db_result(db_query("SELECT nid FROM {signup} WHERE nid = %d", $node->nid));
+      $has_record = db_query("SELECT nid FROM {signup} WHERE nid = :nid", array(':nid' => $node->nid))->fetchField();
       $needs_defaults = empty($has_record);
     }
   }
 
   if ($needs_defaults) {
-    $values = db_fetch_array(db_query("SELECT forwarding_email, send_confirmation, confirmation_email, close_signup_limit, send_reminder, reminder_days_before, reminder_email FROM {signup} WHERE nid = 0"));
-    $values[] = $node->nid;
-    db_query("INSERT INTO {signup} (forwarding_email, send_confirmation, confirmation_email, close_signup_limit, send_reminder, reminder_days_before, reminder_email, nid) VALUES ('%s', %d, '%s', %d, %d, %d, '%s', %d)", $values);
+    //TODO: this is untested
+    $values = db_query("SELECT forwarding_email, send_confirmation, confirmation_email, close_signup_limit, send_reminder, reminder_days_before, reminder_email FROM {signup} WHERE nid = 0")->fetchAssoc();
+    $values['nid'] = $node->nid;
+    db_insert('signup')
+      ->fields(array('forwarding_email', 'send_confirmation', 'confirmation_email', 'close_signup_limit', 'send_reminder', 'reminder_days_before', 'reminder_email', 'nid'))
+      ->values($values)
+      ->execute();
   }
-  db_query("UPDATE {signup} SET user_reg_form = %d WHERE nid = %d", $node->signup_user_reg, $node->nid);
+
+  db_update('signup')
+    ->fields(array('user_reg_form' => $node->signup_user_reg))
+    ->condition('nid', $node->nid)
+    ->execute();
+
   $node = node_load($node->nid);
   // We clear CCK's cache for this node due to an edge case bug:
   // http://drupal.org/node/605594.
   if (module_exists('content')) {
-    cache_clear_all('content:'. $node->nid .':'. $node->vid, content_cache_tablename());
+    cache_clear_all('content:' . $node->nid . ':' . $node->vid, content_cache_tablename());
   }
   if (_signup_node_completed($node) && !empty($node->signup_status)) {
     // If this is an time-based node, and it's already past the close in
     // advance time (e.g. someone just changed the node start time), and
     // signups are still open, close them now.
     signup_close_signup($node->nid);
-    drupal_set_message(t('%node_type start time is already past the signup close-in-advance time, signups now closed.', array('%node_type' => node_get_types('name', $node->type))));
+    drupal_set_message(t('%node_type start time is already past the signup close-in-advance time, signups now closed.', array('%node_type' => node_type_get_name($node->type))));
   }
 }
 
@@ -92,7 +109,7 @@ function signup_alter_node_form(&$form, &$form_state, $form_id) {
   global $user;
 
   // Node is not saved but previewed (nid is empty).
-  if (isset($form['#node']->build_mode) && $form['#node']->build_mode == NODE_BUILD_PREVIEW) {
+  if (isset($form['#node']->in_preview) && $form['#node']->in_preview) {
     $node = $form['#node'];
   }
   // Load the node if it already exists.
@@ -104,7 +121,7 @@ function signup_alter_node_form(&$form, &$form_state, $form_id) {
   }
   $node_type = $form['type']['#value'];
 
-  $signup_type_default = variable_get('signup_node_default_state_'. $node_type, 'disabled');
+  $signup_type_default = variable_get('signup_node_default_state_' . $node_type, 'disabled');
 
   // If signups are possible, and the current user either has the global
   // 'administer all signups' permission or has the 'administer signups
@@ -123,7 +140,7 @@ function signup_alter_node_form(&$form, &$form_state, $form_id) {
       '#type' => 'fieldset',
       '#title' => t('Signup settings'),
       '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
+      '#collapsed' => FALSE,
       '#weight' => 30,
       '#group' => 'additional_settings',
     );
@@ -131,11 +148,11 @@ function signup_alter_node_form(&$form, &$form_state, $form_id) {
     // Figure out what the options should be.  If there are already
     // people signed-up for this node, we need a 3rd choice: disable
     // signups and remove all signup data.
-    $has_signups = !empty($node) && db_result(db_query("SELECT COUNT(*) from {signup_log} WHERE nid = %d", $node->nid));
+    $has_signups = !empty($node) && (bool) db_query_range("SELECT 1 from {signup_log} WHERE nid = :nid", 0, 1, array(':nid' => $node->nid))->fetchField();
     $radio_options[1] = t('Enabled');
     if ($has_signups) {
       $radio_options[0] = t('Disabled, but save existing signup information');
-      $radio_options[2] = t('Disabled, and remove all signup information') .' <strong>('. t('This can not be undone, use with extreme caution!') .')</strong>';
+      $radio_options[2] = t('Disabled, and remove all signup information') . ' <strong>(' . t('This can not be undone, use with extreme caution!') . ')</strong>';
     }
     else {
       $radio_options[0] = t('Disabled');
@@ -153,13 +170,13 @@ function signup_alter_node_form(&$form, &$form_state, $form_id) {
       '#type' => 'radios',
       '#options' => $radio_options,
       '#default_value' => $default_option,
-      '#description' => t('If enabled, you can control whether users may sign up by visiting the !signup_admin tab and toggling if signups are %open or %closed for this %node_type. Other signup-related settings can be defined at the !signup_settings tab.', array('!signup_admin' => !empty($node->signup) ? l(t('Signups: Administer'), 'node/'. $node->nid .'/signups/admin') : theme('placeholder', t('Signups: Administer')), '!signup_settings' => !empty($node->signup) ? l(t('Signups: Settings'), 'node/'. $node->nid .'/signups/settings') : theme('placeholder', t('Signups: Settings')), '%open' => t('open'), '%closed' => t('closed'), '%node_type' => node_get_types('name', $node_type))),
+      '#description' => t('If enabled, you can control whether users may sign up by visiting the !signup_admin tab and toggling if signups are %open or %closed for this %node_type. Other signup-related settings can be defined at the !signup_settings tab.', array('!signup_admin' => !empty($node->signup) ? l(t('Signups: Administer'), 'node/' . $node->nid . '/signups/admin') : drupal_placeholder(t('Signups: Administer')), '!signup_settings' => !empty($node->signup) ? l(t('Signups: Settings'), 'node/' . $node->nid . '/signups/settings') : drupal_placeholder(t('Signups: Settings')), '%open' => t('open'), '%closed' => t('closed'), '%node_type' => node_type_get_name($node_type))),
     );
     $form['signup']['signup_user_reg'] = array(
       '#type' => 'checkbox',
       '#title' => t('Users can sign up for this event from the user registration form.'),
       '#description' => t('If selected, new users will be able to sign up for this event when they register.'),
-      '#default_value' => $node->signup_user_reg_form,
+      '#default_value' => isset($node->signup_user_reg_form) ? $node->signup_user_reg_form : NULL,
     );
   }
 }
diff --git includes/node_output.inc includes/node_output.inc
index 599fb6c..6880035 100644
--- includes/node_output.inc
+++ includes/node_output.inc
@@ -29,7 +29,7 @@
  *
  */
 function _signup_node_output($node, $type = 'node') {
-  $output = theme('signup_node_output_header', $node);
+  $output = theme('signup_node_output_header', array('node' => $node));
   $output .= _signup_current_user_signup($node, $type);
   return $output;
 }
@@ -49,12 +49,12 @@ function _signup_current_user_signup($node, $type = 'node') {
       // If they're logged in and already signed up, show their current
       // signup info and give them the option to cancel.
       if ($user->uid) {
-        $signup = db_fetch_object(db_query("SELECT sl.*, n.title, u.name 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));
+        $signup = db_query("SELECT sl.*, n.title, u.name 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 = :uid AND sl.nid = :nid", array(':uid' => $user->uid, ':nid' => $node->nid))->fetchObject();
         if (!empty($signup)) {
           $current_signup = _signup_render_signup_edit_form($signup, $type);
         }
       }
-      $output .= theme('signup_signups_closed', $node, $current_signup);
+      $output .= theme('signup_signups_closed', array('node' => $node, 'current_signup' => $current_signup));
     }
   }
   else {
@@ -63,7 +63,8 @@ function _signup_current_user_signup($node, $type = 'node') {
       if (user_access('sign up for content')) {
         // If they can signup, render the anonymous sigup form.
         module_load_include('inc', 'signup', 'includes/signup_form');
-        $output .= drupal_get_form('signup_form', $node, 'anon', $fieldset);
+        $form = drupal_get_form('signup_form', $node, 'anon', $fieldset);
+        $output .= drupal_render($form);
       }
       else {
         // If not, then display the appropriate login/register link if the
@@ -74,7 +75,7 @@ function _signup_current_user_signup($node, $type = 'node') {
           $token_array = array(
             '!login' => l(t('login'), 'user/login', array('query' => drupal_get_destination())),
             '!register' => l(t('register'), 'user/register', array('query' => drupal_get_destination())),
-            '%node_type' => node_get_types('name', $node->type),
+            '%node_type' => node_type_get_name($node->type),
           );
           if (variable_get('user_register', 1) == 0) {
             $anon_login_text = t('Please !login to sign up for this %node_type.', $token_array);
@@ -83,20 +84,21 @@ function _signup_current_user_signup($node, $type = 'node') {
             $anon_login_text = t('Please !login or !register to sign up for this %node_type.', $token_array);
           }
         }
-        $output .= theme('signup_anonymous_user_login_text', $anon_login_text);
+        $output .= theme('signup_anonymous_user_login_text', array('anon_login_text' => $anon_login_text));
       }
     }
     else {
       // An authenticated user.
 
       // 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));
+      $signup = 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 = :uid AND sl.nid = :nid", array(':uid' => $user->uid, ':nid' => $node->nid))->fetchObject();
       if (empty($signup)) {
         // Not yet signed up
         if (user_access('sign up for content')) {
           // User has permission to do so, so give them the form.
           module_load_include('inc', 'signup', 'includes/signup_form');
-          $output .= drupal_get_form('signup_form', $node, 'auth', $fieldset);
+          $form = drupal_get_form('signup_form', $node, 'auth', $fieldset);
+          $output .= drupal_render($form);
         }
       }
       else {
@@ -114,6 +116,9 @@ function _signup_current_user_signup($node, $type = 'node') {
 function signup_user_list_output($node) {
   $output = '';
 
+  // TODO: This probably shouldn't be here.
+  drupal_set_title($node->title);
+
   // How should the list of signed-up users be displayed, if at all?
   $display_list = variable_get('signup_display_signup_user_list', 'embed-view');
 
@@ -152,7 +157,7 @@ function signup_user_list_output($node) {
  * @see _signup_node_output()
  */
 function signup_node_tab($node) {
-  drupal_set_title(check_plain($node->title));
+  drupal_set_title($node->title);
   return _signup_node_output($node, 'tab');
 }
 
@@ -168,7 +173,7 @@ function _signup_render_signup_edit_form($signup, $type) {
   module_load_include('inc', 'signup', 'includes/signup_edit_form');
   $form = drupal_get_form('signup_edit_form', $signup, $type);
   $form_errors = form_get_errors() ? TRUE : FALSE;
-  drupal_add_js(array('signupEditFormErrors' => $form_errors), 'setting');
-  return $form;
+  drupal_add_js(array('signupEditFormErrors' => $form_errors), array('type' => 'setting', 'scope' => JS_DEFAULT));
+  return drupal_render($form);
 }
 
diff --git includes/node_settings.inc includes/node_settings.inc
index c3829de..69504f9 100644
--- includes/node_settings.inc
+++ includes/node_settings.inc
@@ -28,7 +28,7 @@
  *   The form array for the per-node signup settings.
  *
  */
-function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL, $has_date = FALSE, $include_buttons = FALSE) {
+function signup_node_settings_form($form, $form_state, $node = NULL, $node_type = NULL, $has_date = FALSE, $include_buttons = FALSE) {
   if (module_exists('token')) {
     $signup_token_description = t('Supported string substitutions: %node_title, %node_url, %node_start_time, %user_name, %user_mail, %user_signup_info (additional information from the signup form), %cancel_signup_url (access to this link is denied to users without the "%cancel_own_signups" permission), and any tokens in the %replacement_tokens list.', array('%replacement_tokens' => t('Replacement tokens'), '%cancel_own_signups' => t('cancel own signups')));
   }
@@ -38,7 +38,7 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
 
   // Load the default admin form data for new nodes.
   if (!$node || !$node->signup) {
-    $result = db_fetch_object(db_query("SELECT * FROM {signup} WHERE nid = 0"));
+    $result = db_query("SELECT * FROM {signup} WHERE nid = :nid", array(':nid' => 0))->fetchObject();
     $node->signup_forwarding_email = $result->forwarding_email;
     $node->signup_send_confirmation = $result->send_confirmation;
     $node->signup_confirmation_email = $result->confirmation_email;
@@ -52,7 +52,8 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
     '#type' => 'textfield',
     '#title' => t('Send signups to'),
     '#default_value' => $node->signup_forwarding_email,
-    '#size' => 40, '#maxlength' => 64,
+    '#size' => 40,
+    '#maxlength' => 64,
     '#description' => t('Email address where notification of new signups will be sent. Leave blank for no notifications.'),
   );
   $form['signup_send_confirmation'] = array(
@@ -64,7 +65,8 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
     '#type' => 'textarea',
     '#title' => t('Confirmation email'),
     '#default_value' => $node->signup_confirmation_email,
-    '#cols' => 40, '#rows' => 6,
+    '#cols' => 40,
+    '#rows' => 6,
     '#description' => t('Email sent to user upon signup. !token_description', array('!token_description' => $signup_token_description)),
   );
   if (module_exists('token')) {
@@ -88,7 +90,7 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
     for ($i = 1; $i <= 60; $i++) {
       $options[$i] = $i;
     }
-    $node_type_name = isset($node_type) ? node_get_types('name', $node_type) : '';
+    $node_type_name = isset($node_type) ? node_type_get_name($node_type) : '';
     $form['signup_reminder']['signup_reminder_days_before'] = array(
       '#type' => 'select',
       '#default_value' => $node->signup_reminder_days_before,
@@ -99,8 +101,9 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
       '#type' => 'textarea',
       '#title' => t('Reminder email'),
       '#default_value' => $node->signup_reminder_email,
-      '#cols' => 40, '#rows' => 6,
-      '#description' =>  !empty($node_type_name) ? t('Email sent to user as a reminder before the %node_type starts. !token_description', array('%node_type' => $node_type_name, '!token_description' => $signup_token_description)) : t('Email sent to user as a reminder before the start time. !token_description', array('!token_description' => $signup_token_description)),
+      '#cols' => 40,
+      '#rows' => 6,
+      '#description' => !empty($node_type_name) ? t('Email sent to user as a reminder before the %node_type starts. !token_description', array('%node_type' => $node_type_name, '!token_description' => $signup_token_description)) : t('Email sent to user as a reminder before the start time. !token_description', array('!token_description' => $signup_token_description)),
     );
     if (module_exists('token')) {
       module_load_include('inc', 'signup', 'includes/token_help');
@@ -112,12 +115,16 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
     '#type' => 'textfield',
     '#title' => t('Signup limit'),
     '#default_value' => $node->signup_close_signup_limit,
-    '#size' => 4, '#maxlength' => 8,
+    '#size' => 4,
+    '#maxlength' => 8,
     '#description' => t('Maximum number of users who can sign up before signups are automatically closed. If set to 0, there is no limit.'),
     '#prefix' => '<div id="signup-limit">',
     '#suffix' => '</div>',
   );
-  $form['signup'] = array('#type' => 'hidden', '#value' => 1);
+  $form['signup'] = array(
+    '#type' => 'hidden',
+    '#value' => 1,
+  );
 
   if ($include_buttons) {
     $form['#node'] = $node;
@@ -139,6 +146,9 @@ function signup_node_settings_form($form_state, $node = NULL, $node_type = NULL,
  * Page callback for the node/N/signups/settings subtab.
  */
 function signup_node_settings_page($node) {
+  // TODO: This probably shouldn't be here.
+  drupal_set_title($node->title);
+
   $node_scheduler = _signup_get_node_scheduler($node);
   $node_has_date = $node_scheduler != 'none';
   return drupal_get_form('signup_node_settings_form', $node, $node->type, $node_has_date, TRUE);
@@ -156,7 +166,7 @@ function signup_node_settings_form_submit($form, &$form_state) {
   $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
   if ($op == t('Reset to defaults')) {
     // If we're resetting, we just want to grab the site-wide defaults.
-    $values = db_fetch_array(db_query("SELECT forwarding_email, send_confirmation, confirmation_email, close_signup_limit, send_reminder, reminder_days_before, reminder_email FROM {signup} WHERE nid = 0"));
+    $values = db_query("SELECT forwarding_email, send_confirmation, confirmation_email, close_signup_limit, send_reminder, reminder_days_before, reminder_email FROM {signup} WHERE nid = :nid", array(':nid' => 0))->fetchAssoc();
   }
   else {
     // Populate $values from $form_state.
@@ -174,13 +184,17 @@ function signup_node_settings_form_submit($form, &$form_state) {
   // Either way, we want to make sure we're updating the values for the
   // current node, not nid 0...
   $node = $form['#node'];
-  $values[] = $node->nid;
-  db_query("UPDATE {signup} SET forwarding_email = '%s', send_confirmation = %d, confirmation_email = '%s', close_signup_limit = %d, send_reminder = %d, reminder_days_before = %d, reminder_email = '%s' WHERE nid = %d", $values);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("UPDATE {signup} SET forwarding_email = '%s', send_confirmation = %d, confirmation_email = '%s', close_signup_limit = %d, send_reminder = %d, reminder_days_before = %d, reminder_email = '%s' WHERE nid = %d", $values) */
+  db_update('signup')
+    ->fields($values)
+    ->condition('nid', $node->nid)
+    ->execute();
 
   // See if the limit changed, and if so, take any necessary action.
   if ($node->signup_close_signup_limit != $form_state['values']['signup_close_signup_limit']) {
     $node->signup_close_signup_limit = $form_state['values']['signup_close_signup_limit'];
-    $node->signup_effective_total = db_result(db_query("SELECT SUM(count_towards_limit) FROM {signup_log} WHERE nid = %d", $node->nid));
+    $node->signup_effective_total = db_query("SELECT SUM(count_towards_limit) FROM {signup_log} WHERE nid = :nid", array(':nid' => $node->nid))->fetchField();
     _signup_check_limit($node, 'limit');
   }
 
diff --git includes/scheduler.inc includes/scheduler.inc
index f8765b0..6f6b3bb 100644
--- includes/scheduler.inc
+++ includes/scheduler.inc
@@ -67,11 +67,11 @@ function _signup_get_node_scheduler($node) {
  *   the node type is untimed.
  */
 function _signup_get_node_type_scheduler($type) {
-  if (module_exists('event') && variable_get('event_nodeapi_'. $type, 'never') != 'never') {
+  if (module_exists('event') && variable_get('event_nodeapi_' . $type, 'never') != 'never') {
     return 'event';
   }
   if (module_exists('date')) {
-    $date_field = variable_get('signup_date_field_'. $type, 0);
+    $date_field = variable_get('signup_date_field_' . $type, 0);
     if (!empty($date_field) && $date_field != 'none') {
       return 'date';
     }
@@ -98,6 +98,10 @@ function _signup_node_completed($node) {
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_format_date($node) {
   switch (_signup_get_node_scheduler($node)) {
     case 'event':
@@ -111,6 +115,10 @@ function signup_format_date($node) {
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_reminder_sql($node_type) {
   switch (_signup_get_node_type_scheduler($node_type)) {
     case 'event':
@@ -124,6 +132,10 @@ function signup_reminder_sql($node_type) {
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_autoclose_sql($node_type) {
   switch (_signup_get_node_type_scheduler($node_type)) {
     case 'event':
@@ -137,6 +149,10 @@ function signup_autoclose_sql($node_type) {
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_admin_sql($node_type) {
   switch (_signup_get_node_type_scheduler($node_type)) {
     case 'event':
diff --git includes/signup_cancel.inc includes/signup_cancel.inc
index 49e901e..2a7d3bd 100644
--- includes/signup_cancel.inc
+++ includes/signup_cancel.inc
@@ -7,6 +7,10 @@
  * Code for the page to cancel a signup from a secure link.
  */
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_cancel_signup_page($signup, $token) {
   if (signup_valid_token($token, $signup->sid, 'cancel')) {
     return drupal_get_form('signup_cancel_link_confirm_form', $signup->sid);
@@ -15,10 +19,13 @@ function signup_cancel_signup_page($signup, $token) {
   drupal_goto();
 }
 
-function signup_cancel_link_confirm_form($form_state, $sid) {
-  $info = db_fetch_object(db_query("SELECT n.nid, n.title, s.* FROM {node} n INNER JOIN {signup_log} s ON n.nid = s.nid WHERE s.sid = %d", $sid));
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function signup_cancel_link_confirm_form($form, $form_state, $sid) {
+  $info = db_query("SELECT n.nid, n.title, s.* FROM {node} n INNER JOIN {signup_log} s ON n.nid = s.nid WHERE s.sid = :sid", array(':sid' => $sid))->fetchObject();
 
-  $form = array();
   $form['sid'] = array(
     '#type' => 'hidden',
     '#value' => $sid,
@@ -29,7 +36,7 @@ function signup_cancel_link_confirm_form($form_state, $sid) {
   );
   $form['#submit'][] = 'signup_cancel_link_confirm_form_submit';
 
-  $abort_url = isset($_REQUEST['destination']) ? $_REQUEST['destination'] : "node/$info->nid";
+  $abort_url = isset($_GET['destination']) ? $_GET['destination'] : "node/$info->nid";
 
   // TODO: Should this include information to identify the username,
   // anon_mail, and possibly the custom signup form data, too?
@@ -42,8 +49,12 @@ function signup_cancel_link_confirm_form($form_state, $sid) {
   );
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_cancel_link_confirm_form_submit($form, &$form_state) {
   signup_cancel_signup($form_state['values']['sid']);
-  $form_state['redirect'] = 'node/'. $form_state['values']['nid'];
+  $form_state['redirect'] = 'node/' . $form_state['values']['nid'];
 }
 
diff --git includes/signup_edit_form.inc includes/signup_edit_form.inc
index 82c0138..1c90357 100644
--- includes/signup_edit_form.inc
+++ includes/signup_edit_form.inc
@@ -10,6 +10,8 @@
 /**
  * Build the form for editing existing signups.
  *
+ * @param $form
+ *   An associative array containing the structure of the form.
  * @param $form_state
  *   The state of the form to build (not currently used).
  * @param $signup
@@ -20,9 +22,8 @@
  * @return
  *   The FAPI form array for the signup edit form.
  */
-function signup_edit_form($form_state, $signup, $type) {
+function signup_edit_form($form, &$form_state, $signup, $type) {
   global $user;
-  $form = array();
 
   $form['#signup'] = $signup;
   $node = node_load($signup->nid);
@@ -34,7 +35,7 @@ function signup_edit_form($form_state, $signup, $type) {
   $can_edit = $admin || (user_access('edit own signups') && $own);
 
   if ($type == 'admin') {
-    $title = t("Information for !user's signup to !node", array('!user' => _signup_get_username($signup, TRUE), '!node' => l($node->title, 'node/'. $node->nid)));
+    $title = t("Information for !user's signup to !node", array('!user' => _signup_get_username($signup, TRUE), '!node' => l($node->title, 'node/' . $node->nid)));
   }
   else {
     $title = t('Your signup information');
@@ -51,8 +52,7 @@ function signup_edit_form($form_state, $signup, $type) {
   else {
     $form['elements'] = array();
     $form['elements']['header'] = array(
-      '#type' => 'markup',
-      '#value' => $title,
+      '#markup' => $title,
       '#prefix' => '<h4>',
       '#suffix' => '</h4>',
     );
@@ -72,21 +72,21 @@ function signup_edit_form($form_state, $signup, $type) {
 
   if ($admin) {
     $options = array();
-    if (1|| !isset($signup->attended)) {
+    if (1 || !isset($signup->attended)) {
       $options[-1] = t('- Not recorded -');
     }
-    $options[1] = theme('signup_attended_text', 1);
-    $options[0] = theme('signup_attended_text', 0);
+    $options[1] = theme('signup_attended_text', array('attended' => 1));
+    $options[0] = theme('signup_attended_text', array('attended' => 0));
     $form['elements']['attended'] = array(
       '#type' => 'select',
       '#title' => t('Attendance'),
       '#default_value' => isset($signup->attended) ? $signup->attended : -1,
-      '#options' => $options
+      '#options' => $options,
     );
   }
 
   // Build the themed signup form for this site and include that.
-  $site_form = theme('signup_user_form', $node);
+  $site_form = theme('signup_user_form', array('node' => $node));
   $form_data = unserialize($signup->form_data);
 
   // This is sort of a hack, but we don't support nested arrays for the custom
@@ -112,17 +112,16 @@ function signup_edit_form($form_state, $signup, $type) {
     );
   }
   if ($can_cancel) {
-    if (isset($_REQUEST['destination'])) {
+    if (isset($_GET['destination'])) {
       $destination = drupal_get_destination();
     }
     else {
       // If there's no destination already set, redirect to the node.
-      $destination = 'destination='. urlencode("node/$signup->nid");
+      $destination = array('destination' => 'node/' . $signup->nid);
     }
     $signup_token = signup_get_token($signup->sid, 'cancel');
     $form['elements']['cancel-signup'] = array(
-      '#type' => 'markup',
-      '#value' => l(t('Cancel signup'), "signup/cancel/$signup->sid/$signup_token", array('query' => $destination)),
+      '#markup' => l(t('Cancel signup'), "signup/cancel/$signup->sid/$signup_token", array('query' => $destination)),
     );
   }
 
@@ -173,7 +172,11 @@ function signup_edit_form_save_submit($form, $form_state) {
   // be NULL, if the attendence was cleared out by this edit, we need to
   // manually set the DB record to NULL here.
   if (!isset($signup->attended)) {
-    db_query("UPDATE {signup_log} SET attended = NULL WHERE sid = %d", $signup->sid);
+    //db_query("UPDATE {signup_log} SET attended = NULL WHERE sid = %d", $signup->sid);
+    db_update('signup_log')
+      ->fields(array('attended' => NULL))
+      ->condition('sid', $signup->sid)
+      ->execute();
   }
 
   drupal_set_message(t('Signup information updated.'));
diff --git includes/signup_form.inc includes/signup_form.inc
index c87b054..f5147e5 100644
--- includes/signup_form.inc
+++ includes/signup_form.inc
@@ -20,12 +20,17 @@
  * @param $fieldset
  *   Boolean that indicates if the signup form should be in a fieldset.
  */
-function signup_form(&$form_state, $node, $signup_type = 'auth', $fieldset = TRUE) {
+function signup_form($form, &$form_state, $node, $signup_type = 'auth', $fieldset = TRUE) {
   global $user;
 
-  $form = array();
-  $form['nid'] = array('#type' => 'value', '#value' => $node->nid);
-  $form['uid'] = array('#type' => 'value', '#value' => $user->uid);
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $node->nid,
+  );
+  $form['uid'] = array(
+    '#type' => 'value',
+    '#value' => $user->uid,
+  );
 
   if ($fieldset) {
     $form['collapse'] = array(
@@ -52,7 +57,7 @@ function signup_form(&$form_state, $node, $signup_type = 'auth', $fieldset = TRU
     $anon_form['signup_anon_mail'] = array(
       '#type' => 'textfield',
       '#title' => t('Email'),
-      '#description' => t('An e-mail address is required for users who are not registered at this site. If you are a registered user at this site, please !login to sign up for this %node_type.', array('!login' => l(t('login'), 'user/login', array('query' => drupal_get_destination())), '%node_type' => node_get_types('name', $node->type))),
+      '#description' => t('An e-mail address is required for users who are not registered at this site. If you are a registered user at this site, please !login to sign up for this %node_type.', array('!login' => l(t('login'), 'user/login', array('query' => drupal_get_destination())), '%node_type' => node_type_get_name($node->type))),
       '#size' => 40,
       '#maxlength' => 255,
       '#required' => TRUE,
@@ -76,7 +81,7 @@ function signup_form(&$form_state, $node, $signup_type = 'auth', $fieldset = TRU
   }
 
   // Build the themed signup form for this site and include that.
-  $signup_themed_form = theme('signup_user_form', $node);
+  $signup_themed_form = theme('signup_user_form', array('node' => $node));
 
   if ($signup_type == 'admin') {
     // Special case hack for the default signup form, where the current
@@ -108,8 +113,10 @@ function signup_form(&$form_state, $node, $signup_type = 'auth', $fieldset = TRU
  */
 function signup_form_submit($form, &$form_state) {
   if (isset($form_state['values']['signup_username'])) {
-    $account = user_load(array('name' => $form_state['values']['signup_username']));
-    $form_state['values']['uid'] = $account->uid;
+    $accounts = user_load_multiple(array(), array('name' => $form_state['values']['signup_username']));
+    foreach ($accounts as $account) {
+      $form_state['values']['uid'] = $account->uid;
+    }
   }
   signup_sign_up_user($form_state['values']);
 }
@@ -145,12 +152,12 @@ function signup_validate_anon_email($nid, $anon_mail, $name = FALSE) {
   if (!valid_email_address($anon_mail)) {
     $message = t('Invalid email address entered for signup.');
   }
-  elseif (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE mail = '%s'", $anon_mail))) {
+  elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE mail = :mail", 0, 1, array(':mail' => $anon_mail))->fetchField()) {
     $message = t('The email address entered belongs to a registered user.');
   }
-  elseif (db_result(db_query("SELECT COUNT(*) FROM {signup_log} WHERE anon_mail = '%s' AND nid = %d", $anon_mail, $nid))) {
+  elseif ((bool) db_query_range("SELECT 1 FROM {signup_log} WHERE anon_mail = :mail AND nid = :nid", 0, 1, array(':mail' => $anon_mail, ':nid' => $nid))->fetchField()) {
     $node = node_load($nid);
-    $message = t('The email address entered has already been used to sign up for this %node_type.', array('%node_type' => node_get_types('name', $node->type)));
+    $message = t('The email address entered has already been used to sign up for this %node_type.', array('%node_type' => node_type_get_name($node->type)));
   }
 
   // If there's no message, it's a valid email, so return success.
@@ -179,17 +186,26 @@ function signup_validate_anon_email($nid, $anon_mail, $name = FALSE) {
 function signup_form_validate_username($form, $form_state) {
   $nid = $form_state['values']['nid'];
   $username = $form_state['values']['signup_username'];
-  $account = user_load(array('name' => $username));
-  if (empty($account)) {
-    form_set_error('signup_username', t('User %user_name does not exist.', array('%user_name' => $username)));
-  }
-  elseif (db_result(db_query("SELECT COUNT(*) FROM {signup_log} WHERE uid = %d AND nid = %d", $account->uid, $nid)) > 0) {
-    $node = node_load($nid);
-    form_set_error('signup_username', t('User !user is already signed up for %title', array('!user' => theme('username', $account), '%title' => $node->title)));
+  $accounts = user_load_multiple(array(), array('name' => $username));
+  foreach ($accounts as $account) {
+    if (empty($account)) {
+      form_set_error('signup_username', t('User %user_name does not exist.', array('%user_name' => $username)));
+    }
+    elseif ((bool) db_query_range("SELECT 1 FROM {signup_log} WHERE uid = :uid AND nid = :nid", 0, 1, array(':uid' => $account->uid, ':nid' => $nid))->fetchField() > 0) {
+      $node = node_load($nid);
+      form_set_error('signup_username', t('User !user is already signed up for %title', array('!user' => theme('username', array('account' => $account)), '%title' => $node->title)));
+    }
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_node_admin_add_user_page($node) {
+
+  drupal_set_title($node->title);
+
   $output = '';
   if ($node->signup_status) {
     $output = drupal_get_form('signup_form', $node, 'admin', FALSE);
diff --git includes/token_help.inc includes/token_help.inc
index 9a29fb5..2d7f2a6 100644
--- includes/token_help.inc
+++ includes/token_help.inc
@@ -24,7 +24,7 @@ function _signup_token_help(&$form, $element_name) {
     '#collapsed' => TRUE,
   );
   $form[$element_name]['help_text'] = array(
-    '#value' => _signup_build_token_help(),
+    '#markup' => _signup_build_token_help(),
   );
 }
 
@@ -36,6 +36,7 @@ function _signup_token_help(&$form, $element_name) {
 function _signup_build_token_help() {
   static $help_html = '';
   if (empty($help_html)) {
+    // TODO: Why can't theme_token_help() be found in this module?!?!
     $help_html = theme('token_help', array('signup', 'node', 'global'));
   }
   return $help_html;
diff --git js/admin.content_types.js js/admin.content_types.js
index c22d96d..d683790 100644
--- js/admin.content_types.js
+++ js/admin.content_types.js
@@ -1,4 +1,5 @@
 /* $Id: admin.content_types.js,v 1.4 2009/04/15 22:25:38 dww Exp $ */
+(function ($) {
 
 /**
  * Conditionally show or hide the signup date field setting.
@@ -7,25 +8,29 @@
  * set to 0 ('Disabled'), or the node type is event-enabled, then
  * hide the date field setting.  Otherwise, show it.
  */
-Drupal.behaviors.signupShowDateField = function () {
-  $('div.signup-node-default-state-radios input[type=radio], div.event-nodeapi-radios input[type=radio]').click(function () {
-    var eventEnabled = false;
-    var signupDisabled = true;
-    $('div.event-nodeapi-radios input.form-radio').each(function() {
-      if (this.checked && this.value != 'never') {
-        eventEnabled = true;
+Drupal.behaviors.signupShowDateField = {
+  attach: function (context, settings) {
+    $('div.signup-node-default-state-radios input[type=radio], div.event-nodeapi-radios input[type=radio]', context).click(function () {
+      var eventEnabled = false;
+      var signupDisabled = true;
+      $('div.event-nodeapi-radios input.form-radio', context).each(function() {
+        if (this.checked && this.value != 'never') {
+          eventEnabled = true;
+        }
+      });
+      $('div.signup-node-default-state-radios input.form-radio', context).each(function() {
+        if (this.checked && this.value != 'disabled') {
+          signupDisabled = false;
+        }
+      });
+      if (signupDisabled || eventEnabled) {
+        $('div.signup-date-field-setting', context).hide();
       }
-    });
-    $('div.signup-node-default-state-radios input.form-radio').each(function() {
-      if (this.checked && this.value != 'disabled') {
-        signupDisabled = false;
+      else {
+        $('div.signup-date-field-setting', context).show();
       }
     });
-    if (signupDisabled || eventEnabled) {
-      $('div.signup-date-field-setting').hide();
-    }
-    else {
-      $('div.signup-date-field-setting').show();
-    }
-  });
+  }
 };
+
+})(jQuery);
diff --git js/admin.settings.js js/admin.settings.js
index fab077a..695479d 100644
--- js/admin.settings.js
+++ js/admin.settings.js
@@ -1,4 +1,5 @@
 /* $Id: admin.settings.js,v 1.6 2009/01/24 08:52:40 dww Exp $ */
+(function ($) {
 
 /**
  * Conditionally show/hide settings based on the signup form location.
@@ -8,17 +9,19 @@
  * should be collapsed.  Only show this setting if the form is going
  * to be displayed on the node itself.
  */
-Drupal.behaviors.signupShowFormLocationSetting = function () {
-  $('div.signup-form-location-radios input.form-radio').click(function () {
-    // Simple part: Depending on the form location, hide/show the
-    // collapsible fieldset setting.
-    if (this.value == 'node') {
-      $('div.signup-fieldset_collapsed-setting').show();
-    }
-    else {
-      $('div.signup-fieldset_collapsed-setting').hide();
-    }
-  });
+Drupal.behaviors.signupShowFormLocationSetting = {
+  attach: function (context, settings) {
+    $('div.signup-form-location-radios input.form-radio', context).click(function () {
+      // Simple part: Depending on the form location, hide/show the
+      // collapsible fieldset setting.
+      if (this.value == 'node') {
+        $('div.signup-fieldset_collapsed-setting', context).show();
+      }
+      else {
+        $('div.signup-fieldset_collapsed-setting', context).hide();
+      }
+    });
+  }
 };
 
 /**
@@ -27,15 +30,17 @@ Drupal.behaviors.signupShowFormLocationSetting = function () {
  * If the signup user list is going to be an embedded view, show the
  * view-related settings, otherwise, hide them.
  */
-Drupal.behaviors.signupShowUserListViewSetting = function () {
-  $('div.signup-display-signup-user-list-setting input.form-radio').click(function () {
-    if (this.value == 'embed-view' || this.value == 'embed-view-tab') {
-      $('div.signup-user-list-view-settings').show();
-    }
-    else {
-      $('div.signup-user-list-view-settings').hide();
-    }
-  });
+Drupal.behaviors.signupShowUserListViewSetting = {
+  attach: function (context, settings) {
+    $('div.signup-display-signup-user-list-setting input.form-radio', context).click(function () {
+      if (this.value == 'embed-view' || this.value == 'embed-view-tab') {
+        $('div.signup-user-list-view-settings', context).show();
+      }
+      else {
+        $('div.signup-user-list-view-settings', context).hide();
+      }
+    });
+  }
 };
 
 /**
@@ -44,13 +49,17 @@ Drupal.behaviors.signupShowUserListViewSetting = function () {
  * If the administer signup user list is going to be an embedded view,
  * show the view-related settings, otherwise, hide them.
  */
-Drupal.behaviors.signupShowAdminListViewSetting = function () {
-  $('div.signup-display-signup-admin-list-setting input.form-radio').click(function () {
-    if (this.value == 'embed-view') {
-      $('div.signup-admin-list-view-settings').show();
-    }
-    else {
-      $('div.signup-admin-list-view-settings').hide();
-    }
-  });
+Drupal.behaviors.signupShowAdminListViewSetting = {
+  attach: function (context, settings) {
+    $('div.signup-display-signup-admin-list-setting input.form-radio', context).click(function () {
+      if (this.value == 'embed-view') {
+        $('div.signup-admin-list-view-settings', context).show();
+      }
+      else {
+        $('div.signup-admin-list-view-settings', context).hide();
+      }
+    });
+  }
 };
+
+})(jQuery);
diff --git js/signup_edit_form.js js/signup_edit_form.js
index 5504137..f767221 100644
--- js/signup_edit_form.js
+++ js/signup_edit_form.js
@@ -1,4 +1,5 @@
 /* $Id: signup_edit_form.js,v 1.4 2009/09/20 22:25:50 dww Exp $ */
+(function ($) {
 
 /**
  * On the signup edit form, add some bling to make users "confirm" the edit.
@@ -8,21 +9,24 @@
  * the other form elements are enabled, and the 'Update signup' button
  * text changes into 'Save changes'.
  */
-Drupal.behaviors.enableSignupEditForm = function(context) {
-  if (!Drupal.settings.signupEditFormErrors) {
-    var $button = $('#edit-save', context).click(enableSave);
-    var $form = $button.parents('form:first');
-    var $form_elements = $form.find(':visible');
-    var original_button_title = $button.val();
+Drupal.behaviors.enableSignupEditForm = {
+  attach: function (context, settings) {
+    if (!Drupal.settings.signupEditFormErrors) {
+      var $button = $('#edit-save', context).click(enableSave);
+      var $form = $button.parents('form:first');
+      var $form_elements = $form.find(':visible');
+      var original_button_title = $button.val();
 
-    $form_elements.attr('disabled', 'disabled');
-    $button.attr('disabled', '').val(Drupal.t('Edit'));
+      $form_elements.attr('disabled', 'disabled');
+      $button.attr('disabled', '').val(Drupal.t('Edit'));
+    }
+   
+    function enableSave() {
+      $form_elements.attr('disabled', '');
+      $button.unbind('click', enableSave).val(original_button_title);
+      return false;
+    }
   }
- 
-  function enableSave() {
-    $form_elements.attr('disabled', '');
-    $button.unbind('click', enableSave).val(original_button_title);
-    return false;
-  }
-}
+};
 
+})(jQuery);
--- modules/signup_confirm_email/signup_confirm_email.inc
+++ modules/signup_confirm_email/signup_confirm_email.inc
@@ -23,8 +23,8 @@ function signup_confirm_email_alter_signup_form(&$form, &$form_state, $form_id)
     // and we shouldn't confirm email when an admin is editing another signup).
     if (empty($user->uid) || $user->uid != $signup->uid) {
       return;
-    } 
-    
+    }
+
     // Ensure the user has permission to edit their own signups, or the rest
     // of this is wasted effort for a form that can't be submitted.
     $node = node_load($signup->nid);
@@ -91,7 +91,7 @@ function signup_email_confirm_validate($form, $form_state) {
   }
   // Add a JS setting for if the checkbox has a validation error, in which
   // case we display it, even if the 'E-mail address' field isn't re-edited.
-  drupal_add_js(array('signupConfirmEmailCheckboxError' => $error), 'setting');
+  drupal_add_js(array('signupConfirmEmailCheckboxError' => $error), array('type' => 'setting', 'scope' => JS_DEFAULT));
 }
 
 /**
@@ -105,7 +105,7 @@ function signup_email_confirm_validate($form, $form_state) {
  */
 function signup_email_confirm_submit($form, &$form_state) {
   global $user;
-  if (!empty($form_state['values']['email_confirm']) && 
+  if (!empty($form_state['values']['email_confirm']) &&
       !empty($form_state['values']['email_address'])) {
     if ($form_state['values']['email_address'] != $user->mail) {
       // Update the user's e-mail address in their profile.
diff --git modules/signup_confirm_email/signup_confirm_email.info modules/signup_confirm_email/signup_confirm_email.info
index 378ca35..5968595 100644
--- modules/signup_confirm_email/signup_confirm_email.info
+++ modules/signup_confirm_email/signup_confirm_email.info
@@ -3,4 +3,9 @@ name = Signup confirm e-mail
 description = "Adds a field to the signup form to confirm the user's e-mail address."
 dependencies[] = signup
 package = Signup
-core = 6.x
+core = 7.x
+
+files[] = signup_confirm_email.inc
+files[] = signup_confirm_email.install
+files[] = signup_confirm_email.module
+
diff --git modules/signup_confirm_email/signup_confirm_email.install modules/signup_confirm_email/signup_confirm_email.install
index 15e8527..3033495 100644
--- modules/signup_confirm_email/signup_confirm_email.install
+++ modules/signup_confirm_email/signup_confirm_email.install
@@ -2,10 +2,19 @@
 // $Id: signup_confirm_email.install,v 1.1 2009/08/03 20:59:45 dww Exp $
 
 /**
+ * @file
+ * Install, update and uninstall functions for the signup_confirm_email module.
+ *
+ */
+
+/**
  * Rebuild the site's menu to remove the stale menu item.
  */
 function signup_confirm_email_update_6000() {
   menu_rebuild();
-  return array();
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* array() */;
 }
 
diff --git modules/signup_confirm_email/signup_confirm_email.js modules/signup_confirm_email/signup_confirm_email.js
index 70a558c..bc1aee8 100644
--- modules/signup_confirm_email/signup_confirm_email.js
+++ modules/signup_confirm_email/signup_confirm_email.js
@@ -1,4 +1,5 @@
 /* $Id: signup_confirm_email.js,v 1.1 2009/08/03 20:59:45 dww Exp $ */
+(function ($) {
 
 /**
  * Conditionally show the "Update e-mail..." checkbox on signup forms.
@@ -13,33 +14,36 @@
  * need to ensure it's always visible, even if the e-mail address
  * field is unchanged.
  */
-Drupal.behaviors.showSignupConfirmEmailCheckbox = function() {
-  if (Drupal.settings.signupConfirmEmailCheckboxError) {
-    $('div#signup-confirm-email-checkbox').show();
+Drupal.behaviors.showSignupConfirmEmailCheckbox = {
+  attach: function (context, settings) {
+    if (Drupal.settings.signupConfirmEmailCheckboxError) {
+      $('div#signup-confirm-email-checkbox', context).show();
+    }
+    else {
+      $('#edit-email-address-wrapper input[type=text]', context).keyup(function (e) {
+        switch (e.keyCode) {
+          case 16: // shift
+          case 17: // ctrl
+          case 18: // alt
+          case 20: // caps lock
+          case 33: // page up
+          case 34: // page down
+          case 35: // end
+          case 36: // home
+          case 37: // left arrow
+          case 38: // up arrow
+          case 39: // right arrow
+          case 40: // down arrow
+          case 9:  // tab
+          case 13: // enter
+          case 27: // esc
+            return false;
+          default:
+            $('div#signup-confirm-email-checkbox', context).show();
+        }
+      });
+    }
   }
-  else {
-    $('#edit-email-address-wrapper input[type=text]').keyup(function (e) {
-      switch (e.keyCode) {
-        case 16: // shift
-        case 17: // ctrl
-        case 18: // alt
-        case 20: // caps lock
-        case 33: // page up
-        case 34: // page down
-        case 35: // end
-        case 36: // home
-        case 37: // left arrow
-        case 38: // up arrow
-        case 39: // right arrow
-        case 40: // down arrow
-        case 9:  // tab
-        case 13: // enter
-        case 27: // esc
-          return false;
-        default:
-          $('div#signup-confirm-email-checkbox').show();
-      }
-    });
-  }
-}
+};
 
+})(jQuery);
diff --git modules/signup_confirm_email/signup_confirm_email.module modules/signup_confirm_email/signup_confirm_email.module
index 817b442..34be071 100644
--- modules/signup_confirm_email/signup_confirm_email.module
+++ modules/signup_confirm_email/signup_confirm_email.module
@@ -13,7 +13,7 @@
 
 
 /**
- * Implement hook_form_alter().
+ * Implements hook_form_alter().
  */
 function signup_confirm_email_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == 'signup_form' || $form_id == 'signup_edit_form') {
--- modules/signup_roles/signup_roles.info
+++ modules/signup_roles/signup_roles.info
@@ -3,4 +3,7 @@ name = Signup Roles
 description = "Allows the site to grant one or more roles to users who sign up for nodes."
 dependencies[] = signup
 package = Signup
-core = 6.x
+core = 7.x
diff --git modules/signup_roles/signup_roles.module modules/signup_roles/signup_roles.module
index 57ba248..e0d7340 100644
--- modules/signup_roles/signup_roles.module
+++ modules/signup_roles/signup_roles.module
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_signup_sign_up().
+ * Implements hook_signup_sign_up().
  */
 function signup_roles_signup_sign_up($node, $account) {
   // We can't grant roles to anonymous users.
@@ -38,7 +38,7 @@ function signup_roles_signup_sign_up($node, $account) {
 }
 
 /**
- * Implementation of hook_form_alter().
+ * Implements hook_form_alter().
  */
 function signup_roles_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'signup_settings_form') {
@@ -62,11 +62,11 @@ function signup_roles_form_alter(&$form, $form_state, $form_id) {
 }
 
 /**
-* Public function for removing roles if a user cancels.
-*
-* This function is not automatically invoked by Signup. You should call this
-* function from your own code if you wish to remove roles.
-*/
+ * Public function for removing roles if a user cancels.
+ *
+ * This function is not automatically invoked by Signup. You should call this
+ * function from your own code if you wish to remove roles.
+ */
 function signup_roles_cancel($account) {
   // We can't remove roles from anonymous users.
   if (empty($account->uid)) {
@@ -94,4 +94,4 @@ function signup_roles_cancel($account) {
     watchdog('signup_roles', 'Error removing roles %roles from %name', array('%roles' => $remove_roles_string, '%name' => $account->name));
     return FALSE;
   }
-}
\ No newline at end of file
+}
--- panels/content_types/signup_form.inc
+++ panels/content_types/signup_form.inc
@@ -25,7 +25,7 @@ function signup_panels_content_types_signup_form() {
   return array(
     'signup_form' => array(
       'title' => t('Signup form'),
-      'icon' => 'icon_node.png',  // TODO: choose different icon
+      'icon' => 'icon_node.png', // TODO: choose different icon
       'path' => panels_get_path('content_types/node'), // TODO: adjust path
       'description' => t('Signup form.'),
       'required context' => new panels_required_context(t('Node'), 'node'),
@@ -40,7 +40,7 @@ function signup_panels_content_types_signup_form() {
  * Outputs the signup form based on a given nid, as provided by the $context.
  */
 function signup_panels_content_signup_form($subtype, $conf, $panel_args, &$context) {
-  $node = isset($context->data) ? drupal_clone($context->data) : NULL;
+  $node = isset($context->data) ? clone $context->data : NULL;
   $block = new stdClass();
   $block->module = 'signup';
   $block->subject = '';
--- signup.api.php
+++ signup.api.php
@@ -49,8 +49,7 @@ function hook_signup_cancel($signup, $node) {
   $form_data = unserialize($signup->form_data);
   $info[] = t('Custom signup form data: %signup_form_data', array('%signup_form_data' => theme('signup_custom_data_email', $form_data)));
   $info[] = t('Attendance record: %attended', array('%attended' => theme('signup_attended_text', $signup->attended)));
-  $info[] = t('Slots consumed by this signup: @count_towards_limit', array('@co
-unt_towards_limit' => $signup->count_towards_limit));
+  $info[] = t('Slots consumed by this signup: @count_towards_limit', array('@count_towards_limit' => $signup->count_towards_limit));
 
   drupal_set_message(theme('item_list', $info, t('Signup canceled for %node_title', array('%node_title' => $node->title))));
 }
@@ -98,7 +97,7 @@ function hook_signup_update($signup) {
  */
 function hook_signup_sign_up($node, $account) {
   return array(
-    t('Node type') => node_get_types('name', $node->type),
+    t('Node type') => node_type_get_name($node->type),
     t('User created') => format_date($account->created),
   );
 }
diff --git signup.info signup.info
index c5445de..14441c1 100644
--- signup.info
+++ signup.info
@@ -3,5 +3,20 @@ name = Signup
 description = "Allow users to sign up for content (especially events)."
 package = Signup
 dependencies[] = views
-core = 6.x
+core = 7.x
 
+files[] = signup.test
+files[] = views/handlers/signup_handler_argument_signup_user_uid.inc
+files[] = views/handlers/signup_handler_field_signup_edit_link.inc
+files[] = views/handlers/signup_handler_field_signup_node_link.inc
+files[] = views/handlers/signup_handler_field_signup_send_confirmation.inc
+files[] = views/handlers/signup_handler_field_signup_status.inc
+files[] = views/handlers/signup_handler_field_signup_user_attended.inc
+files[] = views/handlers/signup_handler_field_signup_user_email.inc
+files[] = views/handlers/signup_handler_field_signup_user_form_data.inc
+files[] = views/handlers/signup_handler_filter_signup_disabled.inc
+files[] = views/handlers/signup_handler_filter_signup_status.inc
+files[] = views/handlers/signup_handler_filter_signup_user_attended.inc
+files[] = views/handlers/signup_handler_filter_signup_user_authenticated.inc
+files[] = views/plugins/signup_plugin_access_user_signup_list.inc
+files[] = views/plugins/signup_plugin_argument_validate_signup_status.inc
diff --git signup.install signup.install
index d4ede7e..0fec392 100644
--- signup.install
+++ signup.install
@@ -7,75 +7,75 @@
  */
 function signup_schema() {
   $schema['signup'] = array(
-    'description' => t('Signup module per-node settings.'),
+    'description' => 'Signup module per-node settings.',
     'fields' => array(
       'nid' => array(
-        'description' => t('Primary key: node ID'),
+        'description' => 'Primary key: node ID',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'forwarding_email' => array(
-        'description' => t('Email address to send signup notifications to.'),
+        'description' => 'Email address to send signup notifications to.',
         'type' => 'varchar',
         'length' => 64,
         'not null' => TRUE,
         'default' => '',
       ),
       'send_confirmation' => array(
-        'description' => t('Boolean indicating whether confirmation emails should be sent.'),
+        'description' => 'Boolean indicating whether confirmation emails should be sent.',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
       ),
       'confirmation_email' => array(
-        'description' => t('Email template to send to users when they signup.'),
+        'description' => 'Email template to send to users when they signup.',
         'type' => 'text',
         'size' => 'big',
         'not null' => TRUE,
       ),
       'send_reminder' => array(
-        'description' => t('Boolean indicating whether reminder emails should be sent. This is set to 0 once the reminders are sent.'),
+        'description' => 'Boolean indicating whether reminder emails should be sent. This is set to 0 once the reminders are sent.',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
       ),
       'reminder_days_before' => array(
-        'description' => t('Number of days before the start of a time-based node when the reminder emails should be sent.'),
+        'description' => 'Number of days before the start of a time-based node when the reminder emails should be sent.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'reminder_email' => array(
-        'description' => t('Email template to send to users to remind them about a signup.'),
+        'description' => 'Email template to send to users to remind them about a signup.',
         'type' => 'text',
         'size' => 'big',
         'not null' => TRUE,
       ),
       'close_in_advance_time' => array(
-        'description' => t('Number of hours before the start of a time-based node when signups should automatically be closed. This column is not currently used and the behavior is controlled by a site-wide setting.  See http://drupal.org/node/290249 for more information.'),
+        'description' => 'Number of hours before the start of a time-based node when signups should automatically be closed. This column is not currently used and the behavior is controlled by a site-wide setting.  See http://drupal.org/node/290249 for more information.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'close_signup_limit' => array(
-        'description' => t('Maximum number of users who can signup before signups are closed. If set to 0, there is no limit.'),
+        'description' => 'Maximum number of users who can signup before signups are closed. If set to 0, there is no limit.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'status' => array(
-        'description' => t('Boolean indicating if signups are open (1) or closed (0) for the given node'),
+        'description' => 'Boolean indicating if signups are open (1) or closed (0) for the given node',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 1,
       ),
-     'user_reg_form' => array(
-        'description' => t('Boolean indicating if users can sign up for this event from the user registration form.'),
+      'user_reg_form' => array(
+        'description' => 'Boolean indicating if users can sign up for this event from the user registration form.',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
@@ -85,56 +85,56 @@ function signup_schema() {
   );
 
   $schema['signup_log'] = array(
-    'description' => t('Records information for each user who signs up for a node.'),
+    'description' => 'Records information for each user who signs up for a node.',
     'fields' => array(
       'sid' => array(
-        'description' => t('Primary key: signup ID'),
+        'description' => 'Primary key: signup ID',
         'type' => 'serial',
         'size' => 'normal',
         'unsigned' => TRUE,
         'not null' => TRUE,
       ),
       'uid' => array(
-        'description' => t('Key: the user ID of the user who signed up.'),
+        'description' => 'Key: the user ID of the user who signed up.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'nid' => array(
-        'description' => t('Key: the node ID of the node the user signed up for.'),
+        'description' => 'Key: the node ID of the node the user signed up for.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'anon_mail' => array(
-        'description' => t('The email address for an anonymous user who signed up, or an empty string for authenticated users.'),
+        'description' => 'The email address for an anonymous user who signed up, or an empty string for authenticated users.',
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
       ),
       'signup_time' => array(
-        'description' => t('Integer timestamp of when the user signed up for the node.'),
+        'description' => 'Integer timestamp of when the user signed up for the node.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'form_data' => array(
-        'description' => t('Serialized string of additional signup form values.  See theme_signup_user_form() from theme/signup.theme for more information.'),
+        'description' => 'Serialized string of additional signup form values.  See theme_signup_user_form() from theme/signup.theme for more information.',
         'type' => 'text',
         'size' => 'big',
         'not null' => TRUE,
       ),
       'attended' => array(
-        'description' => t('Did this user actually attend the node they signed up for?'),
+        'description' => 'Did this user actually attend the node they signed up for?',
         'type' => 'int',
         'size' => 'tiny',
       ),
       'count_towards_limit' => array(
-        'description' => t('How many slots (if any) this signup should use towards the total signup limit for this node'),
+        'description' => 'How many slots (if any) this signup should use towards the total signup limit for this node',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 1,
@@ -151,7 +151,7 @@ function signup_schema() {
 }
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  *
  * This will automatically install the database tables for the Signup
  * module for both the MySQL and PostgreSQL databases.
@@ -165,17 +165,22 @@ function signup_schema() {
  */
 function signup_install() {
   // Create tables.
-  drupal_install_schema('signup');
+  // TODO The drupal_(un)install_schema functions are called automatically in D7.
+  // drupal_install_schema('signup')
   signup_insert_default_signup_info();
 }
 
+/**
+ * Implements hook_uninstall().
+ */
 function signup_uninstall() {
   // Remove tables.
-  drupal_uninstall_schema('signup');
-
-  $variables = db_query("SELECT name FROM {variable} WHERE name LIKE 'signup%%'");
-  while ($variable = db_fetch_object($variables)) {
-    variable_del($variable->name);
+  // TODO The drupal_(un)install_schema functions are called automatically in D7.
+  // drupal_uninstall_schema('signup')
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  $variables = db_query("SELECT name FROM {variable} WHERE name LIKE :name", array(':name' => 'signup%'))->fetchCol();
+  foreach ($variables as $variable) {
+    variable_del($variable);
   }
 }
 
@@ -185,34 +190,64 @@ function signup_uninstall() {
  * settings for new signup-enabled nodes.
  */
 function signup_insert_default_signup_info() {
-  return db_query("INSERT INTO {signup} (nid, forwarding_email,
-    send_confirmation, confirmation_email,
-    send_reminder, reminder_days_before, reminder_email,
-    close_in_advance_time, close_signup_limit, status, user_reg_form) VALUES (0, '',
-    1, 'Enter your default confirmation email message here',
-    1, 1, 'Enter your default reminder email message here',
-    0, 0, 1, 0)");
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("INSERT INTO {signup} (nid, forwarding_email,
+   send_confirmation, confirmation_email,
+   send_reminder, reminder_days_before, reminder_email,
+   close_in_advance_time, close_signup_limit, status, user_reg_form) VALUES (0, '',
+   1, 'Enter your default confirmation email message here',
+   1, 1, 'Enter your default reminder email message here',
+   0, 0, 1, 0)") */
+  return $id = db_insert('signup')
+  ->fields(array(
+    'nid' => 0,
+    'forwarding_email' => '',
+    'send_confirmation' => 1,
+    'confirmation_email' => 'Enter your default confirmation email message here',
+    'send_reminder' => 1,
+    'reminder_days_before' => 1,
+    'reminder_email' => 'Enter your default reminder email message here',
+    'close_in_advance_time' => 0,
+    'close_signup_limit' => 0,
+    'status' => 1,
+    'user_reg_form' => 0,
+  ))
+  ->execute();
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function signup_update_3() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {signup_log} ADD anon_mail VARCHAR( 255 ) NOT NULL default '' AFTER nid;");
-      $ret[] = update_sql("ALTER TABLE {signup_log} DROP INDEX uid_nid;");
-      $ret[] = update_sql("ALTER TABLE {signup_log} ADD INDEX (uid);");
-      $ret[] = update_sql("ALTER TABLE {signup_log} ADD INDEX (nid);");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("ALTER TABLE {signup_log} ADD anon_mail VARCHAR( 255 ) NOT NULL default '' AFTER nid;") */;
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("ALTER TABLE {signup_log} DROP INDEX uid_nid;") */;
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("ALTER TABLE {signup_log} ADD INDEX (uid);") */;
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("ALTER TABLE {signup_log} ADD INDEX (nid);") */;
       break;
 
     case 'pgsql':
       db_add_column($ret, 'signup_log', 'anon_mail', 'text', array('not null' => TRUE, 'default' => "''"));
-      $ret[] = update_sql("DROP INDEX {signup_log}_uid_nid_idx;");
-      $ret[] = update_sql("CREATE INDEX {signup_log}_uid_idx ON {signup_log}(uid);");
-      $ret[] = update_sql("CREATE INDEX {signup_log}_nid_idx ON {signup_log}(nid);");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("DROP INDEX {signup_log}_uid_nid_idx;") */;
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("CREATE INDEX {signup_log}_uid_idx ON {signup_log}(uid);") */;
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("CREATE INDEX {signup_log}_nid_idx ON {signup_log}(nid);") */;
       break;
   }
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -249,14 +284,18 @@ function signup_update_4() {
         drupal_set_message(t('The old %signup_user_view setting was enabled on your site, so the %view_all_signups permission has been added to the %authenticated_user role. Please consider customizing what roles have this permission on the !access_control page.', array('%signup_user_view' => t('Users can view signups'), '%view_all_signups' => 'view all signups', '%authenticated_user' => 'Authenticated user', '!access_control' => l(t('Access control'), '/admin/user/access'))));
       }
     }
-    $ret[] = update_sql("UPDATE {permission} SET perm = '$fixed_perm' WHERE rid = $role->rid");
+    // TODO update_sql has been removed. Use the database API for any schema or data changes.
+    $ret[] = array() /* update_sql("UPDATE {permission} SET perm = '$fixed_perm' WHERE rid = $role->rid") */;
   }
 
   // Remove the stale setting from the {variable} table in the DB.
   variable_del('signup_user_view');
   drupal_set_message(t('The %signup_user_view setting has been removed.', array('%signup_user_view' => t('Users can view signups'))));
 
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -268,16 +307,22 @@ function signup_update_5200() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {signup} ADD status int NOT NULL default '1'");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("ALTER TABLE {signup} ADD status int NOT NULL default '1'") */;
       break;
 
     case 'pgsql':
       db_add_column($ret, 'signup', 'status', 'integer', array('not null' => TRUE, 'default' => "'1'"));
       break;
   }
-  $ret[] = update_sql("UPDATE {signup} SET status = (1 - completed)");
-  $ret[] = update_sql("ALTER TABLE {signup} DROP completed");
-  return $ret;
+  // TODO update_sql has been removed. Use the database API for any schema or data changes.
+  $ret[] = array() /* update_sql("UPDATE {signup} SET status = (1 - completed)") */;
+  // TODO update_sql has been removed. Use the database API for any schema or data changes.
+  $ret[] = array() /* update_sql("ALTER TABLE {signup} DROP completed") */;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -293,18 +338,22 @@ function signup_update_5201() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-      if (!db_column_exists('signup', 'close_signup_limit')) {
-        $ret[] = update_sql("ALTER TABLE {signup} ADD close_signup_limit int(10) unsigned NOT NULL default '0'");
+      if (!db_field_exists('signup', 'close_signup_limit')) {
+        // TODO update_sql has been removed. Use the database API for any schema or data changes.
+        $ret[] = array() /* update_sql("ALTER TABLE {signup} ADD close_signup_limit int(10) unsigned NOT NULL default '0'") */;
       }
       break;
 
     case 'pgsql':
-      if (!db_column_exists('signup', 'close_signup_limit')) {
+      if (!db_field_exists('signup', 'close_signup_limit')) {
         db_add_column($ret, 'signup', 'close_signup_limit', 'integer', array('not null' => TRUE, 'default' => "'0'"));
       }
       break;
   }
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -316,15 +365,20 @@ function signup_update_5202() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-      $ret[] = update_sql("UPDATE {permission} SET perm = CONCAT(perm, ', cancel own signups') WHERE CONCAT(perm, ', ') LIKE '%%sign up for content, %%'");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("UPDATE {permission} SET perm = CONCAT(perm, ', cancel own signups') WHERE CONCAT(perm, ', ') LIKE '%%sign up for content, %%'") */;
       break;
 
     case 'pgsql':
-      $ret[] = update_sql("UPDATE {permission} SET perm = perm || ', cancel own signups' WHERE perm || ', ' LIKE '%%sign up for content, %%'");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("UPDATE {permission} SET perm = perm || ', cancel own signups' WHERE perm || ', ' LIKE '%%sign up for content, %%'") */;
       break;
   }
-  drupal_set_message(t("Added the 'cancel own signups' permission to all roles that have the 'sign up for content' permission.") .'<br />'. t('If you do not want your users to cancel their own signups, go to the <a href="@access_url">Access control</a> page and unset this permission.', array('@access_url' => url('/admin/user/access'))));
-  return $ret;
+  drupal_set_message(t("Added the 'cancel own signups' permission to all roles that have the 'sign up for content' permission.") . '<br />' . t('If you do not want your users to cancel their own signups, go to the <a href="@access_url">Access control</a> page and unset this permission.', array('@access_url' => url('/admin/user/access'))));
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -333,16 +387,20 @@ function signup_update_5202() {
  */
 function signup_update_5203() {
   $old_prefix = 'signup_form_';
+  // TODO Please convert this statement to the D7 database API syntax.
   $result = db_query("SELECT name FROM {variable} WHERE name LIKE '$old_prefix%%'");
   while ($row = db_fetch_object($result)) {
     $old_name = $row->name;
-    $new_name = 'signup_node_default_state_'. substr($old_name, strlen($old_prefix));
+    $new_name = 'signup_node_default_state_' . substr($old_name, strlen($old_prefix));
     $new_value = variable_get($old_name, 0) == 1 ? 'enabled_on' : 'disabled';
     variable_del($old_name);
     variable_set($new_name, $new_value);
   }
   drupal_set_message(t('Migrated signup settings per content type.'));
-  return array();
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* array() */;
 }
 
 /**
@@ -356,7 +414,7 @@ function signup_update_5204() {
     // We need to start at nid 0 for the site-wide defaults, so
     // initialize our variable to the value below that.
     $_SESSION['signup_update_5204'] = -1;
-    $_SESSION['signup_update_5204_max'] = db_result(db_query("SELECT MAX(nid) FROM {signup}"));
+    $_SESSION['signup_update_5204_max'] = db_query("SELECT MAX(nid) FROM {signup}")->fetchField();
   }
 
   // Array of replacements mapping old names to the new names.
@@ -387,6 +445,7 @@ function signup_update_5204() {
   // Find the next N records to update, or do the final batch.
   $next = min($_SESSION['signup_update_5204'] + 2000, $_SESSION['signup_update_5204_max']);
   // Perform the UPDATE in our specified range of nid values.
+  // TODO Please convert this statement to the D7 database API syntax.
   db_query("UPDATE {signup} SET reminder_email = $reminder_replace, confirmation_email = $confirmation_replace WHERE nid > %d AND nid <= %d", $_SESSION['signup_update_5204'], $next);
   // Remember where we left off.
   $_SESSION['signup_update_5204'] = $next;
@@ -410,14 +469,20 @@ function signup_update_5204() {
       '%user_name' => '%user_name',
       '%user_mail' => '%user_mail',
       '%user_signup_info' => '%user_signup_info',
-      );
-    $ret[] = array('success' => TRUE, 'query' => t('Replaced %event, %eventurl, %time, %username, %useremail, and %info tokens with %node_title, %node_url, %node_start_time, %user_name, %user_mail, and %user_signup_info in the reminder and confirmation email templates.', $tokens));
+    );
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => t('Replaced %event, %eventurl, %time, %username, %useremail, and %info tokens with %node_title, %node_url, %node_start_time, %user_name, %user_mail, and %user_signup_info in the reminder and confirmation email templates.', $tokens),
+    );
   }
   else {
     // Report how much is left to complete.
     $ret['#finished'] = $_SESSION['signup_update_5204'] / $_SESSION['signup_update_5204_max'];
   }
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -433,11 +498,14 @@ function signup_update_6000() {
       '%old_view_name' => 'signup_user_list_view_name',
       '%old_view_type' => 'signup_user_list_view_type',
       // NOTE: we can't use url() here because it would use 'update.php?q=...'
-      '@signup_settings_url' => base_path() .'?q=admin/settings/signup',
+      '@signup_settings_url' => base_path() . '?q=admin/settings/signup',
       '%setting_name' => t('View to embed for the signup user list'),
     )),
   );
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -453,8 +521,11 @@ function signup_update_6001() {
     'unsigned' => TRUE,
     'not null' => TRUE,
   );
-  db_add_field($ret, 'signup_log', 'sid', $field, array('primary key' => array('sid')));
-  return $ret;	
+  db_add_field('signup_log', 'sid', $field, array('primary key' => array('sid')));
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -468,8 +539,11 @@ function signup_update_6002() {
     'type' => 'int',
     'size' => 'tiny',
   );
-  db_add_field($ret, 'signup_log', 'attended', $field);
-  return $ret;	
+  db_add_field('signup_log', 'attended', $field);
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -484,8 +558,11 @@ function signup_update_6003() {
     'not null' => TRUE,
     'default' => 1,
   );
-  db_add_field($ret, 'signup_log', 'count_towards_limit', $field);
-  return $ret;
+  db_add_field('signup_log', 'count_towards_limit', $field);
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
 /**
@@ -512,10 +589,13 @@ function signup_update_6004() {
     variable_set('signup_display_signup_admin_list', 'embed-view');
   }
 
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
 
-/*
+/**
  * Add the 'user_reg_form' field to the {signup} table.
  * See http://drupal.org/node/856604 for more information.
  */
@@ -526,6 +606,9 @@ function signup_update_6005() {
     'not null' => TRUE,
     'default' => 0,
   );
-  db_add_field($ret, 'signup', 'user_reg_form', $field);
-  return $ret;
-}
\ No newline at end of file
+  db_add_field('signup', 'user_reg_form', $field);
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
+}
diff --git signup.module signup.module
index 0f5f3af..1a7d978 100644
--- signup.module
+++ signup.module
@@ -18,67 +18,61 @@
  */
 
 /**
- * Implementation of hook_theme(), the theme registry.
+ * Implements hook_theme(), the theme registry().
  */
 function signup_theme() {
-  $path = drupal_get_path('module', 'signup') .'/theme';
+  $path = drupal_get_path('module', 'signup');
+  $theme_path = $path . '/theme';
+  $inc_path = $path . '/includes';
+
   return array(
     'signup_admin_page' => array(
       'file' => 'admin.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'filter_status_form' => NULL,
         'signup_admin_form' => NULL,
       ),
     ),
     'signup_filter_status_form' => array(
       'file' => 'admin.inc',
-      'path' => $path,
-      'arguments' => array(
-        'form' => NULL,
-      ),
-    ),
-    'signup_admin_form' => array(
-      'file' => 'admin.inc',
-      'path' => $path,
-      'arguments' => array(
-        'form' => NULL,
-      ),
+      'path' => $theme_path,
+      'render element' => 'form',
     ),
     'signup_email_token_custom_data' => array(
       'file' => 'email.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'signup_data' => NULL,
       ),
     ),
     'signup_custom_data_email' => array(
       'file' => 'email.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'data' => NULL,
       ),
     ),
     'signup_custom_data_field_text' => array(
       'file' => 'email.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'key' => NULL,
         'value' => NULL,
       ),
     ),
     'signup_broadcast_sender_copy' => array(
       'file' => 'email.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'raw_message' => NULL,
         'cooked_message' => NULL,
       ),
     ),
     'signup_node_admin_page' => array(
       'file' => 'node.admin.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'node' => NULL,
         'signup_node_admin_summary_form' => NULL,
         'signup_node_admin_details_form' => NULL,
@@ -87,88 +81,87 @@ function signup_theme() {
     ),
     'signup_node_admin_summary_form' => array(
       'file' => 'node.admin.inc',
-      'path' => $path,
-      'arguments' => array(
-        'form' => NULL,
-      ),
+      'path' => $theme_path,
+      'render element' => 'form',
     ),
     'signup_custom_data' => array(
       'file' => 'node.admin.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'data' => NULL,
       ),
     ),
     'signup_attended_text' => array(
       'file' => 'node.admin.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'attended' => NULL,
       ),
     ),
     'signup_signups_closed' => array(
       'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'node' => NULL,
         'current_signup' => '',
       ),
     ),
     'signup_anonymous_user_login_text' => array(
       'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'anon_login_text' => NULL,
       ),
     ),
     'signup_node_output_header' => array(
       'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'node' => NULL,
       ),
     ),
     'signup_node_title' => array(
       'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'node' => NULL,
       ),
     ),
     'signup_user_form' => array(
       'file' => 'signup_form.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'node' => NULL,
       ),
     ),
     'signup_anonymous_username' => array(
       'file' => 'signup_form.inc',
-      'path' => $path,
-      'arguments' => array(
+      'path' => $theme_path,
+      'variables' => array(
         'form_data' => NULL,
         'email' => NULL,
       ),
     ),
     'signup_settings_view_label' => array(
       'file' => 'admin.settings.inc',
-      'path' => drupal_get_path('module', 'signup') .'/includes',
-      'arguments' => array(
+      'path' => $inc_path,
+      'variables' => array(
         'view' => NULL,
+        'display_id' => NULL,
       ),
     ),
   );
 }
 
 /**
- * Implementation of hook_init().
+ * Implements hook_init().
  */
 function signup_init() {
   _signup_initialize_scheduler_backend();
 }
 
 /**
- * Implementation of hook_cron().
+ * Implements hook_cron().
  *
  * There are two cron-based tasks that can be performed by the signup module:
  * sending reminder emails to nodes that will begin soon, and auto-closing
@@ -211,51 +204,51 @@ function _signup_build_query($common_sql, $type_sql) {
   // Combine type-specific sql with common_sql.
   $full_sql = array_merge_recursive($common_sql, $type_sql);
 
-  $sql = 'SELECT '. implode(', ', $full_sql['fields']);
-  $sql .= ' FROM '. $common_sql['primary'] .' ';
+  $sql = 'SELECT ' . implode(', ', $full_sql['fields']);
+  $sql .= ' FROM ' . $common_sql['primary'] . ' ';
   if (!empty($full_sql['joins'])) {
     $sql .= implode(' ', $full_sql['joins']);
   }
   if (!empty($full_sql['where'])) {
-    $sql .= ' WHERE ('. implode(') AND (', $full_sql['where']) .')';
+    $sql .= ' WHERE (' . implode(') AND (', $full_sql['where']) . ')';
   }
   if (!empty($full_sql['group_by'])) {
-    $sql .= ' GROUP BY '. implode(', ', $full_sql['group_by']);
+    $sql .= ' GROUP BY ' . implode(', ', $full_sql['group_by']);
   }
   return $sql;
 }
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  *
  * @ingroup signup_core
  */
 function signup_help($path, $arg) {
   switch ($path) {
     case 'admin/help#signup':
-      return '<p>'.
+      return '<p>' .
         t('Signup allows users to sign up (in other words, register) for content of any type. The most common use is for events, where users indicate they are planning to attend. This module includes options for sending a notification email to a selected email address upon a new user signup (good for notifying event coordinators, etc.) and a confirmation email to users who sign up. Each of these options are controlled per node. When used on event nodes (with <a href="@event_url">event.module</a> installed) or nodes that have a date field (with <a href="@date_url">date.module</a>) and regular cron runs, it can also send out reminder emails to all signups a configurable number of days before the start of the event (also controlled per node) and to automatically close signups 1 hour before their start (general setting). Settings exist for resticting signups to selected roles and content types.', array('@event_url' => url('http://drupal.org/project/event'), '@date_url' => url('http://drupal.org/project/date')))
-        .'</p><p>'.
+        . '</p><p>' .
         t('To use signup, you must enable which content types should allow signups in administer->settings->content types, and you must also grant the %sign_up_for_content permission to any user role that should be able to sign up in administer->access control. Each signup-enabled node will now have a place for users to sign up.', array('%sign_up_for_content' => 'sign up for content'))
-        .'</p><p>'.
+        . '</p><p>' .
         t('There are two ways for a user to have administrative access to the signup information about a given node: either the user has the %administer_signups_for_own_content permission and they are viewing a node they created, or the user has the global %administer_all_signups permission. Administrative access allows a user to view all the users who have signed up for the node, along with whatever information they included when they signed up.  Signup administrators can also cancel other user\'s signups for the node, and can close signups on the node entirely (meaning no one else is allowed to sign up).', array('%administer_signups_for_own_content' => 'administer signups for own content', '%administer all signups' => 'administer all signups'))
-        .'</p><p>'.
+        . '</p><p>' .
         t('Default settings for notification email address, reminder emails and confirmation emails are located in administer->settings->signup. These will be the default values used for a signup node unless otherwise specified (to configure these options per node, visit \'edit\' for that node and make the adjustments in the \'Sign up settings\' section).')
-        .'</p><p>'.
+        . '</p><p>' .
         t('Signups can be manually closed for any node at the %signup_overview page, or on the \'signups\' tab on each node.', array('%signup_overview' => t('Signup overview')))
-        .'</p><p>'.
+        . '</p><p>' .
         t('The user signup form is fully themable -- form fields may be added or deleted. For more details see the instructions in signup.theme, where a sample user form is included.')
-        .'</p>';
+        . '</p>';
   }
 
   // If we're still here, consider the URL for help on various menu tabs.
   if (($node = menu_get_object()) && arg(2) == 'signups') {
     switch (arg(3)) {
       case 'broadcast':
-        return '<p>'. t('This page allows you to send an email message to every user who signed up for this %node_type.', array('%node_type' => node_get_types('name', $node->type))) .'</p>';
+        return '<p>' . t('This page allows you to send an email message to every user who signed up for this %node_type.', array('%node_type' => node_type_get_name($node->type))) . '</p>';
 
       case 'add':
-        return '<p>'. t('This page allows you to sign up another user for this %node_type.', array('%node_type' => node_get_types('name', $node->type))) .'</p>';
+        return '<p>' . t('This page allows you to sign up another user for this %node_type.', array('%node_type' => node_type_get_name($node->type))) . '</p>';
 
     }
   }
@@ -264,9 +257,7 @@ function signup_help($path, $arg) {
   // CCK node types for signup.  We only want to do this if the $path
   // doesn't contain 'help#' since hook_help() is invoked twice on admin
   // pages.
-  if (!empty($arg[0]) && $arg[0] == 'admin' && $arg[1] == 'content'
-    && function_exists('signup_date_check_node_types')
-  ) {
+  if (!empty($arg[0]) && $arg[0] == 'admin' && $arg[1] == 'content' && function_exists('signup_date_check_node_types')) {
     if ($arg[2] == 'types' && $arg[3] != 'add') {
       signup_date_check_node_types();
     }
@@ -279,14 +270,14 @@ function signup_help($path, $arg) {
 }
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  *
  * @ingroup signup_core
  */
 function signup_menu() {
-  $path = drupal_get_path('module', 'signup') .'/includes';
+  $path = drupal_get_path('module', 'signup') . '/includes';
   $items = array();
-  $items['admin/settings/signup'] = array(
+  $items['admin/config/people/signup'] = array(
     'description' => 'Configure settings for signups.',
     'access arguments' => array('administer all signups'),
     'page callback' => 'drupal_get_form',
@@ -322,6 +313,7 @@ function signup_menu() {
     'access arguments' => array('administer all signups'),
     'page callback' => 'signup_admin_page',
     'title' => 'Signup administration',
+    'type' => MENU_LOCAL_TASK,
     'file' => 'admin.signup_administration.inc',
     'file path' => $path,
   );
@@ -338,10 +330,14 @@ function signup_menu() {
   );
   $items['node/%node/signups/signup'] = array(
     'title' => 'Sign up',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'type' => MENU_LOCAL_TASK,
+    'page callback' => 'signup_current_user_signup_page',
+    'page arguments' => array(1),
     'access callback' => '_signup_menu_access',
     'access arguments' => array(1, 'signup'),
     'weight' => -10,
+    'file' => 'node_output.inc',
+    'file path' => $path,
   );
   $items['node/%node/signups/list'] = array(
     'title' => 'List',
@@ -349,7 +345,7 @@ function signup_menu() {
     'page arguments' => array(1),
     'access callback' => '_signup_menu_access',
     'access arguments' => array(1, 'list-tab'),
-    'type' => MENU_LOCAL_TASK,
+    'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => -5,
     'file' => 'node_output.inc',
     'file path' => $path,
@@ -553,15 +549,22 @@ function _signup_menu_signup_access($signup, $op) {
 }
 
 /**
+ * Page callback for displaying a signup form.
+ */
+function signup_current_user_signup_page($node) {
+  // TODO: This probably shouldn't be here.
+  drupal_set_title($node->title);
+
+  return _signup_current_user_signup($node, 'tab');
+}
+
+/**
  * Menu callback to handle the default tab at node/N/signups
  *
  * This tests the user's permission to see what tab they should really see.
- * If they have permission to signup for nodes and the site is configured to
- * put the signup form on a separate tab from the node itself, display the
- * current user's signup info (either a form to signup, or their current
- * signup).  If not, see if they can view a signup user list, and redirect
- * there.  If not, see if they can administer signups and redirect there.
- * Finally, if they can at least send a signup broadcast, go there.
+ * First, see if they can view a signup user list, and redirect there. If not,
+ * see if they can administer signups and redirect there. Finally, if they can
+ * at least send a signup broadcast, go there.
  *
  * @param $node
  *   Fully loaded node object to generate the node/N/signup menu handler for.
@@ -571,25 +574,27 @@ function _signup_menu_signup_access($signup, $op) {
  *
  * @see signup_menu()
  * @see _signup_menu_access()
- * @see _signup_current_user_signup();
  */
 function signup_node_tab_page($node) {
-  $signup = _signup_menu_access($node, 'signup');
   $list = _signup_menu_access($node, 'list-tab');
   $admin = _signup_menu_access($node, 'admin');
   $broadcast = _signup_menu_access($node, 'broadcast');
-  if ($signup) {
-    module_load_include('inc', 'signup', 'includes/node_output');
-    return _signup_current_user_signup($node, 'tab');
+  $options = array();
+  if (isset($_GET['destination'])) {
+    // If we have a redirect destination, we don't want drupal_goto() to send
+    // us there yet, but rather send us to the desired page and preserve the
+    // destination for next time.
+    $options = array('query' => drupal_get_destination());
+    unset($_GET['destination']);
   }
-  elseif ($list) {
-    drupal_goto("node/$node->nid/signups/list");
+  if ($list) {
+    drupal_goto("node/$node->nid/signups/list", $options);
   }
   elseif ($admin) {
-    drupal_goto("node/$node->nid/signups/admin");
+    drupal_goto("node/$node->nid/signups/admin", $options);
   }
   elseif ($broadcast) {
-    drupal_goto("node/$node->nid/signups/broadcast");
+    drupal_goto("node/$node->nid/signups/broadcast", $options);
   }
 }
 
@@ -602,26 +607,53 @@ function _signup_initialize_scheduler_backend() {
 }
 
 /**
- * Implementation of hook_perm().
+ * Implements hook_permission().
  *
  * @ingroup signup_core
  */
-function signup_perm() {
+function signup_permission() {
   return array(
-    'sign up for content',
-    'cancel signups',
-    'cancel own signups',
-    'edit own signups',
-    'view all signups',
-    'administer all signups',
-    'administer signups for own content',
-    'email users signed up for own content',
-    'email all signed up users',
+    'sign up for content' => array(
+      'title' => t('sign up for content'),
+      'description' => t('TODO Add a description for \'sign up for content\''),
+    ),
+    'cancel signups' => array(
+      'title' => t('cancel signups'),
+      'description' => t('TODO Add a description for \'cancel signups\''),
+    ),
+    'cancel own signups' => array(
+      'title' => t('cancel own signups'),
+      'description' => t('TODO Add a description for \'cancel own signups\''),
+    ),
+    'edit own signups' => array(
+      'title' => t('edit own signups'),
+      'description' => t('TODO Add a description for \'edit own signups\''),
+    ),
+    'view all signups' => array(
+      'title' => t('view all signups'),
+      'description' => t('TODO Add a description for \'view all signups\''),
+    ),
+    'administer all signups' => array(
+      'title' => t('administer all signups'),
+      'description' => t('TODO Add a description for \'administer all signups\''),
+    ),
+    'administer signups for own content' => array(
+      'title' => t('administer signups for own content'),
+      'description' => t('TODO Add a description for \'administer signups for own content\''),
+    ),
+    'email users signed up for own content' => array(
+      'title' => t('email users signed up for own content'),
+      'description' => t('TODO Add a description for \'email users signed up for own content\''),
+    ),
+    'email all signed up users' => array(
+      'title' => t('email all signed up users'),
+      'description' => t('TODO Add a description for \'email all signed up users\''),
+    ),
   );
 }
 
 /**
- * Implementation of hook_user().
+ * Implements hook_user_cancel().
  *
  * When a user is deleted, cancel all of that user's signups to remove all
  * instances of that user from the {signup_log} table, free up space in nodes
@@ -629,81 +661,96 @@ function signup_perm() {
  *
  * @ingroup signup_core
  */
-function signup_user($type, &$edit, &$account, $category = NULL) {
-  switch ($type) {
-    case 'register':
-      // Get a list of nodes that should appear on the user registration form.
-      $query = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n INNER JOIN {signup} s on n.nid = s.nid WHERE s.user_reg_form = 1 AND s.status = 1 AND n.status = 1"));
-      while ($result = db_fetch_object($query)) {
-        $nids[] = $result->nid;
-      }
-      // Allow other modules to alter the list of nids.
-      drupal_alter('signup_user_reg_nids', $nids);
-      // If there is at least one node, add the Signup fieldset.
-      if (!empty($nids)) {
-        $form['signup'] = array(
-          '#type' => 'fieldset',
-          '#title' => t('Event signup'),
-          '#tree' => TRUE,
-          '#description' => t('You will be automatically signed up once your account is created.'),
-        );
-        // Each node gets a checkbox.
-        foreach ($nids as $nid) {
-          $node = node_load($nid);
-          $form['signup'][$nid] = array(
-            '#type' => 'checkbox',
-            '#title' => theme('signup_node_title', $node),
-            '#default_value' => 0,
-          );
-        }
-      return $form;
-      }
-      break;
-    case 'delete':
-      $uids = array();
-      if (is_array($edit['accounts'])) {
-        // A multi-user delete from Admin > User management > Users.
-        $uids = $edit['accounts'];
-      }
-      else {
-        // A single-user delete from the edit tab on the user's profile.
-        if (!empty($account->uid)) {
-          $uids[] = $account->uid;
-        }
-      }
-      if (!empty($uids) && is_array($uids)) {
-        foreach ($uids as $uid) {
-          $query = db_query("SELECT * FROM {signup_log} WHERE uid = %d", $uid);
-          while ($signup = db_fetch_object($query)) {
-            signup_cancel_signup($signup);
-          }
-        }
+function signup_user_cancel($edit, $account, $method) {
+  $uids = array();
+  if (is_array($edit['accounts'])) {
+    // A multi-user delete from Admin > User management > Users.
+    $uids = $edit['accounts'];
+  }
+  else {
+    // A single-user delete from the edit tab on the user's profile.
+    if (!empty($account->uid)) {
+      $uids[] = $account->uid;
+    }
+  }
+  if (!empty($uids) && is_array($uids)) {
+    foreach ($uids as $uid) {
+      $signups = db_query("SELECT * FROM {signup_log} WHERE uid = :uid", array(':uid' => $uid));
+      // TODO: Test
+      foreach ($signups as $signup) {
+        signup_cancel_signup($signup);
       }
-      break;
-    case 'insert':
-      // Create signups for new users who signed up via
-      // the user registration form.
-      if (!empty($edit['signup'])) {
-        foreach($edit['signup'] as $nid => $value) {
-          if ($value) {
-            $signup_form = array();
-            $signup_form['nid'] = $nid;
-            $signup_form['uid'] = $account->uid;
-            signup_sign_up_user($signup_form, TRUE);
-          }
-        }
+    }
+  }
+}
+
+/**
+ * Implements hook_user_insert().
+ *
+ * Create signups for new users who signed up via the user registration form.
+ *
+ * @ingroup signup_core
+ */
+function signup_user_insert(&$edit, $account, $category) {
+  if (!empty($edit['signup'])) {
+    foreach ($edit['signup'] as $nid => $value) {
+      if ($value) {
+        $signup_form = array();
+        $signup_form['nid'] = $nid;
+        $signup_form['uid'] = $account->uid;
+        signup_sign_up_user($signup_form, TRUE);
       }
+    }
   }
 }
 
 /**
- * Implementation of hook_form_alter().
+ * Implements hook_form_FORM_ID_alter().
+ *
+ * @ingroup signup_core
+ */
+function signup_form_user_register_form_alter(&$form, &$form_state) {
+  // Get a list of nodes that should appear on the user registration form.
+  $query = db_select('node', 'n');
+  $alias = $query->join('signup', 's', 'n.nid = s.nid');
+  $query->fields('n', array('nid'));
+  $query
+    ->condition("n.status", 1)
+    ->condition("{$alias}.user_reg_form", 1)
+    ->condition("{$alias}.status", 1);
+  $query->addTag('node_access');
+  $nids = $query->execute()->fetchCol();
+
+  // Allow other modules to alter the list of nids.
+  drupal_alter('signup_user_reg_nids', $nids);
+  // If there is at least one node, add the Signup fieldset.
+  if (!empty($nids)) {
+    $form['signup'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Event signup'),
+      '#tree' => TRUE,
+      '#description' => t('You will be automatically signed up once your account is created.'),
+    );
+    // Each node gets a checkbox.
+    foreach ($nids as $nid) {
+      $node = node_load($nid);
+      $form['signup'][$nid] = array(
+        '#type' => 'checkbox',
+        '#title' => theme('signup_node_title', array('node' => $node)),
+        '#default_value' => 0,
+      );
+    }
+  }
+}
+
+/**
+ * Implements hook_form_alter().
  *
  * @ingroup signup_core
  */
 function signup_form_alter(&$form, &$form_state, $form_id) {
   if (!empty($form['type']['#value'])) {
-    if ($form_id == $form['type']['#value'] .'_node_form') {
+    if ($form_id == $form['type']['#value'] . '_node_form') {
       module_load_include('inc', 'signup', 'includes/node_form');
       signup_alter_node_form($form, $form_state, $form_id);
     }
@@ -720,7 +767,7 @@ function signup_form_node_type_form_alter(&$form, &$form_state) {
     '#type' => 'fieldset',
     '#title' => t('Signup settings'),
     '#collapsible' => TRUE,
-    '#collapsed' => TRUE,
+    '#collapsed' => FALSE,
     '#group' => 'additional_settings',
   );
 
@@ -732,7 +779,7 @@ function signup_form_node_type_form_alter(&$form, &$form_state) {
       'allowed_off' => t('Allowed (off by default)'),
       'enabled_on' => t('Enabled (on by default)'),
     ),
-    '#default_value' => variable_get('signup_node_default_state_'. $type, 'disabled'),
+    '#default_value' => variable_get('signup_node_default_state_' . $type, 'disabled'),
     '#description' => t('If %disabled is selected, signups will not be possible for this content type. If %allowed_off is selected, signups will be off by default, but users with the %admin_all_signups permission will be able to allow signups for specific posts of this content type. If %enabled_on is selected, users will be allowed to signup for this content type unless an administrator disbles signups on specific posts.', array('%disabled' => t('Disabled'), '%allowed_off' => t('Allowed (off by default)'), '%enabled_on' => t('Enabled (on by default)'), '%admin_all_signups' => t('administer all signups'))),
   );
 
@@ -746,103 +793,121 @@ function signup_form_node_type_form_alter(&$form, &$form_state) {
  */
 
 /**
- * Implementation of hook_nodeapi().
- *
- * @ingroup signup_nodeapi
+ * Implements hook_node_insert().
  */
-function signup_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
-  switch ($op) {
-    case 'insert':
-    case 'update':
-      module_load_include('inc', 'signup', 'includes/node_form');
-      signup_save_node($node, $op);
-      break;
-
-    case 'delete':
-        // Clean up the signup tables for the deleted node.
-        db_query("DELETE FROM {signup} WHERE nid = %d", $node->nid);
-        db_query("DELETE FROM {signup_log} WHERE nid = %d", $node->nid);
-      break;
-
-    case 'load':
-      // Check for a signup for this node.
-      // If it's a new node, load the defaults.
-      $result = db_query("SELECT * FROM {signup} WHERE nid = %d", ($node->nid ? $node->nid : 0));
-      $signup = db_fetch_object($result);
-      // Load signup data for both new nodes w/ enabled node types,
-      // and any existing nodes that are already signup enabled.
-      if ((!$node->nid && variable_get('signup_node_default_state_'. $node->type, 'disabled') == 'enabled_on') || ($node->nid && !empty($signup))) {
-        $node->signup = 1;
-        $node->signup_forwarding_email = $signup->forwarding_email;
-        $node->signup_send_confirmation = $signup->send_confirmation;
-        $node->signup_confirmation_email = $signup->confirmation_email;
-        $node->signup_send_reminder  = $signup->send_reminder ;
-        $node->signup_reminder_days_before = $signup->reminder_days_before;
-        $node->signup_reminder_email = $signup->reminder_email;
-        $node->signup_close_signup_limit = $signup->close_signup_limit;
-        $node->signup_status = $signup->status;
-        $node->signup_user_reg_form = $signup->user_reg_form;
-        if ($node->nid) {
-          $node->signup_total = db_result(db_query("SELECT COUNT(*) FROM {signup_log} WHERE nid = %d", $node->nid));
-          $node->signup_effective_total = db_result(db_query("SELECT SUM(count_towards_limit) FROM {signup_log} WHERE nid = %d", $node->nid));
-        }
-      }
-      else {
-        $node->signup = 0;
+function signup_node_insert($node) {
+  module_load_include('inc', 'signup', 'includes/node_form');
+  signup_save_node($node, 'insert');
+}
+
+/**
+ * Implements hook_node_update().
+ */
+function signup_node_update($node) {
+  module_load_include('inc', 'signup', 'includes/node_form');
+  signup_save_node($node, 'update');
+}
+
+/**
+ * Implements hook_node_delete().
+ */
+function signup_node_delete($node) {
+  // Clean up the signup tables for the deleted node.
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("DELETE FROM {signup} WHERE nid = %d", $node->nid) */
+  db_delete('signup')
+  ->condition('nid', $node->nid)
+  ->execute();
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("DELETE FROM {signup_log} WHERE nid = %d", $node->nid) */
+  db_delete('signup_log')
+  ->condition('nid', $node->nid)
+  ->execute();
+}
+
+/**
+ * Implements hook_node_load().
+ */
+function signup_node_load($nodes, $types) {
+  // Check for a signup for the given nodes.
+  // If it's a new node, load the defaults.
+  $result = db_query("SELECT * FROM {signup} WHERE nid IN (:nids)", array(':nids' => array_keys($nodes)));
+  foreach ($result as $signup) {
+    // Load signup data for both new nodes w/ enabled node types,
+    // and any existing nodes that are already signup enabled.
+    if ((empty($nodes[$signup->nid]->nid) && variable_get('signup_node_default_state_' . $nodes[$signup->nid]->type, 'disabled') == 'enabled_on') || (!empty($nodes[$signup->nid]->nid) && !empty($signup))) {
+      $nodes[$signup->nid]->signup = 1;
+      $nodes[$signup->nid]->signup_forwarding_email = $signup->forwarding_email;
+      $nodes[$signup->nid]->signup_send_confirmation = $signup->send_confirmation;
+      $nodes[$signup->nid]->signup_confirmation_email = $signup->confirmation_email;
+      $nodes[$signup->nid]->signup_send_reminder  = $signup->send_reminder;
+      $nodes[$signup->nid]->signup_reminder_days_before = $signup->reminder_days_before;
+      $nodes[$signup->nid]->signup_reminder_email = $signup->reminder_email;
+      $nodes[$signup->nid]->signup_close_signup_limit = $signup->close_signup_limit;
+      $nodes[$signup->nid]->signup_status = $signup->status;
+      $nodes[$signup->nid]->signup_user_reg_form = $signup->user_reg_form;
+      if ($nodes[$signup->nid]->nid) {
+        $nodes[$signup->nid]->signup_total = db_query("SELECT COUNT(*) FROM {signup_log} WHERE nid = :nid", array(':nid' => $nodes[$signup->nid]->nid))->fetchField();
+        $nodes[$signup->nid]->signup_effective_total = db_query("SELECT SUM(count_towards_limit) FROM {signup_log} WHERE nid = :nid", array(':nid' => $nodes[$signup->nid]->nid))->fetchField();
       }
-      break;
-
-    case 'view':
-      // If this is a signup node, figure out what (if anything) to print.
-      // Only include any of this if we're trying to view the node as
-      // a page, not during the view from comment validation, etc.
-      if ($page && _signup_needs_output($node)) {
-        $info_location = variable_get('signup_form_location', 'node');
-        $list_location = variable_get('signup_display_signup_user_list', 'embed-view');
-        if ($info_location == 'node' || $list_location == 'embed-view') {
-          module_load_include('inc', 'signup', 'includes/node_output');
+    }
+    else {
+      $nodes[$signup->nid]->signup = 0;
+    }
+  }
+}
+
+/**
+ * Implements hook_node_view().
+ */
+function signup_node_view($node, $view_mode = 'full') {
+  // If this is a signup node, figure out what (if anything) to print.
+  // Only include any of this if we're trying to view the node as
+  // a page, not during the view from comment validation, etc.
+  if ($view_mode == 'full' && _signup_needs_output($node)) {
+    $info_location = variable_get('signup_form_location', 'node');
+    $list_location = variable_get('signup_display_signup_user_list', 'embed-view');
+    if ($info_location == 'node' || $list_location == 'embed-view') {
+      module_load_include('inc', 'signup', 'includes/node_output');
+    }
+    if ($info_location == 'node') {
+      $signup_info = _signup_node_output($node);
+      if (!empty($signup_info)) {
+        if (module_exists('content')) {
+          // Due to a bug in CCK (http://drupal.org/node/363456), we need
+          // to call this function twice to ensure we get the real value.
+          // The bug is present when you first enable the setting to
+          // display in the node instead of a separate tab, or when you
+          // first upgrade to the version that contains this code.
+          content_extra_field_weight($node->type, 'signup_node_info');
+          $weight = content_extra_field_weight($node->type, 'signup_node_info');
         }
-        if ($info_location == 'node') {
-          $signup_info = _signup_node_output($node);
-          if (!empty($signup_info)) {
-            if (module_exists('content')) {
-              // Due to a bug in CCK (http://drupal.org/node/363456), we need
-              // to call this function twice to ensure we get the real value.
-              // The bug is present when you first enable the setting to
-              // display in the node instead of a separate tab, or when you
-              // first upgrade to the version that contains this code.
-              content_extra_field_weight($node->type, 'signup_node_info');
-              $weight = content_extra_field_weight($node->type, 'signup_node_info');
-            }
-            else {
-              $weight = variable_get('signup_info_node_weight_'. $node->type, 10);
-            }
-            $node->content['signup'] = array(
-              '#value' => $signup_info,
-              '#weight' => $weight,
-            );
-          }
+        else {
+          $weight = variable_get('signup_info_node_weight_' . $node->type, 10);
         }
-        if ($list_location == 'embed-view') {
-          $signup_list = signup_user_list_output($node);
-          if (!empty($signup_list)) {
-            if (module_exists('content')) {
-              // Call this twice to work-around a bug in CCK (#363456).
-              content_extra_field_weight($node->type, 'signup_node_list');
-              $weight = content_extra_field_weight($node->type, 'signup_node_list');
-            }
-            else {
-              $weight = variable_get('signup_list_node_weight_'. $node->type, 11);
-            }
-            $node->content['signup_list'] = array(
-              '#value' => $signup_list,
-              '#weight' => $weight,
-            );
-          }
+        $node->content['signup'] = array(
+          '#markup' => $signup_info,
+          '#weight' => $weight,
+        );
+      }
+    }
+    if ($list_location == 'embed-view') {
+      $signup_list = signup_user_list_output($node);
+      if (!empty($signup_list)) {
+        if (module_exists('content')) {
+          // Call this twice to work-around a bug in CCK (#363456).
+          content_extra_field_weight($node->type, 'signup_node_list');
+          $weight = content_extra_field_weight($node->type, 'signup_node_list');
+        }
+        else {
+          $weight = variable_get('signup_list_node_weight_' . $node->type, 11);
         }
+        $node->content['signup_list'] = array(
+          '#markup' => $signup_list,
+          '#weight' => $weight,
+        );
       }
-      break;
-
+    }
   }
 }
 
@@ -857,7 +922,7 @@ function signup_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  * @see signup_nodeapi()
  */
 function _signup_needs_output($node) {
-  if (!$node->signup) {
+  if (empty($node->signup)) {
     // Not signup enabled at all.
     return FALSE;
   }
@@ -870,23 +935,23 @@ function _signup_needs_output($node) {
 }
 
 /**
- * Implementation of hook_action_info().
+ * Implements hook_action_info().
  */
 function signup_action_info() {
   return array(
     'signup_cancel_action' => array(
       'type' => 'signup',
-      'description' => t('Cancel signup'),
+      'label' => t('Cancel signup'),
       'configurable' => FALSE,
     ),
     'signup_mark_attended_action' => array(
       'type' => 'signup',
-      'description' => t('Mark signup attended'),
+      'label' => t('Mark signup attended'),
       'configurable' => FALSE,
     ),
     'signup_mark_not_attended_action' => array(
       'type' => 'signup',
-      'description' => t('Mark signup did not attend'),
+      'label' => t('Mark signup did not attend'),
       'configurable' => FALSE,
     ),
   );
@@ -917,7 +982,14 @@ function signup_cancel_action($signup) {
  *   table is directly UPDATE'ed in the database.
  */
 function signup_mark_attended_action(&$signup) {
-  db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", TRUE, $signup->sid);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", TRUE, $signup->sid) */
+  db_update('signup_log')
+  ->fields(array(
+    'attended' => TRUE,
+  ))
+  ->condition('sid', $signup->sid)
+  ->execute();
   $signup->attended = TRUE;
   watchdog('action', 'Marked signup @signup_id attended.', array('@signup_id' => $signup->sid));
 }
@@ -933,13 +1005,20 @@ function signup_mark_attended_action(&$signup) {
  *   table is directly UPDATE'ed in the database.
  */
 function signup_mark_not_attended_action(&$signup) {
-  db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", FALSE, $signup->sid);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", FALSE, $signup->sid) */
+  db_update('signup_log')
+  ->fields(array(
+    'attended' => FALSE,
+  ))
+  ->condition('sid', $signup->sid)
+  ->execute();
   $signup->attended = FALSE;
   watchdog('action', 'Marked signup @signup_id did not attend.', array('@signup_id' => $signup->sid));
 }
 
 /**
- * Implementation of hook_views_bulk_operations_object_info().
+ * Implements hook_views_bulk_operations_object_info().
  *
  * Exports information to VBO about what kinds of objects to do operations on.
  */
@@ -955,19 +1034,6 @@ function signup_views_bulk_operations_object_info() {
 }
 
 /**
- * Deprecated implmentation of hook_object_info().
- *
- * This is the old name for hook_views_bulk_operations_object_info().  It was
- * renamed in VBO at http://drupal.org/node/362534 to prevent possible
- * namespace colisions.  However, it means that modules supporting VBO need to
- * have both implementations during the transition while users upgrade to VBO
- * version 6.x-1.4.  Once 6.x-1.4 is ubiquitous, this can be removed.
- */
-function signup_object_info() {
-  return signup_views_bulk_operations_object_info();
-}
-
-/**
  * Load a $signup object from the given Signup ID (sid).
  *
  * In addition to pulling all the fields from the {signup_log} table, this
@@ -981,7 +1047,7 @@ function signup_object_info() {
  *   Fully loaded $signup object corresponding to the given ID.
  */
 function signup_load_signup($sid) {
-  $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.sid = %d", $sid));
+  $signup = 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.sid = :sid", array(':sid' => $sid))->fetchObject();
   if (!empty($signup)) {
     // This label is escaped by VBO, so it needs to be plain text, not HTML.
     $signup->label = t("!user signup for '!title'", array('!user' => $signup->name, '!title' => $signup->title));
@@ -1043,19 +1109,19 @@ function signup_save_signup(&$signup) {
  */
 function signup_get_signups($nid) {
   $signups = array();
-  $query = db_query("SELECT u.uid, u.name, u.mail, u.language, s_l.* FROM {signup_log} s_l INNER JOIN {users} u ON u.uid = s_l.uid WHERE s_l.nid = %d", $nid);
-  while ($signup = db_fetch_object($query)) {
+  $result = db_query("SELECT u.uid, u.name, u.mail, u.language, s_l.* FROM {signup_log} s_l INNER JOIN {users} u ON u.uid = s_l.uid WHERE s_l.nid = :nid", array(':nid' => $nid));
+  foreach ($result as $signup) {
     $signups[] = $signup;
   }
   return $signups;
 }
 
 /**
- * Implementation of hook_content_extra_fields().
+ * Implements hook_content_extra_fields().
  */
 function signup_content_extra_fields($type_name) {
   $extra = array();
-  if (variable_get('signup_node_default_state_'. $type_name, 'disabled') != 'disabled') {
+  if (variable_get('signup_node_default_state_' . $type_name, 'disabled') != 'disabled') {
     if (variable_get('signup_form_location', 'node') == 'node') {
       $extra['signup_node_info'] = array(
         'label' => t('Signup information'),
@@ -1088,8 +1154,8 @@ function signup_content_extra_fields($type_name) {
 function signup_cancel_signup($signup, $notify_user = TRUE) {
   // If we only have a numeric sid argument, load the full signup object.
   if (is_numeric($signup)) {
-    $query = db_query('SELECT * FROM {signup_log} WHERE sid = %d', $signup);
-    $signup = db_fetch_object($query);
+    $query = db_query('SELECT * FROM {signup_log} WHERE sid = :sid', array(':sid' => $signup));
+    $signup = $query->fetchObject();
   }
 
   $node = node_load($signup->nid);
@@ -1105,7 +1171,11 @@ function signup_cancel_signup($signup, $notify_user = TRUE) {
   module_invoke_all('signup_cancel', $signup, $node);
 
   // Delete the record from the {signup_log} table.
-  db_query('DELETE FROM {signup_log} WHERE sid = %d', $signup->sid);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query('DELETE FROM {signup_log} WHERE sid = %d', $signup->sid) */
+  db_delete('signup_log')
+  ->condition('sid', $signup->sid)
+  ->execute();
   if ($notify_user) {
     drupal_set_message(t('Signup to !title cancelled.', array('!title' => l($node->title, "node/$node->nid"))));
   }
@@ -1137,14 +1207,21 @@ function signup_valid_token($token, $sid, $operation) {
  * @ingroup signup_callback
  */
 function signup_close_signup($nid, $cron = 'no') {
-  db_query("UPDATE {signup} SET status = 0 WHERE nid = %d", $nid);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("UPDATE {signup} SET status = 0 WHERE nid = %d", $nid) */
+  db_update('signup')
+  ->fields(array(
+    'status' => 0,
+  ))
+  ->condition('nid', $nid)
+  ->execute();
   if ($cron == 'no') {
     $node = node_load($nid);
     foreach (module_implements('signup_close') as $module) {
-      $function = $module .'_signup_close';
+      $function = $module . '_signup_close';
       $function($node);
     }
-    watchdog('signup', 'Signups closed for %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $nid));
+    watchdog('signup', 'Signups closed for %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $nid));
   }
 }
 
@@ -1153,14 +1230,21 @@ function signup_close_signup($nid, $cron = 'no') {
  * @ingroup signup_callback
  */
 function signup_open_signup($nid, $cron = 'no') {
-  db_query("UPDATE {signup} SET status = 1 WHERE nid = %d", $nid);
+  // TODO Please review the conversion of this statement to the D7 database API syntax.
+  /* db_query("UPDATE {signup} SET status = 1 WHERE nid = %d", $nid) */
+  db_update('signup')
+  ->fields(array(
+    'status' => 1,
+  ))
+  ->condition('nid', $nid)
+  ->execute();
   if ($cron == 'no') {
     $node = node_load($nid);
     foreach (module_implements('signup_open') as $module) {
-      $function = $module .'_signup_open';
+      $function = $module . '_signup_open';
       $function($node);
     }
-    watchdog('signup', 'Signups reopened for %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $nid));
+    watchdog('signup', 'Signups reopened for %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $nid));
   }
 }
 
@@ -1169,8 +1253,8 @@ function signup_open_signup($nid, $cron = 'no') {
  */
 function signup_content_types() {
   $signup_content_types = array();
-  foreach (node_get_types('names') as $content_type => $content_name) {
-    if (variable_get('signup_node_default_state_'. $content_type, 'disabled') != 'disabled') {
+  foreach (node_type_get_names() as $content_type => $content_name) {
+    if (variable_get('signup_node_default_state_' . $content_type, 'disabled') != 'disabled') {
       $signup_content_types[] = $content_type;
     }
   }
@@ -1206,7 +1290,7 @@ function signup_content_types() {
  *   When set to TRUE, node_load() is called with the optional reset
  *   argument as TRUE. This can sometimes be helpful when signups
  *   have been opened with signup_open_signup() since that function
- *   can cause static caching of the node object, thus leading to the 
+ *   can cause static caching of the node object, thus leading to the
  *   $node->signup_status check here failing when it should not.
  *
  * @return
@@ -1214,7 +1298,7 @@ function signup_content_types() {
  *   user is already signed up or signups are not allowed on the given node.
  */
 function signup_sign_up_user($signup_form, $notify_user = TRUE, $reset_node_load = FALSE) {
-  if ($reset_node_load) { 
+  if ($reset_node_load) {
     $node = node_load($signup_form['nid'], NULL, TRUE);
   }
   else {
@@ -1232,8 +1316,8 @@ function signup_sign_up_user($signup_form, $notify_user = TRUE, $reset_node_load
     // Ensure the uid is 0 for anonymous signups, even if it's not duplicate.
     $signup_form['uid'] = 0;
     // Now, see if this email is already signed-up.
-    if (db_result(db_query("SELECT COUNT(*) FROM {signup_log} WHERE anon_mail = '%s' AND nid = %d", $signup_anon_mail, $node->nid))) {
-      drupal_set_message(t('Anonymous user %email is already signed up for %title', array('%email' => $signup_anon_mail, '%title' => $node->title), 'error'));
+    if ((bool) db_query_range("SELECT 1 FROM {signup_log} WHERE anon_mail = :mail AND nid = :nid", 0, 1, array(':mail' => $signup_anon_mail, ':nid' => $node->nid))->fetchField()) {
+      drupal_set_message(t('Anonymous user %email is already signed up for %title', array('%email' => $signup_anon_mail, '%title' => $node->title), array('langcode' => 'error')));
       return FALSE;
     }
   }
@@ -1241,20 +1325,20 @@ function signup_sign_up_user($signup_form, $notify_user = TRUE, $reset_node_load
     // This query does the JOIN on {users} so we can avoid a full
     // user_load() just so theme('username') can have the data it
     // needs for the error message we might print out.
-    $result = db_query("SELECT sl.uid, u.name FROM {signup_log} sl INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.uid = %d AND sl.nid = %d", $signup_form['uid'], $signup_form['nid']);
-    $account = db_fetch_object($result);
+    $result = db_query("SELECT sl.uid, u.name FROM {signup_log} sl INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.uid = :uid AND sl.nid = :nid", array(':uid' => $signup_form['uid'], ':nid' => $signup_form['nid']));
+    $account = $result->fetchObject();
     if (!empty($account)) {
-      drupal_set_message(t('User !user is already signed up for %title', array('!user' => theme('username', $account), '%title' => $node->title)), 'error');
+      drupal_set_message(t('User !user is already signed up for %title', array('!user' => theme('username', array('account' => $account)), '%title' => $node->title)), 'error');
       return FALSE;
     }
   }
 
   // If we made it this far, we're going to need the full user object.
-  $account = user_load(array('uid' => $signup_form['uid']));
+  $account = user_load($signup_form['uid']);
 
   if ($node->signup_status) {
     // Grab the current time once, since we need it in a few places.
-    $current_time = time();
+    $current_time = REQUEST_TIME;
 
     // Allow other modules to inject data into the user's signup data.
     $extra = module_invoke_all('signup_sign_up', $node, $account);
@@ -1268,8 +1352,8 @@ function signup_sign_up_user($signup_form, $notify_user = TRUE, $reset_node_load
 
     // Figure out if confirmation or reminder emails will be sent and
     // inform the user.
-    $confirmation_email = $node->signup_send_confirmation ? '  '. t('A confirmation email will be sent shortly containing further information about this %node_type.', array('%node_type' => node_get_types('name', $node->type))) : '';
-    $reminder_email = $node->signup_send_reminder ? '  '. t('A reminder email will be sent !number !days before the %node_type.', array('!number' => $node->signup_reminder_days_before, '!days' => format_plural($node->signup_reminder_days_before, 'day', 'days'), '%node_type' => node_get_types('name', $node->type))) : '';
+    $confirmation_email = $node->signup_send_confirmation ? '  ' . t('A confirmation email will be sent shortly containing further information about this %node_type.', array('%node_type' => node_type_get_name($node->type))) : '';
+    $reminder_email = $node->signup_send_reminder ? '  ' . t('A reminder email will be sent !number !days before the %node_type.', array('!number' => $node->signup_reminder_days_before, '!days' => format_plural($node->signup_reminder_days_before, 'day', 'days'), '%node_type' => node_type_get_name($node->type))) : '';
 
     // Construct the appropriate $signup object representing this signup.
     $signup = new stdClass;
@@ -1353,7 +1437,7 @@ function signup_send_confirmation_mail($signup, $node) {
   if (empty($user_mail)) {
     return FALSE;
   }
-  $node_type_name = node_get_types('name', $node->type);
+  $node_type_name = node_type_get_name($node->type);
   $params = array(
     'subject' => t('Signup confirmation for !node_type: !title', array('!node_type' => $node_type_name, '!title' => $node->title)),
     'body' => $node->signup_confirmation_email,
@@ -1364,7 +1448,7 @@ function signup_send_confirmation_mail($signup, $node) {
     $params['body'] = token_replace_multiple($params['body'], array('node' => $node, 'signup' => $signup, 'global' => NULL));
   }
   $language = user_preferred_language($signup);
-  return  drupal_mail('signup', 'signup_confirmation_mail', $user_mail, $language, $params);
+  return drupal_mail('signup', 'signup_confirmation_mail', $user_mail, $language, $params);
 }
 
 /**
@@ -1393,29 +1477,29 @@ function signup_send_forwarding_mail($signup, $node) {
   }
   $message = t('The following information was submitted as a signup for !title', array('!title' => $node->title));
   if (_signup_get_node_scheduler($node) != 'none') {
-    $message .= "\n\r". t('Date/Time: !time', array('!time' => signup_format_date($node)));
+    $message .= "\n\r" . t('Date/Time: !time', array('!time' => signup_format_date($node)));
   }
 
-  $message .= "\n\r\n\r". t('Username: !name', array('!name' => empty($signup->uid) ? variable_get('anonymous', t('Anonymous')) : $signup->name));
+  $message .= "\n\r\n\r" . t('Username: !name', array('!name' => empty($signup->uid) ? variable_get('anonymous', t('Anonymous')) : $signup->name));
   if (!empty($signup->uid)) {
     // For authenticated users, just include a link to their profile page.
-    $message .= "\n\r". t('Profile page: !url', array('!url' => url('user/'. $signup->uid, array('absolute' => TRUE))));
+    $message .= "\n\r" . t('Profile page: !url', array('!url' => url('user/' . $signup->uid, array('absolute' => TRUE))));
   }
   else {
     // For anonymous users, their email is all we've got, so disclose it.
-    $message .= "\n\r". t('E-mail: !email', array('!email' => $user_mail));
+    $message .= "\n\r" . t('E-mail: !email', array('!email' => $user_mail));
   }
   if (!empty($signup->form_data)) {
-    $message .= "\n\r\n\r". theme('signup_email_token_custom_data', $signup->form_data);
+    $message .= "\n\r\n\r" . theme('signup_email_token_custom_data', array('signup_data' => $signup->form_data));
   }
-  $node_type_name = node_get_types('name', $node->type);
+  $node_type_name = node_type_get_name($node->type);
   $from = variable_get('site_mail', ini_get('sendmail_from'));
   $params = array(
     'subject' => t('Signup confirmation for !node_type: !title', array('!node_type' => $node_type_name, '!title' => $node->title)),
     'body' => $message,
     'node' => $node,
     'signup' => $signup,
-    'header' => array('From' => t('New !node_type Signup', array('!node_type' => $node_type_name)) ."<$from>"),
+    'header' => array('From' => t('New !node_type Signup', array('!node_type' => $node_type_name)) . "<$from>"),
   );
   if (module_exists('token')) {
     $params['body'] = token_replace_multiple($params['body'], array('node' => $node, 'signup' => $signup, 'global' => NULL));
@@ -1504,23 +1588,23 @@ function signup_id_safe($string) {
   // If the first character is not a-z, add 'id' in front.
   // Don't use ctype_alpha since it's locale aware.
   if (!ctype_lower($string{0})) {
-    $string = 'id'. $string;
+    $string = 'id' . $string;
   }
   return $string;
 }
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function signup_views_api() {
   return array(
     'api' => 2.0,
-    'path' => drupal_get_path('module', 'signup') .'/views',
+    'path' => drupal_get_path('module', 'signup') . '/views',
   );
 }
 
 /**
- * Implementation of hook_mail().
+ * Implements hook_mail().
  *
  * Constructs all of the email messages generated by the signup module.
  *
@@ -1573,7 +1657,7 @@ function _signup_get_email_tokens($node, $signup) {
   // Tokens about the node itself are easy and don't require any logic.
   $tokens = array(
     '%node_title' => $node->title,
-    '%node_url' => url('node/'. $node->nid, array('absolute' => TRUE)),
+    '%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)),
     '%node_start_time' => signup_format_date($node),
   );
 
@@ -1590,7 +1674,7 @@ function _signup_get_email_tokens($node, $signup) {
     else {
       $signup_data = unserialize($signup->form_data);
     }
-    $tokens['%user_signup_info'] = theme('signup_email_token_custom_data', $signup_data);
+    $tokens['%user_signup_info'] = theme('signup_email_token_custom_data', array('signup_data' => $signup_data));
   }
   else {
     $tokens['%user_signup_info'] = '';
@@ -1642,10 +1726,10 @@ function _signup_get_username($signup, $link = FALSE) {
   }
   // Determine if this is an anon signup or not, and get the right info.
   if (!empty($signup->anon_mail)) {
-    $user_name = theme('signup_anonymous_username', $signup_data, $signup->anon_mail);
+    $user_name = theme('signup_anonymous_username', array('form_data' => $signup_data, 'email' => $signup->anon_mail));
   }
   elseif ($link) {
-    $user_name = theme('username', $signup);
+    $user_name = theme('username', array('account' => $signup));
   }
   else {
     $user_name = $signup->name;
@@ -1662,7 +1746,7 @@ function _signup_get_cancel_link($sid) {
 }
 
 /**
- * Implementation of hook_panels_include_directory().
+ * Implements hook_panels_include_directory().
  *
  * @param $plugin_type
  *   The plugin type for which the Panels engine is currently requesting the
@@ -1674,7 +1758,7 @@ function _signup_get_cancel_link($sid) {
  */
 function signup_panels_include_directory($plugin_type) {
   if ($plugin_type == 'content_types') {
-    return 'panels/'. $plugin_type;
+    return 'panels/' . $plugin_type;
   }
 }
 
@@ -1720,7 +1804,7 @@ function signup_view_user_list_access($view_name, $display_id, $argument_name) {
 }
 
 /**
- * Implement hook_token_list() (from token.module)
+ * Implements hook_token_list() (from token.module)().
  */
 function signup_token_list($type) {
   $tokens = array();
@@ -1750,7 +1834,7 @@ function signup_token_list($type) {
 }
 
 /**
- * Implement hook_token_values() (from token.module)
+ * Implements hook_token_values() (from token.module)().
  */
 function signup_token_values($type = 'all', $object = NULL) {
   $values = array();
@@ -1763,7 +1847,7 @@ function signup_token_values($type = 'all', $object = NULL) {
     else {
       $values['node-signup-enabled'] = t('enabled');
       $values['node-signup-status'] = $object->signup_status ? t('open') : t('closed');
-      $values['node-signup-limit'] = (int)$object->signup_close_signup_limit;
+      $values['node-signup-limit'] = (int) $object->signup_close_signup_limit;
     }
   }
   elseif ($type == 'signup') {
@@ -1777,12 +1861,11 @@ function signup_token_values($type = 'all', $object = NULL) {
       }
     }
     $values['signup-sid'] = $object->sid;
-    $values['signup-user-data'] = theme('signup_custom_data', $signup_data);
-    $values['signup-user-data-raw'] = theme('signup_email_token_custom_data', $signup_data);
-    $values['signup-date-short'] = format_date($object->signup_time, 'small');
+    $values['signup-user-data'] = theme('signup_custom_data', array('data' => $signup_data));
+    $values['signup-user-data-raw'] = theme('signup_email_token_custom_data', array('signup_data' => $signup_data));
+    $values['signup-date-short'] = format_date($object->signup_time, 'short');
     $values['signup-date-medium'] = format_date($object->signup_time, 'medium');
-    $values['signup-date-long'] = format_date($object->signup_time, 'large');
-'';
+    $values['signup-date-long'] = format_date($object->signup_time, 'long');
     $values['signup-cancel-url'] = _signup_get_cancel_link($object->sid);
     if (!empty($object->anon_mail)) {
       $values['signup-email'] = $object->anon_mail;
@@ -1795,7 +1878,7 @@ function signup_token_values($type = 'all', $object = NULL) {
     }
     $values['signup-anonymous-email'] = !empty($object->anon_mail) ? $object->anon_mail : '';
     $attended = isset($signup->attended) ? $signup->attended : NULL;
-    $values['signup-attendence'] = check_plain(theme('signup_attended_text', $attended));
+    $values['signup-attendence'] = check_plain(theme('signup_attended_text', array('attended' => $attended)));
     $values['signup-id'] = $object->sid;
   }
   return $values;
diff --git signup.test signup.test
new file mode 100644
index 0000000..99fc437
--- /dev/null
+++ signup.test
@@ -0,0 +1,25 @@
+<?php
+// $Id$
+
+
+/**
+ * @file
+ * Tests for the signup module
+ */
+
+class SignupTestCase extends DrupalWebTestCase {
+
+  public function setUp() {
+    parent::setUp('signup');
+  }
+
+  public function getInfo() {
+    return array(
+      'name' => 'Signup stub functionality',
+      'description' => 'Stub for testing functionality of the Signup module.',
+      'group' => 'Signup',
+    );
+  }
+
+}
+
diff --git theme/admin.inc theme/admin.inc
index eda38de..241cd08 100644
--- theme/admin.inc
+++ theme/admin.inc
@@ -16,65 +16,27 @@
  * results by signup status, which is rendered at the top of the page by
  * default.
  *
- * @param $filter_status_form
- *   HTML representation of the signup status filter form.
- * @param $signup_admin_form
- *   HTML representation of the main signup administration form.
+ * @param $variables
+ *   An array of variables containing:
+ *   - 'filter_status_form': HTML representation of the signup status filter
+ *     form.
+ *   - 'signup_admin_form': HTML representation of the main signup
+ *     administration form.
  *
  * @return
  *   Themed output for the signup administration overview page.
  */
-function theme_signup_admin_page($filter_status_form, $signup_admin_form) {
-  $output = $filter_status_form;
-  $output .= $signup_admin_form;
+function theme_signup_admin_page($variables) {
+  $output = drupal_render($variables['filter_status_form']);
+  $output .= drupal_render($variables['signup_admin_form']);
   return $output;
 }
 
-function theme_signup_filter_status_form($form) {
-  return '<div class="container-inline">'. drupal_render($form) .'</div>';
-}
-
-function theme_signup_admin_form($form) {
-  if (!isset($form['nids'])) {
-    $type = $_SESSION['signup_status_filter'];
-    switch ($type) {
-      case 'open':
-        $filter = t('open');
-        break;
-
-      case 'closed':
-        $filter = t('closed');
-        break;
-
-      default:
-        $filter = t('enabled');
-        break;
-    }
-    return t('No content is currently !status for signups.', array('!status' => $filter));
-  }
-  foreach ($form['nids'] as $nid => $node_form) {
-    if (!is_numeric($nid)) {
-      continue;
-    }
-    $row = array();
-    if (isset($node_form['start'])) {
-      $row[] = drupal_render($form['nids'][$nid]['start']);
-    }
-    $row[] = drupal_render($form['nids'][$nid]['title']);
-    $row[] = drupal_render($form['nids'][$nid]['total']);
-    $row[] = drupal_render($form['nids'][$nid]['limit']);
-    $row[] = drupal_render($form['nids'][$nid]['status']);
-    $row[] = drupal_render($form['nids'][$nid]['operations']);
-    $rows[] = $row;
-  }
-  $header = $form['header']['#value'];
-  unset($form['header']);
-  $output = theme('table', $header, $rows, array('style' => 'width:100%'));
-  $output .= drupal_render($form);
-  $pager = theme('pager', NULL, 25, 0);
-  if (!empty($pager)) {
-    $output .= $pager;
-  }
-  return $output;
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function theme_signup_filter_status_form($variables) {
+  $form = $variables['form'];
+  return '<div class="container-inline">' . drupal_render_children($form) . '</div>';
 }
-
diff --git theme/email.inc theme/email.inc
index fdf0aeb..c270919 100644
--- theme/email.inc
+++ theme/email.inc
@@ -16,8 +16,8 @@
  * @see theme_signup_user_form()
  * @see theme_signup_custom_data_email()
  */
-function theme_signup_email_token_custom_data($signup_data) {
-  return t('SIGNUP INFORMATION') ."\n\r". theme('signup_custom_data_email', $signup_data);
+function theme_signup_email_token_custom_data($variables) {
+  return t('SIGNUP INFORMATION') . "\n\r" . theme('signup_custom_data_email', array('data' => $variables['signup_data']));
 }
 
 /**
@@ -35,17 +35,19 @@ function theme_signup_email_token_custom_data($signup_data) {
  *
  * @see theme_signup_user_form()
  */
-function theme_signup_custom_data_email($data) {
+function theme_signup_custom_data_email($variables) {
+  $data = $variables['data'];
+
   $output = '';
   // Loop through each first level element.
   foreach ($data as $key => $value) {
     if (is_array($value)) {
       // Element is nested, render it recursively.
       // Instead of the overhead of theme(), just call ourself directly.
-      $output .= "\n\r". call_user_func(__FUNCTION__, $value) ."\n\r";
+      $output .= "\n\r" . call_user_func(__FUNCTION__, $value) . "\n\r";
     }
     else {
-      $output .= theme('signup_custom_data_field_text', $key, $value) ."\n\r";
+      $output .= theme('signup_custom_data_field_text', array('key' => $key, 'value' => $value)) . "\n\r";
     }
   }
   return $output;
@@ -64,14 +66,17 @@ function theme_signup_custom_data_email($data) {
  *
  * @see theme_signup_user_form()
  */
-function theme_signup_custom_data_field_text($key, $value) {
+function theme_signup_custom_data_field_text($variables) {
+  $key = $variables['key'];
+  $value = $variables['value'];
+
   // All of the possible array key values should already be translated as
   // string literals in theme_signup_user_form() via the #title attributes, so
   // passing a variable to t() is actually safe here.  However, to avoid
   // warnings when extracting strings, "hide" the call to t() by using a
   // variable to hold the function name.
   $tr = 't';
-  return $tr($key) .': '. $value;
+  return $tr($key) . ': ' . $value;
 }
 
 /**
@@ -85,13 +90,16 @@ function theme_signup_custom_data_field_text($key, $value) {
  * @return
  *   The final text to put in the email body sent to the broadcast sender.
  */
-function theme_signup_broadcast_sender_copy($raw_message, $cooked_message) {
-  $output = t('This is a copy of the signup broadcast you just sent.') ."\n";
-  $output .= wordwrap(t('Here is the original text you entered, with none of the tokens replaced:'), 72) ."\n";
+function theme_signup_broadcast_sender_copy($variables) {
+  $raw_message = $variables['raw_message'];
+  $cooked_message = $variables['cooked_message'];
+
+  $output = t('This is a copy of the signup broadcast you just sent.') . "\n";
+  $output .= wordwrap(t('Here is the original text you entered, with none of the tokens replaced:'), 72) . "\n";
   $output .= "----------\n";
   $output .= $raw_message;
   $output .= "\n----------\n\n";
-  $output .= wordwrap(t('Here is how the message that was sent to each user looked, with all of the tokens replaced (using your account for the user-related tokens):'), 72) ."\n";
+  $output .= wordwrap(t('Here is how the message that was sent to each user looked, with all of the tokens replaced (using your account for the user-related tokens):'), 72) . "\n";
   $output .= "----------\n";
   $output .= $cooked_message;
   $output .= "\n----------\n\n";
diff --git theme/no_views.inc theme/no_views.inc
deleted file mode 100644
index 6f21cd3..0000000
--- theme/no_views.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-// $Id: no_views.inc,v 1.2 2008/11/19 18:30:07 dww Exp $
-
-
-/**
- * @file
- * Deprecated code if you don't have Views enabled.
- */
-
-/**
- * Formats the list of users signed up for a particular node.
- *
- * @param $node
- *   The node object that users have signed up for.
- * @param $registered_signups
- *   Array of objects with data for each registered user signed up.
- * @param $anon_signups
- *   Array of objects with data for each anonymous user signed up.
- */
-function theme_signup_user_list($node, $registered_signups, $anon_signups) {
-  $header = array(array('data' => t('!users signed up', array('!users' => format_plural((count($registered_signups) + count($anon_signups)), '1 individual', '@count individuals')))));
-  $rows = array();
-  foreach ($registered_signups as $signup) {
-    $rows[] = array(theme('username', $signup));
-  }
-  if (!empty($anon_signups)) {
-    $rows[] = array(t('!count anonymous', array('!count' => count($anon_signups))));
-  }
-  return theme('table', $header, $rows);
-}
-
-/**
- * Format a user signup for display in a schedule list.
- *
- * @param node
- *   The node which needs theming
- */
-function theme_signup_user_schedule($node) {
-  $output = '';
-  $output .= '<div class="signup-user-schedule"><div class="'. $node->type .'signup-title"><h4>'. l($node->title, "node/$node->nid") .'</h4></div></div>';
-  return $output;
-}
-
diff --git theme/node.admin.inc theme/node.admin.inc
index 38cb492..c07f959 100644
--- theme/node.admin.inc
+++ theme/node.admin.inc
@@ -16,17 +16,21 @@
  * signup_node_admin_page()), and if the node is signup-enabled, the
  * form to signup other users.
  *
- * @param $node
- *   The node object for the signup-enabled node this is a tab on.
- * @param $signup_node_admin_summary_form
- *   The rendered HTML for the signup node summary form (to set the signup
- *   limit, open/close signups, see the total number of signups, etc).
- * @param $signup_node_admin_details_form
- *   The rendered HTML for the signup node details form (to view all the users
- *   who have signed up, their full signup details, and checkboxes to cancel
- *   multiple signups at once.
+ * @param $variables
+ *   An array of variables including:
+ *   - 'node': The node object for the signup-enabled node this is a tab on.
+ *   - 'signup_node_admin_summary_form': The rendered HTML for the signup node
+ *     summary form (to set the signup limit, open/close signups, see the total
+ *     number of signups, etc).
+ *   - 'signup_node_admin_details_form': The rendered HTML for the signup node
+ *     details form (to view all the users who have signed up, their full
+ *     signup details, and checkboxes to cancel multiple signups at once.
  */
-function theme_signup_node_admin_page($node, $signup_node_admin_summary_form, $signup_node_admin_details_form) {
+function theme_signup_node_admin_page($variables) {
+  $node = $variables['node'];
+  $signup_node_admin_summary_form = $variables['signup_node_admin_summary_form'];
+  $signup_node_admin_details_form = $variables['signup_node_admin_details_form'];
+
   $output = '';
 
   // Administrative summary table to control signups for this node.
@@ -41,7 +45,8 @@ function theme_signup_node_admin_page($node, $signup_node_admin_summary_form, $s
 /**
  * Renders the HTML for the per-node signup summary administrative form.
  */
-function theme_signup_node_admin_summary_form($form) {
+function theme_signup_node_admin_summary_form($variables) {
+  $form = $variables['form'];
   $output = '';
   $output .= '<div class="container-inline">' . drupal_render($form['status']);
   if (!empty($form['submit']) && $form['status']['#type'] == 'select') {
@@ -66,21 +71,31 @@ function theme_signup_node_admin_summary_form($form) {
       }
     }
   }
-  $output .= drupal_render($form);
+  $output .= drupal_render_children($form);
   $fieldset = array(
     '#title' => t('Signup summary'),
     '#collapsible' => TRUE,
     '#collapsed' => FALSE,
+    '#attributes' => array(),
+    '#children' => '',
     '#value' => $output,
   );
-  return theme('fieldset', $fieldset);
+  return theme('fieldset', array('element' => $fieldset));
 }
 
-function theme_signup_node_admin_details_form($form) {
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function theme_signup_node_admin_details_form($variables) {
+  $form = $variables['form'];
+
   $fieldset = array(
     '#title' => t('Signup details'),
     '#collapsible' => TRUE,
     '#collapsed' => FALSE,
+    '#attributes' => array(),
+    '#children' => '',
   );
   if (!empty($form['users']['#options'])) {
     $header = $form['#header'];
@@ -98,12 +113,12 @@ function theme_signup_node_admin_details_form($form) {
     $fieldset['#value'] .= drupal_render($form['operation']);
     $fieldset['#value'] .= drupal_render($form['submit']);
     $fieldset['#value'] .= '</div>';
-    $fieldset['#value'] .= theme('table', $header, $rows);
+    $fieldset['#value'] .= theme('table', array('header' => $header, 'rows' => $rows));
   }
   else {
-    $fieldset['#value'] = '<span>'. drupal_render($form['no_users']) .'</span>';
+    $fieldset['#value'] = '<span>' . drupal_render($form['no_users']) . '</span>';
   }
-  return theme('fieldset', $fieldset) . drupal_render($form);
+  return theme('fieldset', array('element' => $fieldset)) . drupal_render_children($form);
 }
 
 /**
@@ -113,15 +128,18 @@ function theme_signup_node_admin_details_form($form) {
  * nested data), so if you override it, be sure not to change the part
  * where it does "call_user_func(__FUNCTION__)".
  *
- * @param $data
- *   Array of custom user signup data.
+ * @param $variables
+ *   An array of variables including:
+ *   - 'data': Array of custom user signup data.
  *
  * @return
  *   User data directly formatted in divs.
  *
  * @see theme_signup_user_form()
  */
-function theme_signup_custom_data($data) {
+function theme_signup_custom_data($variables) {
+  $data = $variables['data'];
+
   $output = '';
   // All of the possible array key values should already be translated as
   // string literals in theme_signup_user_form() via the #title attributes, so
@@ -131,21 +149,27 @@ function theme_signup_custom_data($data) {
   $tr = 't';
   // Loop through each first level element.
   foreach ($data as $key => $value) {
-    $output .= '<div id="'. signup_id_safe($key) .'">';
+    $output .= '<div id="' . signup_id_safe($key) . '">';
     if (is_array($value)) {
       // Element is nested, render it recursively.
       // Instead of the overhead of theme(), just call ourself directly.
       $output .= call_user_func(__FUNCTION__, $value);
     }
     else {
-      $output .= $tr($key) .': '. check_plain($value);
+      $output .= $tr($key) . ': ' . check_plain($value);
     }
     $output .= "</div>\n";
   }
   return $output;
 }
 
-function theme_signup_attended_text($attended = NULL) {
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function theme_signup_attended_text($variables) {
+  $attended = $variables['attended'];
+
   if ($attended === NULL) {
     return '';
   }
diff --git theme/node.inc theme/node.inc
index 72da06e..1382889 100644
--- theme/node.inc
+++ theme/node.inc
@@ -10,11 +10,11 @@
 /**
  * Controls the output displayed if this node is closed for signups.
  *
- * @param $node
- *   The fully loaded node object.
- * @param $current_signup
- *   If the user already signed up, an HTML representation of their current
- *   signup information, otherwise an empty string.
+ * @param $variables
+ *   An array of variables containing:
+ *   - 'node': The fully loaded node object.
+ *   - 'current_signup': If the user already signed up, an HTML representation
+ *     of their current signup information, otherwise an empty string.
  *
  * @return
  *   Themed output to display for a node with closed signups.
@@ -22,8 +22,11 @@
  * @see _signup_node_output()
  * @see _signup_print_current_signup()
  */
-function theme_signup_signups_closed($node, $current_signup = '') {
-  $output = '<h3>'. t('Signups closed for this %node_type', array('%node_type' => node_get_types('name', $node->type))) .'</h3>';
+function theme_signup_signups_closed($variables) {
+  $node = $variables['node'];
+
+  $current_signup = $variables['current_signup'];
+  $output = '<h3>' . t('Signups closed for this %node_type', array('%node_type' => node_type_get_name($node->type))) . '</h3>';
   $output .= $current_signup;
   return $output;
 }
@@ -31,39 +34,46 @@ function theme_signup_signups_closed($node, $current_signup = '') {
 /**
  * Controls the output for anonymous users who can't signup.
  *
- * @param $anon_login_text
- *   The translated HTML help text telling users to login (and if allowed on
- *   this site, register) so they can signup, including login/register links.
+ * @param $variables
+ *   An array of variables containing:
+ *   - 'anon_login_text': The translated HTML help text telling users to login
+ *     (and if allowed on this site, register) so they can signup, including
+ *     login/register links.
  *
  * @return
  *   The themed HTML to display the login (and maybe register) help text.
  */
-function theme_signup_anonymous_user_login_text($anon_login_text) {
-  if (!empty($anon_login_text)) {
-    return '<div class="signup_anonymous_login">'. $anon_login_text .'</div>';
+function theme_signup_anonymous_user_login_text($variables) {
+  if (!empty($variables['anon_login_text'])) {
+    return '<div class="signup_anonymous_login">' . $variables['anon_login_text'] . '</div>';
   }
 }
 
 /**
  * Return HTML desired at the top of the signup output for a node.
  *
- * @param $node
- *   The fully loaded node object to generate a header for.
+ * @param $variables
+ *   An array of variables containing:
+ *   - 'node': The fully loaded node object to generate a header for.
  *
  * @return
  *   HTML to display at the top of the signup output.
  *
  * @see _signup_node_output()
  */
-function theme_signup_node_output_header($node) {
+function theme_signup_node_output_header($variables) {
   return '<a name="signup"></a>';
 }
 
-/*
+/**
  * Return HTML desired when displaying a node title along with the signup date.
  */
-function theme_signup_node_title($node) {
-  $date_field = signup_date_field($node->type);
+function theme_signup_node_title($variables) {
+  $node = $variables['node'];
+  $date_formatted = '';
+
+  // TODO: date.inc needs to be ported to D7 before using this.
+  /* $date_field = signup_date_field($node->type);
   if (!empty($date_field)) {
     $date_field_name = $date_field['field_name'];
     $this_date_field = $node->$date_field_name;
@@ -72,6 +82,7 @@ function theme_signup_node_title($node) {
       $date_formatted = ' - ' . $date_formatted;
     }
   }
+  */
+  return l($node->title, 'node/' . $node->nid) . $date_formatted;
+}
 
-  return l($node->title, 'node/'. $node->nid) . $date_formatted;
-}
\ No newline at end of file
diff --git theme/signup_form.inc theme/signup_form.inc
index 373bd14..6b353ea 100644
--- theme/signup_form.inc
+++ theme/signup_form.inc
@@ -36,15 +36,18 @@
  * If you do not want any additional fields, the function can simply
  * return an empty array: "return array();"
  *
- * @param $node
- *   The fully loaded node object where this signup form is appearing.
+ * @param $variables
+ *   An array of variables including:
+ *   - 'node': The fully loaded node object where this signup form is appearing.
  *
  * @return
  *   Array defining the form to present to the user to signup for a node.
  *
  * @see theme_signup_anonymous_username()
  */
-function theme_signup_user_form($node) {
+function theme_signup_user_form($variables) {
+  $node = $variables['node'];
+
   global $user;
   $form = array();
   if (variable_get('signup_ignore_default_fields', 0)) {
@@ -57,13 +60,15 @@ function theme_signup_user_form($node) {
   $form['signup_form_data']['Name'] = array(
     '#type' => 'textfield',
     '#title' => t('Name'),
-    '#size' => 40, '#maxlength' => 64,
+    '#size' => 40,
+    '#maxlength' => 64,
     '#required' => TRUE,
   );
   $form['signup_form_data']['Phone'] = array(
     '#type' => 'textfield',
     '#title' => t('Phone'),
-    '#size' => 40, '#maxlength' => 64,
+    '#size' => 40,
+    '#maxlength' => 64,
   );
 
   // If the user is logged in, fill in their name by default.
@@ -84,16 +89,20 @@ function theme_signup_user_form($node) {
  * This value is used for the %user_name email token for anonymous users, and
  * also to identify a particular anonymous signup in various places in the UI.
  *
- * @param $form_data
- *   Array of custom signup form values for the current signup.
- * @param $email
- *   E-mail address of the anonymous user who signed up.
+ * @param $variables
+ *   An array of variables including:
+ *   - 'form_data': Array of custom signup form values for the current signup.
+ *   - 'email': E-mail address of the anonymous user who signed up.
+ *
  * @return
  *   A string with the proper value for the %user_name email token.
  *
  * @see theme_signup_user_form()
  */
-function theme_signup_anonymous_username($form_data, $email) {
+function theme_signup_anonymous_username($variables) {
+  $form_data = $variables['form_data'];
+  $email = $variables['email'];
+
   // In some cases, the best you can do is to use the anonymous user's
   // supplied email address, in which case, you should uncomment this:
   //return $email;
--- views/handlers/signup_handler_argument_signup_user_uid.inc
+++ views/handlers/signup_handler_argument_signup_user_uid.inc
@@ -20,7 +20,7 @@ class signup_handler_argument_signup_user_uid extends views_handler_argument_num
       'value' => $this->argument,
     );
     $alias = $this->query->add_table($this->table, $this->relationship, $join);
-    $this->query->add_where(0, "$alias.$this->real_field IS NULL");
+    $this->query->add_where(0, "$alias.$this->real_field", NULL, 'IS NULL');
   }
 }
 
diff --git views/handlers/signup_handler_field_signup_edit_link.inc views/handlers/signup_handler_field_signup_edit_link.inc
index a1c3d00..ef33c3e 100644
--- views/handlers/signup_handler_field_signup_edit_link.inc
+++ views/handlers/signup_handler_field_signup_edit_link.inc
@@ -7,15 +7,21 @@
 class signup_handler_field_signup_edit_link extends views_handler_field_node_link {
   function construct() {
     parent::construct();
-    $this->additional_fields['sid'] = array('table' => 'signup_log', 'field' => 'sid');
-    $this->additional_fields['uid'] = array('table' => 'signup_log', 'field' => 'uid');
+    $this->additional_fields['sid'] = array(
+      'table' => 'signup_log',
+      'field' => 'sid',
+    );
+    $this->additional_fields['uid'] = array(
+      'table' => 'signup_log',
+      'field' => 'uid',
+    );
   }
 
   function render($values) {
     global $user;
 
     // Check access to edit this signup.
-    $signup = new StdClass();
+    $signup = new stdClass();
     $signup->sid = $values->{$this->aliases['sid']};
     $signup->nid = $values->{$this->aliases['nid']};
     $signup->uid = $values->{$this->aliases['uid']};
diff --git views/handlers/signup_handler_field_signup_node_link.inc views/handlers/signup_handler_field_signup_node_link.inc
index 6915d87..b1d982d 100644
--- views/handlers/signup_handler_field_signup_node_link.inc
+++ views/handlers/signup_handler_field_signup_node_link.inc
@@ -7,8 +7,14 @@
 class signup_handler_field_signup_node_link extends views_handler_field_node_link {
   function construct() {
     parent::construct();
-    $this->additional_fields['uid'] = array('table' => 'node', 'field' => 'uid');
-    $this->additional_fields['signup_status'] = array('table' => 'signup', 'field' => 'status');
+    $this->additional_fields['uid'] = array(
+      'table' => 'node',
+      'field' => 'uid',
+    );
+    $this->additional_fields['signup_status'] = array(
+      'table' => 'signup',
+      'field' => 'status',
+    );
   }
 
   function options_form(&$form, &$form_state) {
@@ -36,7 +42,7 @@ class signup_handler_field_signup_node_link extends views_handler_field_node_lin
 
   function render($values) {
     $tab = $this->options['tab'];
-    $node = new StdClass();
+    $node = new stdClass();
     $node->nid = $values->{$this->aliases['nid']};
     $node->uid = $values->{$this->aliases['uid']};
     $node->signup_status = $values->{$this->aliases['signup_status']};
@@ -80,7 +86,7 @@ class signup_handler_field_signup_node_link extends views_handler_field_node_lin
   }
 
   function check_access($node, $tab) {
-    switch ($tab) {    
+    switch ($tab) {
       case 'signup':
         // Slightly complicated, since _signup_menu_access() is testing if we
         // want the signup tab, but here we just want to know if the user can
diff --git views/handlers/signup_handler_field_signup_user_attended.inc views/handlers/signup_handler_field_signup_user_attended.inc
index aca0a4f..4707d5b 100644
--- views/handlers/signup_handler_field_signup_user_attended.inc
+++ views/handlers/signup_handler_field_signup_user_attended.inc
@@ -6,7 +6,7 @@
  */
 class signup_handler_field_signup_user_attended extends views_handler_field {
   function render($values) {
-    return theme('signup_attended_text', $values->{$this->field_alias});
+    return theme('signup_attended_text', array('attended' => $values->{$this->field_alias}));
   }
 }
 
diff --git views/handlers/signup_handler_field_signup_user_form_data.inc views/handlers/signup_handler_field_signup_user_form_data.inc
index 87499a5..7d07f18 100644
--- views/handlers/signup_handler_field_signup_user_form_data.inc
+++ views/handlers/signup_handler_field_signup_user_form_data.inc
@@ -26,7 +26,7 @@ class signup_handler_field_signup_user_form_data extends views_handler_field_pre
         $form_data = unserialize($result->{$this->field_alias});
         if ($form_data) {
           foreach ($form_data as $key => $value) {
-            $this->items[$result->{$this->field_alias}][$key] = check_plain(theme('signup_custom_data_field_text', $key, $value));
+            $this->items[$result->{$this->field_alias}][$key] = check_plain(theme('signup_custom_data_field_text', array('key' => $key, 'value' => $value)));
           }
         }
       }
diff --git views/handlers/signup_handler_filter_signup_disabled.inc views/handlers/signup_handler_filter_signup_disabled.inc
index 0c905ff..bcc44b9 100644
--- views/handlers/signup_handler_filter_signup_disabled.inc
+++ views/handlers/signup_handler_filter_signup_disabled.inc
@@ -6,12 +6,15 @@
  */
 class signup_handler_filter_signup_disabled extends views_handler_filter_boolean_operator {
   function get_value_options() {
-    $this->value_options = array(1 => t('Enabled'), 0 => t('Disabled'));
+    $this->value_options = array(
+      1 => t('Enabled'),
+      0 => t('Disabled'),
+    );
   }
 
   function query() {
     $this->ensure_my_table();
-    $this->query->add_where($this->options['group'], "$this->table_alias.nid ". (empty($this->value) ? 'IS' : 'IS NOT') .' NULL');
+    $this->query->add_where($this->options['group'], "$this->table_alias.nid " . (empty($this->value) ? 'IS' : 'IS NOT') . ' NULL');
   }
 }
 
diff --git views/handlers/signup_handler_filter_signup_status.inc views/handlers/signup_handler_filter_signup_status.inc
index 798adc8..0796087 100644
--- views/handlers/signup_handler_filter_signup_status.inc
+++ views/handlers/signup_handler_filter_signup_status.inc
@@ -6,7 +6,10 @@
  */
 class signup_handler_filter_signup_status extends views_handler_filter_boolean_operator {
   function get_value_options() {
-    $this->value_options = array(1 => t('Open'), 0 => t('Closed'));
+    $this->value_options = array(
+      1 => t('Open'),
+      0 => t('Closed'),
+    );
   }
 }
 
diff --git views/handlers/signup_handler_filter_signup_user_attended.inc views/handlers/signup_handler_filter_signup_user_attended.inc
index 35998d9..a180de2 100644
--- views/handlers/signup_handler_filter_signup_user_attended.inc
+++ views/handlers/signup_handler_filter_signup_user_attended.inc
@@ -6,7 +6,10 @@
  */
 class signup_handler_filter_signup_user_attended extends views_handler_filter_boolean_operator {
   function get_value_options() {
-    $this->value_options = array(1 => t('Attended'), 0 => t('Did not attend'));
+    $this->value_options = array(
+      1 => t('Attended'),
+      0 => t('Did not attend'),
+    );
   }
 }
 
diff --git views/handlers/signup_handler_filter_signup_user_authenticated.inc views/handlers/signup_handler_filter_signup_user_authenticated.inc
index c66c6dc..ae87845 100644
--- views/handlers/signup_handler_filter_signup_user_authenticated.inc
+++ views/handlers/signup_handler_filter_signup_user_authenticated.inc
@@ -6,12 +6,15 @@
  */
 class signup_handler_filter_signup_user_authenticated extends views_handler_filter_boolean_operator {
   function get_value_options() {
-    $this->value_options = array(1 => t('Authenticated'), 0 => t('Anonymous'));
+    $this->value_options = array(
+      1 => t('Authenticated'),
+      0 => t('Anonymous'),
+    );
   }
 
   function query() {
     $this->ensure_my_table();
-    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field ". ($this->value ? '!= ' : '= ') ."0");
+    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . ($this->value ? '!= ' : '= ') . "0");
   }
 }
 
diff --git views/plugins/signup_plugin_access_user_signup_list.inc views/plugins/signup_plugin_access_user_signup_list.inc
index 9465c69..5c1de58 100644
--- views/plugins/signup_plugin_access_user_signup_list.inc
+++ views/plugins/signup_plugin_access_user_signup_list.inc
@@ -36,7 +36,7 @@ class signup_plugin_access_user_signup_list extends views_plugin_access {
   function option_defaults(&$options) {
     $options['signup_user_argument'] = '';
   }
-  
+
   function options_form(&$form, &$form_state) {
     $arguments = array();
     foreach ($this->view->display_handler->get_handlers('argument') as $id => $handler) {
diff --git views/signup.views.inc views/signup.views.inc
index 1a2af37..e4305d6 100644
--- views/signup.views.inc
+++ views/signup.views.inc
@@ -11,7 +11,7 @@
  */
 
 /**
- * Implementation of hook_views_data().
+ * Implements hook_views_data().
  */
 function signup_views_data() {
   // Define the base group of the signup table.  Fields that don't
@@ -136,7 +136,7 @@ function signup_views_data() {
       'handler' => 'signup_handler_filter_signup_disabled',
       'help' => t('Filter on if signups are enabled or disabled.'),
       'label' => 'Signups',
-      ),
+    ),
   );
 
   $data['signup']['node_link'] = array(
@@ -189,9 +189,9 @@ function signup_views_data() {
     'sort' => array(
       'handler' => 'views_handler_sort',
       'help' => t('Sort by signup ID.'),
-    )
+    ),
   );
-  
+
   $data['signup_log']['nid'] = array(
     'title' => t('Node'),
     'help' => t('The node a user signed up to.'),
@@ -226,7 +226,7 @@ function signup_views_data() {
     'click sortable' => TRUE,
     'field' => array(
       'handler' => 'signup_handler_field_signup_user_email',
-      'help' => t('Email address of a user (authenticated or anonymous) who signed up.') .' <strong>'. t('WARNING: only expose this data in a view that is restricted to users whom you can trust with such sensitive information.') .'</strong>',
+      'help' => t('Email address of a user (authenticated or anonymous) who signed up.') . ' <strong>' . t('WARNING: only expose this data in a view that is restricted to users whom you can trust with such sensitive information.') . '</strong>',
     ),
   );
 
@@ -306,7 +306,7 @@ function signup_views_data() {
 }
 
 /**
- * Implementation of hook_views_handlers().
+ * Implements hook_views_handlers().
  *
  * Register information about all of the views handlers provided by the Signup
  * module.
@@ -314,7 +314,7 @@ function signup_views_data() {
 function signup_views_handlers() {
   return array(
     'info' => array(
-      'path' => drupal_get_path('module', 'signup') .'/views/handlers',
+      'path' => drupal_get_path('module', 'signup') . '/views/handlers',
     ),
     'handlers' => array(
       'signup_handler_argument_signup_user_uid' => array(
@@ -358,10 +358,10 @@ function signup_views_handlers() {
 }
 
 /**
- * Implementation of hook_views_plugins().
+ * Implements hook_views_plugins().
  */
 function signup_views_plugins() {
-  $path = drupal_get_path('module', 'signup') .'/views/plugins';
+  $path = drupal_get_path('module', 'signup') . '/views/plugins';
   return array(
     'argument validator' => array(
       'signup_status' => array(
diff --git views/signup.views_default.inc views/signup.views_default.inc
index 461111b..f7750da 100644
--- views/signup.views_default.inc
+++ views/signup.views_default.inc
@@ -12,13 +12,13 @@
  */
 function signup_views_default_views() {
   // Search the "default_views" directory for files ending in .view.php.
-  $files = file_scan_directory(drupal_get_path('module', 'signup'). '/views/default_views', 'view.php');
+  $files = file_scan_directory(drupal_get_path('module', 'signup') . '/views/default_views', '/view.php/');
   foreach ($files as $absolute => $file) {
     if (strpos($file->name, '_vbo_') !== FALSE && !module_exists('views_bulk_operations')) {
       // This is a VBO-specific view, but we don't have VBO, so skip it.
       continue;
     }
-    require_once $absolute;
+    require_once DRUPAL_ROOT . '/' . $absolute;
     if (isset($view)) {
       // $file->name has the ".php" stripped off, but still has the ".view".
       $view_name = substr($file->name, 0, strrpos($file->name, '.'));
