You are here

function notify_cron in Notify 5

Same name and namespace in other branches
  1. 8 notify.module \notify_cron()
  2. 5.2 notify.module \notify_cron()
  3. 6 notify.module \notify_cron()
  4. 7 notify.module \notify_cron()
  5. 2.0.x notify.module \notify_cron()
  6. 1.0.x notify.module \notify_cron()

Implementation of hook_cron().

File

./notify.module, line 69

Code

function notify_cron() {
  $send_last = variable_get('notify_send_last', 0);
  $send_interval = variable_get('notify_send', 86400);
  $send_hour = variable_get('notify_send_hour', date('G', variable_get('notify_send_last', 0)));
  if (time() - $send_last > $send_interval && (date('G', time()) >= $send_hour || $send_interval < 86400) && $send_interval != -1) {
    _notify_send();
    variable_set('notify_send_last', time());
  }
}