#!/usr/bin/php5 -q fetchColumn()); while($user = $iterator->next()) { $watch = new Watch($user); if ($watch->count() > 0) { $notifs = $watch->events(); $mailer = new PlMailer('carnet/notif.mail.tpl'); $mailer->assign('sex', $user->isFemale()); $mailer->assign('yourself', $user->display_name); $mailer->assign('week', date('W - Y')); $mailer->assign('notifs', $notifs); $mailer->sendTo($user); unset($mailer); unset($notifs); } unset($watch); unset($user); } XDB::execute("UPDATE watch_profile SET ts = NOW() WHERE field = 'broken'"); XDB::execute('DELETE FROM watch_profile WHERE ts < DATE_SUB(CURRENT_DATE, INTERVAL 15 DAY)'); // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>