function poll_cron
Same name and namespace in other branches
- 7.x drupal-7.x/modules/poll/poll.module \poll_cron()
Implementation of hook_cron().
Closes polls that have exceeded their allowed runtime.
Archivo
- drupal-6.x/
modules/ poll/ poll.module, line 156 - Enables your site to capture votes on different topics in the form of multiple choice questions.
Código
function poll_cron() {
$result = db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < ' . time() . ' AND p.active = 1 AND p.runtime != 0');
while ($poll = db_fetch_object($result)) {
db_query("UPDATE {poll} SET active = 0 WHERE nid = %d", $poll->nid);
}
}