#!/usr/bin/php5 -q total() > 0) { $date = time(); $values = $res->next(); $pid = $values['pid']; $sex = ($values['sex'] == 'female') ? 1 : 0; $yourself = $values['yourself']; $user = User::getSilentWithUID($values['uid']); $hrpid = $values['hrpid']; $modifications = array(); $modifications[] = array( 'full_name' => $values['full_name'], 'field' => $values['field'], 'oldText' => $values['oldText'], 'newText' => $values['newText'], ); while ($values = $res->next()) { if ($values['pid'] != $pid) { $mailer = new PlMailer('profile/notification.mail.tpl'); $mailer->addTo($user); $mailer->assign('modifications', $modifications); $mailer->assign('yourself', $yourself); $mailer->assign('hrpid', $hrpid); $mailer->assign('sex', $sex); $mailer->assign('date', $date); $mailer->send(); $modifications = array(); } $pid = $values['pid']; $sex = ($values['sex'] == 'female') ? 1 : 0; $yourself = $values['yourself']; $user = User::getSilentWithUID($values['uid']); $hrpid = $values['hrpid']; $modifications[] = array( 'full_name' => $values['full_name'], 'field' => $values['field'], 'oldText' => $values['oldText'], 'newText' => $values['newText'], ); } $mailer = new PlMailer('profile/notification.mail.tpl'); $mailer->addTo($user); $mailer->assign('modifications', $modifications); $mailer->assign('yourself', $yourself); $mailer->assign('hrpid', $hrpid); $mailer->assign('sex', $sex); $mailer->assign('date', $date); $mailer->send(); XDB::execute('DELETE FROM profile_modifications WHERE type = \'third_party\''); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>