You are here

function _signup_date_node_completed in Signup 5.2

Same name in this branch
  1. 5.2 includes/date.5x-2.inc \_signup_date_node_completed()
  2. 5.2 includes/date.5x-1.inc \_signup_date_node_completed()
Same name and namespace in other branches
  1. 6.2 includes/date.inc \_signup_date_node_completed()
  2. 6 includes/date.inc \_signup_date_node_completed()
  3. 7 includes/date.inc \_signup_date_node_completed()

Returns TRUE if the given node is event-enabled, and the start time has already passed the "Close x hours before" setting.

1 call to _signup_date_node_completed()
_signup_node_completed in includes/scheduler.inc
Determine if the given node has date/time data and if it already started.

File

includes/date.5x-1.inc, line 67
Code required to support version 5.x-1.* of the CCK date field module.

Code

function _signup_date_node_completed($node) {
  require_once drupal_get_path('module', 'date') . '/date.inc';
  $field = signup_date_field($node->type);
  if ($field && $field != 'none' && isset($node->{$field['field_name']})) {
    switch ($field['type']) {
      case 'date':
        $start_time = date_iso2unix($node->{$field['field_name']}[0]['value']);
        break;
      case 'datestamp':
        $start_time = $node->{$field['field_name']}[0]['value'];
        break;
    }
    $close_time = $start_time - variable_get('signup_close_early', 1) * 3600;
    if (time() > $close_time) {
      return TRUE;
    }
  }
  return FALSE;
}