include("include.php"); writeHeader("Newsletter"); // \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* Kernel::includeObject("database"); Kernel::includeObject("user/user_client"); $action = ""; if(isset($_POST["action"])) { $action = $_POST["action"]; } $name = ""; if (isset($_POST["name"])) { $name = $_POST["name"]; } $email = ""; if (isset($_POST["email"])) { $email = $_POST["email"]; } if ($action == "") { WriteForm("", ""); } elseif ($action == "subscribe") { Database::Open(); $ret = User_Client::Subscribe($name, $email, 1); Database::Close(); if ($ret == USER_CLIENT_ERROR_INVALID_NAME) { echo "
Please fill in all the fields. Go back
"; } elseif ($ret == USER_CLIENT_ERROR_INVALID_EMAIL) { echo "The e-mail address '$email' is invalid. Go back
"; } elseif ($ret == USER_CLIENT_ERROR_ALREADY_SUBSCRIBED) { echo "The e-mail address '$email' is already subscribed to the mailinglist. Go back
"; } else //valid { echo "The address '".$email."' was succesfully subscribed to the mailing list.
"; } } elseif ($action == "unsubscribe") { Database::Open(); $ret = User_Client::Unsubscribe($email); Database::Close(); if ($ret == USER_CLIENT_ERROR_NO_EMAIL_IN_DB) { echo "The address '$email' is not subscribed to the mailinglist. Go back
"; } elseif ($ret == USER_CLIENT_ERROR_ALREADY_UNSUBSCRIBED) { echo "The address '$email' is not subscribed to the mailinglist. Go back
"; } else { /* echo "A confirmation e-mail was sent to '$email', please follow its instructions to complete the unsubscription process.
"; */ echo "Your e-mail address, '$email' has been unsubscribed.
"; } } ?> writeFooter(); function WriteForm($name, $email) { ?>This newsletter is very infrequent, I send it out only if this site has a major update.
For past newsletters, please see the Newsletter archive.
} ?>