You are here

function notify_cron in Notify 6

Same name and namespace in other branches
  1. 8 notify.module \notify_cron()
  2. 5.2 notify.module \notify_cron()
  3. 5 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 120
Notify module sends email digests of new content and comments.

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', 9);
  $send_start = time();
  if ($send_start - $send_last > $send_interval && (date('G', $send_start) >= $send_hour || $send_interval < 86400) && $send_interval != -1) {
    _notify_send($send_start);
    variable_set('notify_send_last', $send_start);
  }
}