* along with this program; if not, write to the Free Software * * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ require_once 'connect.db.inc.php'; require_once 'plmailer.php'; require_once 'notifs.inc.php'; ini_set('memory_limit', '128M'); $uids = XDB::query('SELECT uid FROM watch WHERE FIND_IN_SET(\'mail\', flags) ORDER BY uid'); $iterator = User::iterOverUIDs($uids->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\n SET ts = NOW()\n WHERE field = 'broken'"); XDB::execute('DELETE FROM watch_profile
public static function getCount(PlUser $user, $date = null) { $watch = new Watch($user, $date); return $watch->count(); }