"; $replyto = $sender; $footer = " Stay Brutal! // DIE http://www.executionroom.com info@executionroom.com "; function send($email, $subject, $message) { global $subject_prefix; global $sender; global $replyto; global $footer; $message .= $footer; // $message .= ""; $headers = "From: " . $sender . "\r\n"; $headers .= "Reply-To: " . $replyto . "\r\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); $subject = "[".$subject_prefix."] " . utf8_decode($subject); $ret = mail($email, $subject, utf8_decode($message), $headers); if(!$ret) echo error("The mail to " . $email . "could not be sent."); } function notify($module = "", $event = "") { global $users; global $current_user; $users_changed = false; foreach($users->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. ( $module == "forum" && $user != $current_user && // Don't notify current user. $user->notified < (time() - (60 * 60 * 24 * 7)) // 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(); } ?>