本文整理汇总了PHP中SendSimpleMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP SendSimpleMessage函数的具体用法?PHP SendSimpleMessage怎么用?PHP SendSimpleMessage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SendSimpleMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
$CONF = Config::getAll(NULL, ROOT_UNI);
if ($CONF['asteroid_event'] < TIMESTAMP) {
$GLOBALS['DATABASE']->query("DELETE FROM " . PLANETS . " where `id_owner` = '" . Asteroid_Id . "' AND `id` != '706' ;");
$galaxy = 1;
$system = $this->randRange(1, 500, 50);
foreach ($system as $System_Element) {
$planets = rand(1, 10);
$cautare = $GLOBALS['DATABASE']->query("SELECT *FROM " . PLANETS . " where `galaxy` = '" . $galaxy . "' and `system` = '" . $System_Element . "' and `planet` = '" . $planets . "' AND `universe` = '1';");
if ($GLOBALS['DATABASE']->numRows($cautare) == 0) {
$metal_rand = rand(1, Config::get('asteroid_metal'));
$crystal_rand = rand(1, Config::get('asteroid_crystal'));
$deuterium_rand = rand(1, Config::get('asteroid_deuterium'));
$GLOBALS['DATABASE']->query("INSERT INTO " . PLANETS . "(`name`,`id_owner`,`universe`,`galaxy`,`system`,`planet`,`planet_type`,`image`,`diameter`,`der_metal`,`der_crystal`,`der_deuterium`,`last_update`) \n\t\tVALUES('Asteroid','" . Asteroid_Id . "','1','" . $galaxy . "','" . $System_Element . "','" . $planets . "','1','asteroid','9800','" . $metal_rand . "','" . $crystal_rand . "','" . $deuterium_rand . "','" . TIMESTAMP . "');");
}
}
$totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . ";");
$langObjects = array();
while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
if (!isset($langObjects[$xy['lang']])) {
$langObjects[$xy['lang']] = new Language($xy['lang']);
$langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
}
$LNG = $langObjects[$xy['lang']];
$message = '<div style="text-align:justify;">' . $LNG['sys_asteroid_3'] . '</div><div class="citation"><div class="guillemet ouvrir"></div><div class="guillemet fermer"></div><ul style="text-align : left;">' . $LNG['sys_asteroid_4'] . '</ul></div><div class="explication_utilisateur">' . $LNG['ls_fts_colo_9'] . '</div>';
SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, $LNG['sys_asteroid_1'], $LNG['sys_asteroid_2'], $message);
}
$newevkaka = TIMESTAMP + 5 * 60;
$GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET asteroid_event = '" . $newevkaka . "' where `uni` = '1';");
}
}
示例2: ShowFleetsConfPage
function ShowFleetsConfPage()
{
global $LNG;
$CONF = Config::getAll(NULL, 1);
if (!empty($_POST)) {
$pay_before = array('fleetconf' => $CONF['fleetconf']);
$fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
$pay_after = array('fleetconf' => $fleetconf);
Config::update($pay_after, 1);
$CONF = Config::getAll(NULL, 1);
$LOG = new Log(3);
$LOG->target = 1;
$LOG->old = $pay_before;
$LOG->new = $pay_after;
$LOG->save();
require_once 'includes/functions/BBCode.php';
$Time = TIMESTAMP;
$Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
$From = '<span class="admin">"Antimatter"</span>';
$pmSubject = '<span class="admin">"Purchase Bonus"</span>';
$pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
$USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
$sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
}
}
$template = new template();
$template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
$template->show('fleetconf.tpl');
}
示例3: ShowSendMessagesPage
function ShowSendMessagesPage()
{
global $USER, $LNG, $db;
if ($_GET['mode'] == 'send') {
switch ($USER['authlevel']) {
case AUTH_MOD:
$color = 'yellow';
break;
case AUTH_OPS:
$color = 'skyblue';
break;
case AUTH_ADM:
$color = 'red';
break;
}
$Subject = makebr(request_var('subject', '', true));
$Message = makebr(request_var('text', '', true));
if (!empty($Message) && !empty($Subject)) {
require_once ROOT_PATH . 'includes/functions/BBCode.php';
$Time = TIMESTAMP;
$From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
$Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
$Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
$db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
exit($LNG['ma_message_sended']);
} else {
exit($LNG['ma_subject_needed']);
}
}
$template = new template();
$template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
$template->show('adm/SendMessagesPage.tpl');
}
示例4: ReturnEvent
function ReturnEvent()
{
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_tran_mess_back'], $StartName, GetStartAdressLink($this->_fleet, ''));
SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
$this->RestoreFleet();
}
示例5: _rewardPurchase
function _rewardPurchase($userId, $pay, $realpay, $received, $credits, $type, $transac, $code, $timer)
{
// Make userid safe to use in query
$userId = mysql_real_escape_string($userId);
$timer = time();
$INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . mysql_escape_string($userId) . ";");
if ($INFO1['lp_points'] >= 0) {
$tex = 1;
} elseif ($INFO1['lp_points'] >= 125) {
$tex = 2;
} elseif ($INFO1['lp_points'] >= 625) {
$tex = 4;
} elseif ($INFO1['lp_points'] >= 2500) {
$tex = 6;
} elseif ($INFO1['lp_points'] >= 7000) {
$tex = 8;
}
mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + '" . $credits . "' WHERE `id` = '" . mysql_escape_string($userId) . "';");
mysql_query("INSERT INTO `uni1_allopass_log` VALUES ('', '" . mysql_escape_string($userId) . "', '" . mysql_escape_string($code) . "', '" . mysql_escape_string($credits) . "','" . mysql_escape_string($type) . "', '" . mysql_escape_string($transac) . "', '" . mysql_escape_string($pay) . "', '" . mysql_escape_string($realpay) . "', '" . mysql_escape_string($received) . "', '" . $timer . "', '1');");
if ($INFO1['ref_id'] != 0) {
mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $INFO['amount'] / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
SendSimpleMessage($INFO1['ref_id'], '', TIMESTAMP, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($INFO['amount'] / 100 * 5) . ' anti matter have been credited to your account.');
}
SendSimpleMessage(mysql_escape_string($userId), '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to your account');
//Admin Message
SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to ' . $userId . '');
}
示例6: missionCaseStayAlly
/**
* MissionCaseStayAlly @todo description
*
* @global array $lang @see common.php
* @param array $fleetRow @see common.php
* @return bool true.
*/
function missionCaseStayAlly($fleetRow)
{
global $lang;
$readConnection = Nova::getSingleton('core/database_connection_pool')->getConnection('core_read');
$startPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_start_galaxy'])->where('system =?', $fleetRow['fleet_start_system'])->where('planet =?', $fleetRow['fleet_start_planet'])->query()->fetch();
$endPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_end_galaxy'])->where('system =?', $fleetRow['fleet_end_system'])->where('planet =?', $fleetRow['fleet_end_planet'])->query()->fetch();
$fleetStartLink = GetStartAdressLink($fleetRow, '');
$fleetEndLink = GetTargetAdressLink($fleetRow, '');
if ($fleetRow['fleet_mess'] == 0) {
if ($fleetRow['fleet_end_stay'] <= time()) {
$readConnection->update($readConnection->getDeprecatedTable('fleets'), array('fleet_mess' => 1), array('fleet_id =?' => $fleetRow['fleet_id']));
} else {
if ($fleetRow['fleet_start_time'] <= time()) {
$message = sprintf($lang['sys_tran_mess_owner'], $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
$message = sprintf($lang['sys_tran_mess_user'], $startPlanet['name'], $fleetStartLink, $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($endPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
}
}
} else {
if ($fleetRow['fleet_end_time'] <= time()) {
$message = sprintf($lang['sys_tran_mess_back'], $startPlanet['name'], $fleetStartLink);
SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $message);
RestoreFleetToPlanet($fleetRow, true);
$readConnection->delete($readConnection->getDeprecatedTable('fleets'), array('fleet_id =?' => $fleetRow['fleet_id']));
}
}
return true;
}
示例7: ReturnEvent
function ReturnEvent()
{
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
$this->RestoreFleet();
}
示例8: run
function run()
{
$CONF = Config::getAll(NULL, ROOT_UNI);
if ($CONF['birthday_event'] < TIMESTAMP) {
$totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . " WHERE date_of_birth < " . TIMESTAMP . " AND date_of_birth != '0' AND year = '2015';");
$langObjects = array();
while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
if (!isset($langObjects[$xy['lang']])) {
$langObjects[$xy['lang']] = new Language($xy['lang']);
$langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
}
$LNG = $langObjects[$xy['lang']];
$message = '<div class="citation">
<div class="guillemet ouvrir">«</div>
<div class="guillemet fermer">»</div>
<ul style="text-align : left;">
' . $LNG['ls_eventcron_12'] . '
</ul>
</div>';
SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, sprintf($LNG['ls_eventcron_10'], $this->getUsernames($xy['id'])), $LNG['ls_eventcron_11'], $message);
$GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET year = '2016' where `id` = '" . $xy['id'] . "';");
}
$newevkaka = TIMESTAMP + 5 * 60;
$GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET birthday_event = '" . $newevkaka . "' where `uni` = '" . $UNI . "';");
}
}
示例9: MissionCaseStay
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing XNova.
*
*/
function MissionCaseStay($FleetRow)
{
global $lang, $resource;
if ($FleetRow['fleet_mess'] == 0) {
if ($FleetRow['fleet_start_time'] <= time()) {
$QryGetTargetPlanet = "SELECT * FROM {{table}} ";
$QryGetTargetPlanet .= "WHERE ";
$QryGetTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
$QryGetTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
$QryGetTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
$QryGetTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
$TargetPlanet = doquery($QryGetTargetPlanet, 'planets', true);
$TargetUserID = $TargetPlanet['id_owner'];
$TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
$TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
$TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_end_galaxy'] . "&system=" . $FleetRow['fleet_end_system'] . "\">";
$TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
SendSimpleMessage($TargetUserID, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
RestoreFleetToPlanet($FleetRow, false);
doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
}
} else {
if ($FleetRow['fleet_end_time'] <= time()) {
$TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']);
$TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
$TargetMessage = $lang['sys_stay_mess_back'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_start_galaxy'] . "&system=" . $FleetRow['fleet_start_system'] . "\">";
$TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_bend'] . "<br />" . $TargetAddedGoods;
SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
RestoreFleetToPlanet($FleetRow, true);
doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
}
}
}
示例10: _rewardPurchase
function _rewardPurchase($userId, $currency, $mc_gross)
{
// Make userid safe to use in query
$userId = mysql_real_escape_string($userId);
$timer = time();
$INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . $userId . ";");
if ($INFO1['lp_points'] >= 0) {
$tex = 1;
} elseif ($INFO1['lp_points'] >= 125) {
$tex = 2;
} elseif ($INFO1['lp_points'] >= 625) {
$tex = 4;
} elseif ($INFO1['lp_points'] >= 2500) {
$tex = 6;
} elseif ($INFO1['lp_points'] >= 7000) {
$tex = 8;
}
mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + " . $currency . " WHERE `id` = '" . $userId . "';");
if ($INFO1['ref_id'] != 0) {
mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $currency / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
SendSimpleMessage($INFO1['ref_id'], '', $timer, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($currency / 100 * 5) . ' anti matter have been credited to your account.');
}
SendSimpleMessage($userId, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' anti matter have been credited to your account.');
SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' Anti Matter Units have been credited to ' . $userId . ' account.');
if (DEBUG == true) {
error_log(date('[Y-m-d H:i e] ') . "Verified IPN: {$req} " . PHP_EOL, 3, LOG_FILE);
}
}
示例11: send
function send()
{
global $USER, $UNI, $LNG;
$ticketID = HTTP::_GP('id', 0);
$category = HTTP::_GP('category', 0);
$message = HTTP::_GP('message', '', true);
$change = HTTP::_GP('change_status', 0);
$ticketDetail = $GLOBALS['DATABASE']->getFirstRow("SELECT ownerID, subject, status FROM " . TICKETS . " WHERE ticketID = " . $ticketID . ";");
$status = $change ? $ticketDetail['status'] <= 1 ? 2 : 1 : 1;
if (!$change && empty($message)) {
HTTP::redirectTo('admin.php?page=support&mode=view&id=' . $ticketID);
}
if ($change && $status == 1) {
$this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $LNG['ti_admin_open'], $status);
}
if (!empty($message)) {
$subject = "RE: " . $ticketDetail['subject'];
$this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $message, $status);
}
if ($change && $status == 2) {
$this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $LNG['ti_admin_close'], $status);
}
SendSimpleMessage($ticketDetail['ownerID'], $USER['id'], TIMESTAMP, 4, $USER['username'], sprintf($LNG['sp_answer_message_title'], $ticketID), sprintf($LNG['sp_answer_message'], $ticketID));
HTTP::redirectTo('admin.php?page=support');
}
示例12: _activeUser
private function _activeUser()
{
$validationID = HTTP::_GP('i', 0);
$validationKey = HTTP::_GP('k', '');
$userData = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . USERS_VALID . " WHERE validationID = " . $validationID . " AND validationKey = '" . $GLOBALS['DATABASE']->escape($validationKey) . "';");
if (!isset($userData)) {
$this->printMessage(t('vertifyNoUserFound'));
}
$GLOBALS['DATABASE']->query("DELETE FROM " . USERS_VALID . " WHERE validationID = " . $validationID . ";");
list($userID, $planetID) = PlayerUtil::createPlayer($userData['universe'], $userData['userName'], $userData['password'], $userData['email'], $userData['race'], $userData['language']);
if (Config::get('mail_active', $userData['universe']) == 1) {
require 'includes/classes/Mail.class.php';
$MailSubject = t('registerMailCompleteTitle', Config::get('game_name', $userData['universe']));
$MailRAW = $GLOBALS['LNG']->getTemplate('email_reg_done');
$MailContent = str_replace(array('{USERNAME}', '{GAMENAME}', '{GAMEMAIL}'), array($userData['email'], Config::get('game_name') . ' - ' . Config::get('uni_name'), Config::get('smtp_sendmail')), $MailRAW);
try {
Mail::send($userData['email'], $userData['userName'], $MailSubject, $MailContent);
} catch (Exception $e) {
// This mail is wayne.
}
}
if (!empty($userData['referralID'])) {
$GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET\n\t\t\t`ref_id`\t= " . $userData['referralID'] . ",\n\t\t\t`ref_bonus`\t= 1\n\t\t\tWHERE\n\t\t\t`id`\t\t= " . $userID . ";");
}
if (!empty($userData['externalAuthUID'])) {
$GLOBALS['DATABASE']->query("INSERT INTO " . USERS_AUTH . " SET\n\t\t\t`id`\t\t= " . $userID . ",\n\t\t\t`account`\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthUID']) . "',\n\t\t\t`mode`\t\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthMethod']) . "';");
}
$nameSender = t('registerWelcomePMSenderName');
$subject = t('registerWelcomePMSubject');
$message = t('registerWelcomePMText', Config::get('game_name', $userData['universe']));
SendSimpleMessage($userID, 1, TIMESTAMP, 1, $nameSender, $subject, $message);
return array('userID' => $userID, 'userName' => $userData['userName'], 'planetID' => $planetID);
}
示例13: MissionCaseColonisation
function MissionCaseColonisation($FleetRow)
{
global $lang, $resource;
$iPlanetCount = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `id_owner` = '" . $FleetRow['fleet_owner'] . "' AND `planet_type` = '1'", 'planets'), 0);
if ($FleetRow['fleet_mess'] == 0) {
$iGalaxyPlace = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_end_system'] . "' AND `planet` = '" . $FleetRow['fleet_end_planet'] . "';", 'galaxy'), 0);
$TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
if ($iGalaxyPlace == 0) {
if ($iPlanetCount >= MAX_PLAYER_PLANETS) {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo'] . MAX_PLAYER_PLANETS . $lang['sys_colo_planet'];
SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
} else {
$NewOwnerPlanet = CreateOnePlanetRecord($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $FleetRow['fleet_owner'], $lang['sys_colo_defaultname'], false);
if ($NewOwnerPlanet == true) {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
if ($FleetRow['fleet_amount'] == 1) {
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
} else {
$CurrentFleet = explode(";", $FleetRow['fleet_array']);
$NewFleet = "";
foreach ($CurrentFleet as $Item => $Group) {
if ($Group != '') {
$Class = explode(",", $Group);
if ($Class[0] == 208) {
if ($Class[1] > 1) {
$NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
}
} else {
if ($Class[1] != 0) {
$NewFleet .= $Class[0] . "," . $Class[1] . ";";
}
}
}
}
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_array` = '" . $NewFleet . "', ";
$QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, ";
$QryUpdateFleet .= "`fleet_mess` = '1' ";
$QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';";
doquery($QryUpdateFleet, 'fleets');
}
} else {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos'];
SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
}
}
} else {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree'];
SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
}
} else {
RestoreFleetToPlanet($FleetRow, true);
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
}
}
示例14: ReturnEvent
function ReturnEvent()
{
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
$TargetUserID = $this->_fleet['fleet_target_owner'];
$TargetMessage = sprintf($LNG['sys_stat_mess'], GetStartAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
SendSimpleMessage($TargetUserID, 0, $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_stat_mess_stay'], $TargetMessage);
$this->RestoreFleet();
}
示例15: run
function run()
{
$query = $GLOBALS['DATABASE']->query("SELECT DISTINCT id FROM uni1_users;");
while ($x = $GLOBALS['DATABASE']->fetch_array($query)) {
$msg = '<span class="admin">If you have questions about the game: <a href="?page=ticket">Write them here</a></span>';
SendSimpleMessage($x['id'], '', TIMESTAMP, 50, 'System', 'Questions', $msg);
}
}