users as $user) { if($user->uid == 0) continue; // Don't notify the admin if($user->enabled == false) continue; // Do not mail disabled accounts. if($module == "calendar" || // Always mail calendar updates. $user->username == "rasmus" || // Always send mails to Rasmus. ( $module == "forum" && $user != $current_user && // Don't notify current user. $user->notified < (time() - $NOTIFY_RESEND) // Don't notify if already notified. ) ) { send($user->email, $module . " changed", "There has been a change in the " . $module . " module by " . $current_user->name . ":\n" . $event); _log($user->username, "notified (" . $module . ")"); if($module != "calendar") { $user->notified = time(); $users_changed = true; } } } if($users_changed == true) $users->write(); } ?>