ping_cron

Versions
4.6 – 6
ping_cron()

Implementation of hook_cron().

Fire off notifications of updates to remote sites.

Code

modules/ping/ping.module, line 26

<?php
function ping_cron() {
  global $base_url;

  if (variable_get('site_name', 0)) {
    $cron_last = variable_get('cron_last', time());
    // Query changed first since usually changed >= created.
    if (db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1 AND changed > %d', $cron_last)) || db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1 AND created > %d', $cron_last))) {
      _ping_notify(variable_get('site_name', ''), $base_url);
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.