function sendApprovedMail($toAddress, $playerName) { require '/var/www/yoursite/http/variables.php'; require '/var/www/yoursite/http/variablesdb.php'; $fromAddress = $admin_signup . "@" . $leaguename . ".com"; $head = "From:" . $fromAddress . "\r\nReply-To:" . $fromAddress . ""; $subject = "[{$leaguename}] account approved"; $message = "Hi " . $playerName . "!\n\nYour " . $leaguename . " account has been checked and activated. Visit our chatroom to find other players. \n\nEnjoy your stay!\n\n- The " . $leaguename . " staff"; @mail($toAddress, $subject, $message, $head, $mailconfig); $res = logSentMail($playerName, $toAddress, "approved"); return getTextForSendResult($res); }
$winnerresult = $row_game['winnerresult']; $loserresult = $row_game['loserresult']; $loser = $row_game['loser']; $loser2 = $row_game['loser2']; $losepoints = $row_game['losepoints']; if (strlen($loser2) > 0) { $loser = $loser . "/" . $loser2; if ($name == $loser2) { $losepoints = $row_game['losepoints2']; } } $message .= "[{$gametime}] " . "(+{$winpoints}) {$winner} " . "{$winnerresult} - {$loserresult} " . "{$loser} (-{$losepoints})\n"; } $message .= "\n" . "If you think these results are not correct, please post it in \n" . "the forum ({$directory}/forum/viewforum.php?f=5).\n" . "Reporting these issues helps us keep the league clean!\n" . "\n" . "You will receive this summary every day if you have played a game.\n" . "If you wish to cancel this, you can disable it by editing your profile at \n" . "{$profileurl}\n" . "\n" . "\n" . "- The " . $leaguename . " Staff\n"; $sendmail = @mail($toAddress, $subject, $message, $head, $mailconfig); $logged = logSentMail($name, $toAddress, 'games'); } // if valid address $adminMessage .= "user [{$name}] played [{$gamescount}] address [{$toAddress}] mailSent [{$sendmail}] log [{$logged}]\n"; } } if ($playerscount > 0) { $playerscount--; } $adminSubject = "[{$leaguename} FIFA] g=[{$count_total}] p=[{$playerscount}] d=[{$count_deleted}]"; if ($count_total > 0) { sendAdminMail($adminSubject, $adminMessage); } // remove negative expire values // $sql = "UPDATE $playerstatustable SET expireDate = 0 ". // "WHERE UNIX_TIMESTAMP( ) > expireDate ".
$playerresult = mysql_query($alloldplayersquery); while ($row = mysql_fetch_array($playerresult)) { $name = $row['name']; $userId = $row['player_id']; if (!in_array($name, $played_array)) { // has not played in X weeks $sendmail = 0; $mailSentResult = 0; $sql = "UPDATE {$playerstable} " . "SET approved = 'no' " . "where name='{$name}'"; $updateResult = mysql_query($sql); $toAddress = $row['mail']; if (isValidEmailAddress($toAddress)) { $subject = "[{$leaguename}] {$name} account passivated"; $head = "From:" . $adminmail . "\r\nReply-To:" . $adminmail . ""; $message = "Hello {$name},\n" . "\n" . "Since you have not played any {$leaguename} games in " . $weeks . " weeks, \n" . "your account has been passivated.\n" . "\n" . "If you want your account reactivated sometime, simply post in the forum \n" . "activation thread at http://www.yoursite/forum/viewtopic.php?t=1084\n" . "\n" . "\n" . "- The " . $leaguename . " Staff\n"; $sendmail = @mail($toAddress, $subject, $message, $head); $mailSentResult = logSentMail($name, $toAddress, 'passivated'); } // if valid address $date = time(); $link = $directory . "/info.php?#8"; $reason = "automatically passivated on " . formatDate($date); $sql = "INSERT INTO {$playerstatustable} (userId, userName, type, active, " . "date, expireDate, forumLink, reason) " . "VALUES ('{$userId}', '{$name}', 'I', 'Y', " . "'{$date}', '', '{$link}', '{$reason}')"; $result = mysql_query($sql); $adminMessage .= "[{$name}] " . "passivated [{$updateResult}] " . "address [{$toAddress}] " . "mail sent [{$sendmail}] " . "log [{$mailSentResult}] " . "status [{$result}]\n"; } } $adminSubject = "[{$leaguename} admin] accounts passivated"; if (!empty($adminMessage)) { sendAdminMail($adminSubject, $adminMessage); }
"where userId = '$player_id' and type='B' and active='Y'"; $result2 = mysql_query($sql2); if (mysql_num_rows($result2) > 0) { $msgs .= "Player " . $name . " is banned!<br>"; } else { $unsubscribeUrl = "http://www.yoursite/unsubscribe.php?id=" . md5($name); $userMailText = str_replace('%playername%', $name, $mailText); $userMailText = str_replace('%unsubscribeLink%', $unsubscribeUrl, $userMailText); $plainText = str_replace('%playername%', $name, $plainText); $plainText = str_replace('%unsubscribeLink%', $unsubscribeUrl, $plainText); $msgs .= "Send [" . $mail . "] -> "; $result = sendHtmlMail($mail, $mailSubject, $userMailText, $plainText); $msgs .= "Result [" . $result . "]<br>"; logSentMail($name, $mail, $mailType); } } } } } } } if (!empty ($msgs)) { echo '<div style="border:1px solid #888;"><p><b>Message</b></p><p>' . $msgs . '</p></div>'; } // if (!empty ($mailText)) { // echo '<div style="border:1px solid #888;"><p><b>Body</b></p><p>' . $mailText . '</p></div>'; // } ?> <form name="sendMail" method="post">
function sendActivationLinkMail($toAddress, $playerName, $link) { require 'variables.php'; require 'variablesdb.php'; $fromAddress = $admin_signup . "@" . $leaguename . ".com"; $head = "From: " . $leaguename . " <" . $noReplyMail . ">\r\nReply-To:" . $noReplyMail . ""; $subject = "[{$leaguename}] Account activation"; $message = "Hi " . $playerName . "!\r\n\r\nYour evo-league account has been reviewed and is ready for activation. You can activate your account by visiting the following link:\r\n\r\n" . $link . "\r\n\r\nIf you need help, please read the FAQ before asking questions: http://www." . $leaguename . "/forum/viewtopic.php?t=5438\r\n\r\nPlease do not reply to this email. If you have questions or problems, post in our forums: http://www." . $leaguename . "/forum/\r\n\r\n- The yoursite staff"; @mail($toAddress, $subject, $message, $head, $mailconfig); $res = logSentMail($playerName, $toAddress, "activation"); return getTextForSendResult($res); }