Example #1
0
 *  GNU General Public License for more details.                           *
 *                                                                         *
 *  You should have received a copy of the GNU General Public License      *
 *  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);
Example #2
0
 public function iterUsers($limit = null)
 {
     return User::iterOverUIDs($this->getUIDs($limit));
 }