本文整理汇总了PHP中SendMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP SendMessage函数的具体用法?PHP SendMessage怎么用?PHP SendMessage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SendMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveTextToFile
function SaveTextToFile($datafile, $text, $type = "w")
{
if (!($handle = fopen($datafile, $type))) {
SendMessage($email, "{$subj} Error", "Cannot open file \"{$datafile}\" for write text \"" . $text . "\"");
}
if (!fwrite($handle, $text)) {
SendMessage($email, "{$subj} Error", "Cannot write text \"" . $text . "\" to file \"{$datafile}\"");
}
fclose($handle);
}
示例2: AllyPage_CircularMessage
function AllyPage_CircularMessage()
{
global $db_prefix;
global $GlobalUser;
global $session;
global $ally;
global $AllianzenError;
if (method() === "POST" && key_exists('r', $_POST)) {
$ally_id = $ally['ally_id'];
$myrank = LoadRank($ally_id, $GlobalUser['allyrank']);
if (!($myrank['rights'] & 0x80)) {
$AllianzenError = "<center>\nНедостаточно прав для проведения операции<br></center>";
return;
}
$rank_id = intval($_POST['r']);
if ($rank_id == 0) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE ally_id = {$ally_id}";
} else {
$query = "SELECT * FROM " . $db_prefix . "users WHERE ally_id = {$ally_id} AND allyrank = {$rank_id}";
}
$result = dbquery($query);
$rows = dbrows($result);
if ($rows) {
?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
" method=POST>
<tr><td class=c>Следующие игроки получили Ваше общее послание</td></tr>
<tr><th>
<?php
$text = str_replace('\\"', """, bb($_POST['text']));
$text = str_replace('\'', "’", $text);
$text = str_replace('\\`', "‘", $text);
while ($rows--) {
$user = dbarray($result);
SendMessage($user['player_id'], va("Альянс [#1]", $ally['tag']), va("Общее послание Вашему альянсу [#1]", $ally['tag']), va("Игрок #1 сообщает Вам следующее:<br>#2", $GlobalUser['oname'], $text), 0);
echo $user['oname'] . "<br>\n";
}
?>
</th></tr>
<tr><th><input type=submit value="Ok"></th></tr>
</table></center></form>
<?php
} else {
?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=17" method=POST>
<tr><td class=c>Ошибка</td></tr>
<tr><th>К сожалению, получатели не найдены</th></tr>
<tr><th><input type=submit value="Назад"></th></tr>
</table></center></form>
<?php
}
return;
}
?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=17&sendmail=1" method=POST>
<tr><td class=c colspan=2>Отправить общее сообщение</td></tr>
<tr><th>Получатель</th><th>
<select name=r>
<option value=0>Все игроки</option>
<?php
$result = EnumRanks($ally['ally_id']);
$rows = dbrows($result);
while ($rows--) {
$rank = dbarray($result);
if ($rank['rank_id'] == 0 || $rank['rank_id'] == 1) {
continue;
}
// Основателя и новичка не показываем
echo " <option value=" . $rank['rank_id'] . ">Только определённому рангу: " . $rank['name'] . "</option>\n";
}
?>
</select></th></tr>
<tr><th>Текст сообщения (<span id="cntChars">0</span> / 2000 Симв.)</th><th><textarea name=text cols=60 rows=10 onkeyup="javascript:cntchar(2000)"></textarea></th></tr>
<tr><th colspan=2><input type=submit value="Отправить"></th></tr></table></center></form>
<?php
}
示例3: SendGreetingsMessage
function SendGreetingsMessage($player_id)
{
SendMessage($player_id, "Командование флотом", "Добро пожаловать в ОГейм!", bb("Добро пожаловать в [b]OGame[/b] !\n" . "\n" . "Для начала Вам необходимо развить рудники.\n" . "Это можно сделать в меню \"постройки\".\n" . "Выберите рудник по добыче металла и нажмите на \"строить\".\n" . "Теперь у Вас есть немного времени для ознакомления с игрой.\n" . "Помощь по игре Вы можете найти по этим ссылкам: \n" . "[url=http://tutorial.oldogame.ru/]Туториал[/url]\n" . "[url=http://board.oldogame.ru]Форум[/url]\n" . "\n" . "Тем временем Ваш рудник уже должен построиться.\n" . "Для работы рудников необходима энергия, для её получения постройте солнечную электростанцию.\n" . "Для этого снова зайдите в меню \"постройки\" и кликните на электростанции.\n" . "Для того, чтобы посмотреть, насколько далеко Вы зашли в развитии, зайдите в меню \"Технологии\".\n" . "Итак, Ваш победный поход по вселенной начался... Удачи!\n"), 5);
}
示例4: SendMessage
}
}
}
}
echo "\r\n\r\n{$count} issues:\r\n{$collected}";
if (array_key_exists('notify', $settings['settings'])) {
$to = $settings['settings']['notify'];
if ($count && strlen($collected)) {
SendMessage($to, "{$count} locations with issues - WebPagetest ALERT", $collected);
}
// send the slow logs from the last hour
if (strlen($to) && is_file('./tmp/slow_tests.log')) {
$slow = file_get_contents('./tmp/slow_tests.log');
unlink('./tmp/slow_tests.log');
if ($slow !== false && strlen($slow)) {
SendMessage($to, 'Slow tests report', $slow);
}
}
}
function SendMessage($to, $subject, &$body)
{
global $settings;
// send the e-mail through an SMTP server?
if (array_key_exists('mailserver', $settings)) {
require_once "Mail.php";
$mailServerSettings = $settings['mailserver'];
$mailInit = array();
if (array_key_exists('host', $mailServerSettings)) {
$mailInit['host'] = $mailServerSettings['host'];
}
if (array_key_exists('port', $mailServerSettings)) {
示例5: Admin_Broadcast
function Admin_Broadcast()
{
global $session;
global $db_prefix;
global $GlobalUser;
$write_error = "";
// Обработка POST-запроса.
if (method() === "POST") {
$cat = $_POST['cat'];
$subj = $_POST['subj'];
if ($subj === "") {
$write_error = "<center><font color=#FF0000>Заполните тему</font><br/></center>\n";
}
$text = $_POST['text'];
if ($text === "") {
$write_error = "<center><font color=#FF0000>Введите текст сообщения</font><br/></center>\n";
}
if ($write_error === "") {
if ($cat == 1) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE score1 < 5000;";
} else {
if ($cat == 2) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE place1 < 100;";
} else {
if ($cat == 3) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE admin = 1;";
} else {
$query = "SELECT * FROM " . $db_prefix . "users;";
}
}
}
// Всем
$ownhome = GetPlanet($GlobalUser['hplanetid']);
$from = $GlobalUser['oname'] . " <a href=\"index.php?page=galaxy&galaxy=" . $ownhome['g'] . "&system=" . $ownhome['s'] . "&position=" . $ownhome['p'] . "&session={PUBLIC_SESSION}\">[" . $ownhome['g'] . ":" . $ownhome['s'] . ":" . $ownhome['p'] . "]</a>\n";
$subj = $subj . " <a href=\"index.php?page=writemessages&session={PUBLIC_SESSION}&messageziel=" . $GlobalUser['player_id'] . "&re=1&betreff=Re:" . $subj . "\">\n" . "</a>\n";
$text = str_replace('\\"', """, bb($text));
$text = str_replace('\'', "’", $text);
$text = str_replace('\\`', "‘", $text);
$result = dbquery($query);
$usernum = $rows = dbrows($result);
while ($rows--) {
$user = dbarray($result);
SendMessage($user['player_id'], $from, $subj, $text, 5);
}
if ($usernum > 0) {
$write_error = "<center><font color=#00FF00>Сообщение отправлено {$usernum} пользователям.</font><br/></center>\n";
} else {
$write_error = "<center><font color=#00FF00>Адресаты не найдены.</font><br/></center>\n";
}
}
}
?>
<?php
echo AdminPanel();
?>
<?php
echo $write_error;
?>
<table>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Broadcast" method="POST">
<tr><td>
Кому: <select name="cat">
<option value="0">Всем</option>
<option value="1">Новичкам (менее 5.000 очков)</option>
<option value="2">Игрокам из топ100</option>
<option value="3">Операторам</option>
</select>
</td></tr>
<tr><td>
Тема : <input name="subj" size=80>
</td></tr>
<tr><td>
<textarea cols='100' rows='20' name='text'></textarea>
</td></tr>
<tr><td>
<center><input type="submit" value="Отправить"></center>
</td></tr>
</form>
</table>
<?php
}
示例6: SendMessage
SendMessage($user['player_id'], va("Альянс [#1]", $ally['tag']), "Общее сообщение", va("Игрок #1 был принят в наш альянс.", $newcomer['oname']), 0);
}
SendMessage($player_id, va("Альянс [#1]", $ally['tag']), va("Регистрация [#1] принята", $ally['tag']), va("Сердечно поздравляем, Вы теперь член альянса [#1]", $ally['tag']), 0);
$query = "UPDATE " . $db_prefix . "users SET ally_id = {$ally_id}, allyrank = 1, joindate = {$now} WHERE player_id = {$player_id}";
dbquery($query);
RemoveApplication($show);
}
if ($_POST['aktion'] === "Отклонить" && $show > 0) {
$app = LoadApplication($show);
RemoveApplication($show);
// Выслать сообщение об отказе.
$reason = "-причина не указана-";
if ($_POST['text'] !== "") {
$reason = $_POST['text'];
}
SendMessage($app['player_id'], va("Альянс [#1]", $ally['tag']), va("Регистрация [#1] отклонена", $ally['tag']), $reason, 0);
}
}
$result = EnumApplications($ally['ally_id']);
$apps = dbrows($result);
if ($apps > 0) {
?>
<!-- CONTENT AREA -->
<div id='content'>
<center>
<table width=519>
<tr><td class=c colspan=2>Обзор регистрации в этом альянсе [<?php
echo $ally['tag'];
?>
]</td></tr>
示例7: NewMessage
function NewMessage()
{
global $CFG, $dbConn, $aPostIcons, $aSmilies;
// Default values.
$bParseURLs = FALSE;
$bParseEMails = TRUE;
$bDisableSmilies = FALSE;
$bSaveCopy = TRUE;
$bTrack = TRUE;
// Are they submitting?
if ($_REQUEST['submit'] == 'Send Message') {
$aError = SendMessage();
}
// Are they forwarding?
if (strtolower($_REQUEST['action']) == 'forward') {
// Yes, get the message they want to forward.
$iMessageID = (int) $_REQUEST['id'];
$dbConn->query("SELECT pm.datetime, pm.author, pm.subject, pm.body, citizen.username FROM pm JOIN citizen ON (citizen.id = pm.author) WHERE pm.id={$iMessageID} AND pm.ownerid={$_SESSION['userid']}");
$aSQLResult = $dbConn->getresult();
// Change the subject and add a copy of the message being forwarded.
$strSubject = htmlsanitize("Fw: {$aSQLResult[2]}");
$strMessage = "\n\n[quote][i]{$aSQLResult[4]} wrote on [dt={$aSQLResult[0]}]:[/i]\n[b]{$aSQLResult[3]}[/b][/quote]";
}
// Are they replying?
if ($_REQUEST['action'] == 'reply') {
// Yes, get the message they want to reply to.
$iMessageID = (int) $_REQUEST['id'];
$dbConn->query("SELECT pm.datetime, pm.author, pm.subject, pm.body, citizen.username FROM pm JOIN citizen ON (citizen.id = pm.author) WHERE pm.id={$iMessageID} AND pm.ownerid={$_SESSION['userid']}");
$aSQLResult = $dbConn->getresult();
// Set the recipient & subject, and add a copy of the message being forwarded.
$strRecipient = $aSQLResult[4];
$strSubject = strpos($aSQLResult[2], 'Re: ') !== 0 ? "Re: {$aSQLResult[2]}" : $aSQLResult[2];
$strMessage = "\n\n[quote][i]{$aSQLResult[4]} wrote on [dt={$aSQLResult[0]}]:[/i]\n[b]{$aSQLResult[3]}[/b][/quote]";
}
// Are they specifying a user ID?
if (isset($_REQUEST['userid'])) {
// Yes, so get the username of the user whose ID was specified.
$iUserID = (int) $_REQUEST['userid'];
$dbConn->query("SELECT username FROM citizen WHERE id={$iUserID}");
list($strRecipient) = $dbConn->getresult();
}
// Template
require "./skins/{$CFG['skin']}/pm/newmessage.tpl.php";
// Send the page.
exit;
}
示例8: hostname
$write_error = "<center><font color=#FF0000>Не хватает темы</font><br/><br/></center>\n";
} else {
if ($text === "") {
$write_error .= "<center><font color=#FF0000>А где же сообщение?</font><br/><br/></center>\n";
} else {
if ($user['useskin']) {
$skin = $user['skin'];
} else {
$skin = hostname() . "evolution/";
}
$text = str_replace('\\"', """, bb($text));
$text = str_replace('\'', "’", $text);
$text = str_replace('\\`', "‘", $text);
$from = $GlobalUser['oname'] . " <a href=\"index.php?page=galaxy&galaxy=" . $ownhome['g'] . "&system=" . $ownhome['s'] . "&position=" . $ownhome['p'] . "&session={PUBLIC_SESSION}\">[" . $ownhome['g'] . ":" . $ownhome['s'] . ":" . $ownhome['p'] . "]</a>\n";
$subj = $subj . " <a href=\"index.php?page=writemessages&session={PUBLIC_SESSION}&messageziel=" . $GlobalUser['player_id'] . "&re=1&betreff=Re:" . $subj . "\">\n" . "<img border=\"0\" alt=\"Ответить\" src=\"" . $skin . "img/m.gif\" /></a>\n";
SendMessage($user['player_id'], $from, $subj, $text, 0);
$write_error = "<center><font color=#00FF00>Сообщение отправлено</font><br/></center>\n";
}
}
}
}
echo "<!-- CONTENT AREA -->\n";
echo "<div id='content'>\n";
echo "<center>\n";
echo $write_error;
echo "<center>\n";
echo "<form action=\"index.php?page=writemessages&session=" . $_GET['session'] . "&gesendet=1&messageziel=" . intval($_GET['messageziel']) . "\" method=\"post\">\n";
echo "<table width=\"519\">\n\n";
//echo "GET: "; print_r ($_GET); echo "<br>";
//echo "POST: "; print_r ($_POST); echo "<br>";
echo "<tr><td class=\"c\" colspan=\"2\">Написать сообщение</td></tr>\n";
示例9: Buddy_Outcome
if (key_exists('action', $_GET) && $_GET['action'] == 6) {
Buddy_Outcome();
} else {
if (key_exists('action', $_GET) && $_GET['action'] == 7) {
Buddy_Request();
} else {
if (key_exists('action', $_GET) && $_GET['action'] == 8 && $_GET['buddy_id']) {
$buddy_id = intval($_GET['buddy_id']);
$buddy = LoadBuddy($buddy_id);
if ($buddy['request_from'] == $GlobalUser['player_id']) {
RemoveBuddy($buddy_id);
SendMessage($buddy['request_to'], loca("BUDDY_LIST"), loca("BUDDY_CONFIRM"), va(loca("BUDDY_MSG_DELETED"), $GlobalUser['oname']), 0);
}
if ($buddy['request_to'] == $GlobalUser['player_id']) {
RemoveBuddy($buddy_id);
SendMessage($buddy['request_from'], loca("BUDDY_LIST"), loca("BUDDY_CONFIRM"), va(loca("BUDDY_MSG_DELETED"), $GlobalUser['oname']), 0);
}
Buddy_Home();
} else {
Buddy_Home();
}
}
}
}
}
}
}
}
echo "</center>\n";
echo "</div>\n";
echo "<!-- END CONTENT AREA -->\n";
示例10: SendMessageFromMenteeToMentor
function SendMessageFromMenteeToMentor($toEmail, $msg, $email)
{
$mentorArr = GetMentorDetailsByEmail($toEmail);
$menteeArr = GetMenteeDetailsByEmail($email);
// mentor names and email address
$mentorEmail = $mentorArr["MentorEmail"];
$mentorName = $mentorArr["MentorName"];
// mentee name and email address
$menteeEmail = $menteeArr["MenteeEmail"];
$menteeName = $menteeArr["MenteeName"];
$subject = $menteeName . " - Query Received";
$message = "Dear " . $mentorName . "<br /><br />";
$message .= "You have Received a query from one of your mentees, namely " . $menteeName . " (" . $menteeEmail . "). Please repond to him either privately or through the <a href='http://mentored-research.com/login' target='_blank'>MR-Portal</a> <br /><br />";
$message .= $msg . "<br /><br />";
$message .= "Team Mentored-Research<br />";
$message .= "info@mentored-research.com<br /><br />";
$message .= "Please do not reply to this automated mail.<br />";
$res = SendMessage($mentorEmail, $mentorName, $menteeEmail, $menteeName, $subject, $message);
if ($res == "-1") {
echo $res;
} else {
header('Content-Type: application/json');
echo json_encode($res);
}
}
示例11: AllyPage_Takeover
function AllyPage_Takeover()
{
global $GlobalUser;
global $session;
global $ally;
global $AllianzenError;
// Обменять званиями главу и "правую руку".
if ($_GET['a'] == 18 && $_REQUEST['s'] == 1) {
$now = time();
$myrank = LoadRank($ally['ally_id'], $GlobalUser['allyrank']);
if (!($myrank['rights'] & 0x100)) {
$AllianzenError = "<center>\nНедостаточно прав для проведения операции<br></center>";
} else {
// Выслать всем участникам сообщение что власть поменялась (кроме самого главы).
$from = va("Альянс [#1]", $ally['tag']);
$subj = va("Смена власти в альянсе [#1]", $ally['tag']);
$text = va("Игрок #1, обладающий титулом основателя альянса, покинул его", $GlobalUser['oname'], $ally['tag']);
$result = EnumerateAlly($ally['ally_id']);
$rows = dbrows($result);
while ($rows--) {
$user = dbarray($result);
if ($user['player_id'] != $ally['owner_id']) {
SendMessage($user['player_id'], $from, $subj, $text, 0);
}
}
// Поменять звания
$newhead = LoadUser(intval($_REQUEST['uid']));
$newhead_rank = LoadRank($ally['ally_id'], $newhead['allyrank']);
if ($newhead['ally_id'] != $ally['ally_id'] || ($newhead_rank['rights'] & 0x100) == 0) {
$AllianzenError = "<center>\nНедостаточно прав для проведения операции<br></center>";
return;
}
SetUserRank($newhead['player_id'], $GlobalUser['allyrank']);
SetUserRank($GlobalUser['player_id'], $newhead['allyrank']);
// Установить нового хозяина альянса
AllyChangeOwner($ally['ally_id'], $newhead['player_id']);
?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
" method="POST">
<tr><td class=c>Вы утратили свой статус</td></tr><tr><th><br><input type="submit" value="OK"></th></tr></form></table><br><br><br><br>
<?php
}
return;
}
// Ололош, любой игрок по этому параметру может взять на себя права главы, без всяких проверок.....
if ($_GET['a'] == 18 && $_REQUEST['s'] == 2) {
?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
" method="POST">
<tr><td class=c>Звание передано</td></tr><tr><th><br><input type="submit" value="OK"></th></tr></form></table><br><br><br><br>
<?php
return;
}
// Если открыть у НЕ главы страничку:
if ($ally['owner_id'] != $GlobalUser['player_id']) {
?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=5" method=POST>
<tr><td class=c>Глава ещё активен</td></tr><tr><th><input type=submit value="Назад"></th></tr></form></table><br><br><br><br>
<?php
return;
}
// Перечислить всех игроков альянса с правами "правая рука". Если никого нет, то просто вывести кнопку "назад".
$users = array();
$rank_result = EnumRanks($ally['ally_id']);
while ($rank = dbarray($rank_result)) {
if ($rank['rights'] & 0x100) {
$result = LoadUsersWithRank($ally['ally_id'], $rank['rank_id']);
while ($user = dbarray($result)) {
if ($user['player_id'] == $ally['owner_id']) {
continue;
}
// не показывать главу
$user['rankname'] = $rank['name'];
$users[] = $user;
}
}
}
if (count($users) == 0) {
// Никто не найден, вывести кнопку "назад"
?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=5" method=POST>
<tr><td class=c></th></tr><tr><th><input type=submit value="Назад"></th></tr></form></table><br><br><br><br>
<?php
} else {
// Перечислить найденных пользователей с рангом "правая рука"
?>
//.........这里部分代码省略.........
示例12: curl_error
//Print error if any
if (curl_errno($ch)) {
echo 'error:' . curl_error($ch);
}
curl_close($ch);
echo $output;
}
if (isset($_GET) && !empty($_GET) || isset($_POST) && !empty($_POST)) {
if (isset($_REQUEST['keyword']) && !empty($_REQUEST['keyword'])) {
if (isset($_REQUEST['number']) && !empty($_REQUEST['number'])) {
if (isset($_REQUEST['message']) && !empty($_REQUEST['message'])) {
$mobile = $_REQUEST['number'];
$mess = $_REQUEST['message'];
$keyword = $_REQUEST['keyword'];
var_dump($_REQUEST);
$message = $keyword . $mobile . $mess;
SendMessage('9910065699', $message);
$sms = new SMSReceiver();
$sms->ProcessData($keyword, $mobile, $mess);
} else {
echo "ERROR : Message not sent -- Text parameter is missing!\r\n";
}
} else {
echo "ERROR : Message not sent -- Phone parameter is missing!\r\n";
}
} else {
echo "ERROR : Message not sent -- Keyword is missing!\r\n";
}
} else {
echo "ERROR : Message not received -- Phone and Text parameter is missing!\r\n";
}
示例13: BeginHtml
case 2:
if (!$Message) {
BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/messages/");
$perm->ExitIfNotAccess(NC_PERM_ITEM_GROUP, NC_PERM_ACTION_MAIL, 0, 0, 1);
nc_print_status(CONTROL_USER_MAIL_ERROR_NOBODY, 'error');
ShowForm();
break;
}
if (isset($Attach)) {
BeginHtml($Title2, $Title3, "http://" . $DOC_DOMAIN . "/management/messages/");
$perm->ExitIfNotAccess(NC_PERM_ITEM_GROUP, NC_PERM_ACTION_MAIL, 0, 0, 1);
$Result = $db->query("INSERT INTO MailTmp (Subject,Message) VALUES ('" . $Subject . "','" . $Message . "')");
$TmpID = $db->insert_id;
AttachForm($is_html);
} else {
BeginHtml($Title2, $Title3, "http://" . $DOC_DOMAIN . "/management/messages/");
$perm->ExitIfNotAccess(NC_PERM_ITEM_GROUP, NC_PERM_ACTION_MAIL, 0, 0, 1);
SendMessage($PermissionGroupID, $Subject, $Message, 0, $is_html);
}
break;
case 3:
BeginHtml($Title2, $Title3, "http://" . $DOC_DOMAIN . "/management/messages/");
$perm->ExitIfNotAccess(NC_PERM_ITEM_GROUP, NC_PERM_ACTION_MAIL, 0, 0, 1);
$Array = $db->get_row("SELECT Subject, Message FROM MailTmp WHERE MailTmp_ID='" . $TmpID . "'", ARRAY_N);
$Subject = $Array[0];
$Message = $Array[1];
$Result = $db->query("DELETE FROM MailTmp WHERE MailTmp_ID='" . $TmpID . "'");
SendMessage($PermissionGroupID, $Subject, $Message, 1, $is_html);
break;
}
EndHtml();
示例14: PageAlly_MemberSettings
function PageAlly_MemberSettings()
{
global $db_prefix;
global $session;
global $ally;
global $GlobalUser;
global $AllianzenError;
$selected_user = 0;
if (key_exists('u', $_GET)) {
$selected_user = intval($_GET['u']);
}
if (method() === "GET" && $_GET['a'] == 13 && $selected_user) {
$leaver = LoadUser($selected_user);
$query = "UPDATE " . $db_prefix . "users SET ally_id = 0 WHERE player_id = {$selected_user}";
dbquery($query);
// Разослать сообщения членам альянса об исключении игрока
$result = EnumerateAlly($ally['ally_id']);
$rows = dbrows($result);
while ($rows--) {
$user = dbarray($result);
SendMessage($user['player_id'], va("Альянс [#1]", $ally['tag']), "Общее сообщение", va("Игрок #1 исключён из альянса.", $leaver['oname']), 0);
}
// Сообщение игроку об исключении.
SendMessage($leaver['player_id'], va("Альянс [#1]", $ally['tag']), va("Членство в альянсе [#1] окончено", $ally['tag']), va("Игрок #1 исключает Вас из альянса [#2] .<br>Теперь Вы можете зарегистрироваться снова", $GlobalUser['oname'], $ally['tag']), 0);
}
if (method() === "POST" && $_GET['a'] == 16 && $selected_user) {
$newrank = intval($_POST['newrang']);
$query = "UPDATE " . $db_prefix . "users SET allyrank = {$newrank} WHERE player_id = {$selected_user}";
dbquery($query);
}
$now = time();
$members = CountAllyMembers($ally['ally_id']);
$sort1 = intval($_GET['sort1']);
$sort2 = intval($_GET['sort2']) ^ 1;
?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script><br>
<a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=5">Назад к обзору</a>
<table width=519>
<tr><td class='c' colspan='10'>Список членов (кол-во: <?php
echo $members;
?>
)</td></tr>
<tr>
<th>N</th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=1&sort2=<?php
echo $sort2;
?>
">Имя</a></th>
<th> </th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=2&sort2=<?php
echo $sort2;
?>
">Статус</a></th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=3&sort2=<?php
echo $sort2;
?>
">Очки</a></th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=0&sort2=<?php
echo $sort2;
?>
">Координаты</a></th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=4&sort2=<?php
echo $sort2;
?>
">Вступление</a></th>
<th><a href="index.php?page=allianzen&session=<?php
echo $session;
?>
&a=7&sort1=5&sort2=<?php
echo $sort2;
?>
">Неактивный</a></th>
<th>Функция</th></tr>
<?php
$result = EnumerateAlly($ally['ally_id'], intval($_GET['sort1']), intval($_GET['sort2']));
for ($i = 0; $i < $members; $i++) {
$user = dbarray($result);
$rank = LoadRank($user['ally_id'], $user['allyrank']);
$hplanet = GetPlanet($user['hplanetid']);
$days = floor(($now - $user['lastclick']) / (60 * 60 * 24));
echo "<tr>";
//.........这里部分代码省略.........
示例15: Exception
throw new Exception($result->getErrorMessage());
}
}
//get params
if (ReturnGetPost('recieverid') && preg_match('/' . REGEXP_THREEMAID_ANY . '/', ReturnGetPost('recieverid'))) {
$threemaId = htmlentities(ReturnGetPost('recieverid'));
$message = ReturnGetPost('message');
}
//create connection
$connector = CreateConnection();
//Send message
if ($threemaId !== null && $message !== null) {
if (!$isIncluded) {
header('Content-Type: text/plain');
}
$actionDone = true;
try {
$messageId = SendMessage($connector, $threemaId, $message);
} catch (Exception $e) {
http_response_code(500);
$errorMessage = $e->getMessage();
}
}
//Show direct output if the file is called directly
if (!$isIncluded) {
if ($errorMessage === null) {
echo 'Message ID: ' . $messageId;
} else {
echo $errorMessage;
}
}