本文整理汇总了PHP中template::message方法的典型用法代码示例。如果您正苦于以下问题:PHP template::message方法的具体用法?PHP template::message怎么用?PHP template::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template
的用法示例。
在下文中一共展示了template::message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowVoucherPage
function ShowVoucherPage()
{
global $LNG, $USER;
$template = new template();
if ($_GET['mode'] == 'delete' && !empty($_GET['i'])) {
//delete an entry
$GLOBALS['DATABASE']->query("DELETE from `uni1_reward` where `rewardId` = " . $GLOBALS['DATABASE']->sql_escape($_GET['i']) . " ;");
$template->message("Voucher Code deleted");
die;
}
if ($_POST) {
$SQL = "";
foreach ($_POST as $key => $value) {
$SQL .= "'" . $value . "',";
}
$SQL = substr($SQL, 0, -1);
$GLOBALS['DATABASE']->query("INSERT INTO `uni1_reward` VALUES (NULL," . $SQL . ");");
$template->message("Voucher Added");
die;
}
$AllVouchers = array();
$GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_reward` ;");
if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
$AllVouchers[] = $x;
}
}
$template->assign_vars(array('AllVouchers' => $AllVouchers));
$template->show('VoucherEditor.tpl');
}
示例2: UpdateTicket
private function UpdateTicket($TicketID)
{
global $USER, $db, $LNG;
$text = request_var('text', '', true);
$template = new template();
if (empty($text)) {
exit($template->message($LNG['sendit_error_msg'], "game.php?page=support", 3));
}
$ticket = $db->uniquequery("SELECT text FROM " . SUPP . " WHERE `id` = '" . $TicketID . "';");
$text = $ticket['text'] . '<br><br><hr>' . $USER['username'] . ' schreib am ' . date("d. M Y H:i:s", TIMESTAMP) . '<br><br>' . makebr($text) . '';
$db->query("UPDATE " . SUPP . " SET `text` = '" . $db->sql_escape($text) . "',`status` = '3' WHERE `id` = '" . $db->sql_escape($TicketID) . "';");
$template->message($LNG['sendit_a'], "game.php?page=support", 3);
}
示例3: ShowGiveaway
function ShowGiveaway()
{
global $LNG, $resource, $reslist;
$template = new template();
$action = HTTP::_GP('action', '');
if ($action == 'send') {
$planet = HTTP::_GP('planet', 0);
$moon = HTTP::_GP('moon', 0);
$mainplanet = HTTP::_GP('mainplanet', 0);
$no_inactive = HTTP::_GP('no_inactive', 0);
if (!$planet && !$moon) {
$template->message($LNG['ga_selectplanettype']);
exit;
}
$planetIN = array();
if ($planet) {
$planetIN[] = "'1'";
}
if ($moon) {
$planetIN[] = "'3'";
}
$data = array();
$DataIDs = array_merge($reslist['resstype'][1], $reslist['resstype'][3], $reslist['build'], $reslist['tech'], $reslist['fleet'], $reslist['defense'], $reslist['officier']);
$logOld = array();
$logNew = array();
foreach ($DataIDs as $ID) {
$amount = max(0, round(HTTP::_GP('element_' . $ID, 0.0)));
$data[] = $resource[$ID] . " = " . $resource[$ID] . " + " . $amount;
$logOld[$ID] = 0;
$logNew[$ID] = $amount;
}
$SQL = "UPDATE " . PLANETS . " p INNER JOIN " . USERS . " u ON p.id_owner = u.id";
if ($mainplanet == true) {
$SQL .= " AND CONCAT_WS(':', p.universe, p.galaxy, p.system, p.planet) = CONCAT_WS(':', u.universe, u.galaxy, u.system, u.planet)";
}
if ($no_inactive == true) {
$SQL .= " AND u.onlinetime < " . (TIMESTAMP - INACTIVE);
}
$SQL .= " SET " . implode(', ', $data) . " WHERE p.universe = " . $_SESSION['adminuni'] . " AND p.planet_type IN (" . implode(',', $planetIN) . ")";
$GLOBALS['DATABASE']->query($SQL);
$LOG = new Log(4);
$LOG->target = 0;
$LOG->old = $logOld;
$LOG->new = $logNew;
$LOG->save();
$template->message($LNG['ga_success']);
exit;
}
$template->assign_vars(array('reslist' => $reslist));
$template->show("giveaway.tpl");
}
示例4: ShowUpdatePage
function ShowUpdatePage()
{
global $LNG, $CONF;
$template = new template();
$template->message('<p>This Site is currently under construction, because the update system brings somtimes inconsistent game installations.</p><p>Alternate update process: <a href="http://2moons.cc/b4-support/b7-installation-update-und-konvertierung/t1721-howto-update-your-2moons-game-with-private-modifications-without-edit-files-one-by-one/" target="blank"><u>2moons.cc Board</u></a></p><p>We apologize for any inconvenience.</p>');
exit;
if (!function_exists('curl_init')) {
$template = new template();
$template->message($LNG['up_need_curl']);
}
if (isset($_REQUEST['version'])) {
$Temp = explode('.', $_REQUEST['version']);
$Temp = array_map('intval', $Temp);
if (count(GetLogs($Temp[2]), COUNT_RECURSIVE) > 8) {
Config::update(array('VERSION' => $Temp[0] . '.' . $Temp[1] . '.' . $Temp[2]));
}
}
$ACTION = HTTP::_GP('action', '');
switch ($ACTION) {
case "download":
DownloadUpdates();
break;
case "check":
CheckPermissions();
break;
case "update":
ExecuteUpdates();
break;
default:
DisplayUpdates();
break;
}
}
示例5: ShowClearCachePage
function ShowClearCachePage()
{
global $LNG;
ClearCache();
$template = new template();
$template->message($LNG['cc_cache_clear']);
}
示例6: message
function message($mes, $dest = "", $time = "3", $topnav = false, $menu = true)
{
require_once ROOT_PATH . 'includes/classes/class.template.php';
$template = new template();
$template->message($mes, $dest, $time, !$topnav);
exit;
}
示例7: ShowStatUpdatePage
function ShowStatUpdatePage()
{
global $LNG;
require_once 'includes/classes/class.statbuilder.php';
$stat = new statbuilder();
$result = $stat->MakeStats();
$memory_p = str_replace(array("%p", "%m"), $result['memory_peak'], $LNG['sb_top_memory']);
$memory_e = str_replace(array("%e", "%m"), $result['end_memory'], $LNG['sb_final_memory']);
$memory_i = str_replace(array("%i", "%m"), $result['initial_memory'], $LNG['sb_start_memory']);
$stats_end_time = sprintf($LNG['sb_stats_update'], $result['totaltime']);
$stats_sql = sprintf($LNG['sb_sql_counts'], $result['sql_count']);
$template = new template();
$template->message($LNG['sb_stats_updated'] . $stats_end_time . $memory_i . $memory_e . $memory_p . $stats_sql, false, 0, true);
}
示例8: ShowClearCachePage
function ShowClearCachePage()
{
global $LNG;
$DIRS = array('cache/UserBanner/', 'cache/');
foreach ($DIRS as $DIR) {
$FILES = array_diff(scandir($DIR), array('..', '.', '.htaccess'));
foreach ($FILES as $FILE) {
if (is_dir(ROOT_PATH . $DIR . $FILE)) {
continue;
}
unlink(ROOT_PATH . $DIR . $FILE);
}
}
$template = new template();
$template->message($LNG['cc_cache_clear']);
}
示例9: ShowDumpPage
function ShowDumpPage()
{
global $LNG;
switch ($_REQUEST['action']) {
case 'dump':
$dbTables = HTTP::_GP('dbtables', array());
if (empty($dbTables)) {
$template = new template();
$template->message($LNG['du_not_tables_selected']);
exit;
}
$fileName = '2MoonsBackup_' . date('d_m_Y_H_i_s', TIMESTAMP) . '.sql';
$filePath = 'includes/backups/' . $fileName;
require 'includes/classes/SQLDumper.class.php';
$dump = new SQLDumper();
$dump->dumpTablesToFile($dbTables, $filePath);
$template = new template();
$template->message(sprintf($LNG['du_success'], 'includes/backups/' . $fileName));
break;
default:
$dumpData['perRequest'] = 100;
$dumpData = array();
$prefixCounts = strlen(DB_PREFIX);
$dumpData['sqlTables'] = array();
$sqlTableRaw = $GLOBALS['DATABASE']->query("SHOW TABLE STATUS FROM `" . DB_NAME . "`;");
while ($table = $GLOBALS['DATABASE']->fetchArray($sqlTableRaw)) {
if (DB_PREFIX == substr($table['Name'], 0, $prefixCounts)) {
$dumpData['sqlTables'][] = $table['Name'];
}
}
$template = new template();
$template->assign_vars(array('dumpData' => $dumpData));
$template->show('DumpPage.tpl');
break;
}
}
示例10: __construct
public function __construct()
{
global $PLANET, $USER, $LNG, $resource, $reslist, $CONF, $db, $pricelist;
include_once ROOT_PATH . 'includes/functions/IsTechnologieAccessible.' . PHP_EXT;
include_once ROOT_PATH . 'includes/functions/GetElementPrice.' . PHP_EXT;
$template = new template();
$template->page_header();
$template->page_topnav();
$template->page_leftmenu();
$template->page_planetmenu();
$template->page_footer();
if ($PLANET[$resource[31]] == 0) {
$template->message($LNG['bd_lab_required']);
exit;
}
$bContinue = $this->CheckLabSettingsInQueue($PLANET) ? true : false;
$PLANET[$resource[31] . '_inter'] = $this->CheckAndGetLabLevel($USER, $PLANET);
$TheCommand = request_var('cmd', '');
$Element = request_var('tech', 0);
$PlanetRess = new ResourceUpdate();
if ($USER['urlaubs_modus'] == 0 && !empty($TheCommand) && $bContinue) {
switch ($TheCommand) {
case 'cancel':
if (empty($USER['b_tech'])) {
break;
}
$costs = GetBuildingPrice($USER, $PLANET, $USER['b_tech_id']);
if ($PLANET['id'] == $USER['b_tech_planet']) {
$PLANET['metal'] += $costs['metal'];
$PLANET['crystal'] += $costs['crystal'];
$PLANET['deuterium'] += $costs['deuterium'];
} else {
$db->query("UPDATE " . PLANETS . " SET `metal` = `metal` + '" . $costs['metal'] . "', `crystal` = `crystal` + '" . $costs['crystal'] . "', `deuterium` = `deuterium` + '" . $costs['deuterium'] . "' WHERE `id` = '" . $USER['b_tech_planet'] . "';");
}
$USER['darkmatter'] += $costs['darkmatter'];
$USER['b_tech_id'] = 0;
$USER['b_tech'] = 0;
$USER['b_tech_planet'] = 0;
break;
case 'search':
if (!empty($USER['b_tech']) || empty($Element) || !in_array($Element, $reslist['tech']) || $USER[$resource[$Element]] >= $pricelist[$Element]['max'] || !IsTechnologieAccessible($USER, $PLANET, $Element) || !IsElementBuyable($USER, $PLANET, $Element)) {
break;
}
$costs = GetBuildingPrice($USER, $PLANET, $Element);
$PLANET['metal'] -= $costs['metal'];
$PLANET['crystal'] -= $costs['crystal'];
$PLANET['deuterium'] -= $costs['deuterium'];
$USER['darkmatter'] -= $costs['darkmatter'];
$USER['b_tech_id'] = $Element;
$USER['b_tech'] = TIMESTAMP + GetBuildingTime($USER, $PLANET, $Element);
$USER['b_tech_planet'] = $PLANET['id'];
break;
}
}
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();
$ScriptInfo = array();
foreach ($reslist['tech'] as $ID => $Element) {
if (IsTechnologieAccessible($USER, $PLANET, $Element)) {
$CanBeDone = IsElementBuyable($USER, $PLANET, $Element);
if (isset($pricelist[$Element]['max']) && $USER[$resource[$Element]] >= $pricelist[$Element]['max']) {
$TechnoLink = "<font color=\"#FF0000\">" . $LNG['bd_maxlevel'] . "</font>";
} elseif ($USER['b_tech_id'] == 0) {
$LevelToDo = 1 + $USER[$resource[$Element]];
if ($CanBeDone && $this->CheckLabSettingsInQueue($PLANET)) {
$TechnoLink = "<a href=\"game.php?page=buildings&mode=research&cmd=search&tech=" . $Element . "\"><font color=\"#00FF00\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font></a>";
} else {
$TechnoLink = "<font color=\"#FF0000\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font>";
}
} else {
if ($USER['b_tech_id'] == $Element) {
if ($USER['b_tech_planet'] == $PLANET['id']) {
$template->loadscript('research.js');
$ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => '', 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
} else {
$THEPLANET = $db->uniquequery("SELECT `name` FROM " . PLANETS . " WHERE `id` = '" . $USER['b_tech_planet'] . "';");
$template->loadscript('research.js');
$ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => $LNG['bd_on'] . '<br>' . $THEPLANET['name'], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
}
$TechnoLink = '<div id="research"></div>';
} else {
$TechnoLink = '<center>-</center>';
}
}
$ResearchList[] = array('id' => $Element, 'maxinfo' => isset($pricelist[$Element]['max']) && $pricelist[$Element]['max'] != 255 ? sprintf($LNG['bd_max_lvl'], $pricelist[$Element]['max']) : '', 'name' => $LNG['tech'][$Element], 'descr' => $LNG['res']['descriptions'][$Element], 'price' => GetElementPrice($USER, $PLANET, $Element), 'time' => pretty_time(GetBuildingTime($USER, $PLANET, $Element)), 'restprice' => $this->GetRestPrice($Element), 'elvl' => $Element == 106 ? $USER['rpg_espion'] * ESPION . " (" . $LNG['tech'][610] . ")" : ($Element == 108 ? $USER['rpg_commandant'] * COMMANDANT . " (" . $LNG['tech'][611] . ")" : false), 'lvl' => $USER[$resource[$Element]], 'link' => $TechnoLink);
}
}
$template->assign_vars(array('ResearchList' => $ResearchList, 'IsLabinBuild' => !$bContinue, 'ScriptInfo' => json_encode($ScriptInfo), 'bd_building_lab' => $LNG['bd_building_lab'], 'bd_remaining' => $LNG['bd_remaining'], 'bd_lvl' => $LNG['bd_lvl'], 'fgf_time' => $LNG['fgf_time']));
$template->show('buildings_research.tpl');
}
示例11: ShowAccountEditorPage
function ShowAccountEditorPage()
{
global $LNG, $reslist, $resource;
$template = new template();
switch ($_GET['edit']) {
case 'resources':
$id = HTTP::_GP('id', 0);
$id_dark = HTTP::_GP('id_dark', 0);
$metal = max(0, round(HTTP::_GP('metal', 0.0)));
$cristal = max(0, round(HTTP::_GP('cristal', 0.0)));
$deut = max(0, round(HTTP::_GP('deut', 0.0)));
$dark = HTTP::_GP('dark', 0);
if ($_POST) {
if (!empty($id)) {
$before = $GLOBALS['DATABASE']->getFirstRow("SELECT `metal`,`crystal`,`deuterium`,`universe` FROM " . PLANETS . " WHERE `id` = '" . $id . "';");
}
if (!empty($id_dark)) {
$before_dm = $GLOBALS['DATABASE']->getFirstRow("SELECT `darkmatter` FROM " . USERS . " WHERE `id` = '" . $id_dark . "';");
}
if ($_POST['add']) {
if (!empty($id)) {
$SQL = "UPDATE " . PLANETS . " SET ";
$SQL .= "`metal` = `metal` + '" . $metal . "', ";
$SQL .= "`crystal` = `crystal` + '" . $cristal . "', ";
$SQL .= "`deuterium` = `deuterium` + '" . $deut . "' ";
$SQL .= "WHERE ";
$SQL .= "`id` = '" . $id . "' AND `universe` = '" . Universe::getEmulated() . "';";
$GLOBALS['DATABASE']->query($SQL);
$after = array('metal' => $before['metal'] + $metal, 'crystal' => $before['crystal'] + $cristal, 'deuterium' => $before['deuterium'] + $deut);
}
if (!empty($id_dark)) {
$SQL = "UPDATE " . USERS . " SET ";
$SQL .= "`darkmatter` = `darkmatter` + '" . $dark . "' ";
$SQL .= "WHERE ";
$SQL .= "`id` = '" . $id_dark . "' AND `universe` = '" . Universe::getEmulated() . "' ";
$GLOBALS['DATABASE']->query($SQL);
$after_dm = array('darkmatter' => $before_dm['darkmatter'] + $dark);
}
} elseif ($_POST['delete']) {
if (!empty($id)) {
$SQL = "UPDATE " . PLANETS . " SET ";
$SQL .= "`metal` = `metal` - '" . $metal . "', ";
$SQL .= "`crystal` = `crystal` - '" . $cristal . "', ";
$SQL .= "`deuterium` = `deuterium` - '" . $deut . "' ";
$SQL .= "WHERE ";
$SQL .= "`id` = '" . $id . "' AND `universe` = '" . Universe::getEmulated() . "';";
$GLOBALS['DATABASE']->query($SQL);
$after = array('metal' => $before['metal'] - $metal, 'crystal' => $before['crystal'] - $cristal, 'deuterium' => $before['deuterium'] - $deut);
}
if (!empty($id_dark)) {
$SQL = "UPDATE " . USERS . " SET ";
$SQL .= "`darkmatter` = `darkmatter` - '" . $dark . "' ";
$SQL .= "WHERE ";
$SQL .= "`id` = '" . $id_dark . "';";
$GLOBALS['DATABASE']->query($SQL);
$after_dm = array('darkmatter' => $before_dm['darkmatter'] - $dark);
}
}
if (!empty($id)) {
$LOG = new Log(2);
$LOG->target = $id;
$LOG->universe = $before_dm['universe'];
$LOG->old = $before;
$LOG->new = $after;
$LOG->save();
}
if (!empty($id_dark)) {
$LOG = new Log(1);
$LOG->target = $id_dark;
$LOG->universe = $before_dm['universe'];
$LOG->old = $before_dm;
$LOG->new = $after_dm;
$LOG->save();
}
if ($_POST['add']) {
$template->message($LNG['ad_add_res_sucess'], '?page=accounteditor&edit=resources');
} else {
if ($_POST['delete']) {
$template->message($LNG['ad_delete_res_sucess'], '?page=accounteditor&edit=resources');
}
}
exit;
}
$template->show('AccountEditorPageResources.tpl');
break;
case 'ships':
if ($_POST) {
$before1 = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . PLANETS . " WHERE `id` = '" . HTTP::_GP('id', 0) . "';");
$before = array();
$after = array();
foreach ($reslist['fleet'] as $ID) {
$before[$ID] = $before1[$resource[$ID]];
}
if ($_POST['add']) {
$SQL = "UPDATE " . PLANETS . " SET ";
$SQL .= "`eco_hash` = '', ";
foreach ($reslist['fleet'] as $ID) {
$QryUpdate[] = "`" . $resource[$ID] . "` = `" . $resource[$ID] . "` + '" . max(0, round(HTTP::_GP($resource[$ID], 0.0))) . "'";
$after[$ID] = $before[$ID] + max(0, round(HTTP::_GP($resource[$ID], 0.0)));
}
//.........这里部分代码省略.........
示例12: ShowUpdatePage
//.........这里部分代码省略.........
require $SVN_ROOT . $File;
} else {
if (strpos($File, '.') !== false) {
$Data = fopen($SVN_ROOT . $File, "r");
if ($ftp->uploadFromFile($Data, str_replace("/trunk/", "", $File))) {
$LOG['update'][$Rev][$File] = "OK! - Updated";
} else {
$LOG['update'][$Rev][$File] = "ERROR! - Konnte Datei nicht hochladen";
}
fclose($Data);
} else {
if ($ftp->makeDir(str_replace("/trunk/", "", $File), 1)) {
if (PHP_SAPI == 'apache2handler') {
$ftp->chmod(str_replace("/trunk/", "", $File), '0777');
} else {
$ftp->chmod(str_replace("/trunk/", "", $File), '0755');
}
$LOG['update'][$Rev][$File] = "OK! - Updated";
} else {
$LOG['update'][$Rev][$File] = "ERROR! - Konnte Datei nicht hochladen";
}
}
}
}
}
if (!empty($RevInfo['edit'])) {
foreach ($RevInfo['edit'] as $File) {
if (strpos($File, '.') !== false) {
if ($File == "/trunk/updates/update_" . $Rev . ".sql") {
$db->multi_query(str_replace("prefix_", DB_PREFIX, file_get_contents($SVN_ROOT . $File)));
continue;
} else {
$Data = fopen($SVN_ROOT . $File, "r");
if ($ftp->uploadFromFile($Data, str_replace("/trunk/", "", $File))) {
$LOG['update'][$Rev][$File] = "OK! - Updated";
} else {
$LOG['update'][$Rev][$File] = "ERROR! - Konnte Datei nicht hochladen";
}
fclose($Data);
}
}
}
}
if (!empty($RevInfo['del'])) {
foreach ($RevInfo['del'] as $File) {
if (strpos($File, '.') !== false) {
if ($ftp->delete(str_replace("/trunk/", "", $File))) {
$LOG['update'][$Rev][$File] = "OK! - Gelöscht";
} else {
$LOG['update'][$Rev][$File] = "ERROR! - Konnte Datei nicht löschen";
}
} else {
if ($ftp->removeDir(str_replace("/trunk/", "", $File), 1)) {
$LOG['update'][$Rev][$File] = "OK! - Gelöscht";
} else {
$LOG['update'][$Rev][$File] = "ERROR! - Konnte Datei nicht löschen";
}
}
}
}
$LastRev = $Rev;
}
$LOG['finish']['atrev'] = "UPDATE: OK! At Revision: " . $LastRev;
// Verbindung schließen
update_config('VERSION', str_replace("RC", "", $Patchlevel[0]) . "." . $Patchlevel[1] . "." . $LastRev);
exitupdate($LOG);
break;
default:
$template = new template();
$template->page_header();
$RevList = '';
$Update = '';
$Info = '';
if (!function_exists('file_get_contents') || !function_exists('fsockopen')) {
$template->message('Function file_get_contents oder fsockopen deactive', false, 0, true);
} elseif (($RAW = @file_get_contents("http://update.2moons-systems.com/index.php?action=update", FALSE, $context)) !== false) {
$UpdateArray = unserialize($RAW);
if (is_array($UpdateArray['revs'])) {
foreach ($UpdateArray['revs'] as $Rev => $RevInfo) {
if (!(empty($RevInfo['add']) && empty($RevInfo['edit'])) && $Patchlevel[2] < $Rev) {
$Update = "<tr><th><a href=\"?page=update&action=update\">Update</a> - <a href=\"?page=update&action=download\">Download Patch Files</a></th></tr>";
$Info = "<tr><td class=\"c\" colspan=\"5\">Aktuelle Updates</td></tr>";
}
$edit = "";
if (!empty($RevInfo['edit']) || is_array($RevInfo['edit'])) {
foreach ($RevInfo['edit'] as $file) {
$edit .= '<a href="http://code.google.com/p/2moons/source/diff?spec=svn' . $Rev . '&r=' . $Rev . '&format=side&path=' . $file . '" target="diff">' . str_replace("/trunk/", "", $file) . '</a><br>';
}
}
$RevList .= "<tr>\r\n\t\t\t\t\t\t" . ($Patchlevel[2] == $Rev ? "<td class=c colspan=5>Momentane Version</td></tr><tr>" : ($Patchlevel[2] - 1 == $Rev ? "<td class=c colspan=5>Alte Updates</td></tr><tr>" : "")) . "\r\n\t\t\t\t\t\t<td class=c >" . ($Patchlevel[2] == $Rev ? "<font color=\"red\">" : "") . "Revision " . $Rev . " " . date("d. M y H:i:s", $RevInfo['timestamp']) . " von " . $RevInfo['author'] . ($Patchlevel[2] == $Rev ? "</font>" : "") . "</td></tr>\r\n\t\t\t\t\t\t<tr><th>" . makebr($RevInfo['log']) . "</th></tr>\r\n\t\t\t\t\t\t" . (!empty($RevInfo['add']) ? "<tr><th>ADD:<br>" . str_replace("/trunk/", "", implode("<br>\n", $RevInfo['add'])) . "</b></th></tr>" : "") . "\r\n\t\t\t\t\t\t" . (!empty($RevInfo['edit']) ? "<tr><th>EDIT:<br>" . $edit . "</b></th></tr>" : "") . "\r\n\t\t\t\t\t\t" . (!empty($RevInfo['del']) ? "<tr><th>DEL:<br>" . str_replace("/trunk/", "", implode("<br>\n", $RevInfo['del'])) . "</b></th></tr>" : "") . "\r\n\t\t\t\t\t\t</tr>";
}
}
$template->assign_vars(array('RevList' => $RevList, 'Update' => $Update, 'Info' => $Info));
$template->show('adm/UpdatePage.tpl');
} else {
$template->message('Update Server currently not available', false, 0, true);
}
break;
}
}
示例13: ShowBanPage
//.........这里部分代码省略.........
while ($a = $db->fetch_array($UserList)) {
$UserSelect['List'] .= '<option value="' . $a['username'] . '">' . $a['username'] . ' (ID: ' . $a['id'] . ')' . ($a['bana'] == '1' ? $LNG['bo_characters_suus'] : '') . '</option>';
$Users++;
}
$db->free_result($UserList);
if ($_GET['order2'] == 'id') {
$ORDER2 = "id";
} else {
$ORDER2 = "username";
}
$Banneds = 0;
$UserListBan = $db->query("SELECT `username`, `id` FROM " . USERS . " WHERE `bana` = '1' ORDER BY " . $ORDER2 . " ASC;");
while ($b = $db->fetch_array($UserListBan)) {
$UserSelect['ListBan'] .= '<option value="' . $b['username'] . '">' . $b['username'] . ' (ID: ' . $b['id'] . ')</option>';
$Banneds++;
}
$db->free_result($UserListBan);
$template = new template();
$template->loadscript('filterlist.js');
$template->page_header();
if (isset($_POST['panel'])) {
$Name = request_var('ban_name', '', true);
$BANUSER = $db->uniquequery("SELECT b.theme, b.longer, u.id, u.urlaubs_modus, u.banaday FROM " . USERS . " as u LEFT JOIN " . BANNED . " as b ON u.`username` = b.`who` WHERE u.`username` = '" . $db->sql_escape($Name) . "';");
if ($BANUSER['banaday'] <= TIMESTAMP) {
$title = $LNG['bo_bbb_title_1'];
$changedate = $LNG['bo_bbb_title_2'];
$changedate_advert = '';
$reas = '';
$timesus = '';
} else {
$title = $LNG['bo_bbb_title_3'];
$changedate = $LNG['bo_bbb_title_6'];
$changedate_advert = '<td class="c" width="18px"><img src="./styles/images/Adm/i.gif" onMouseOver="return overlib(\'' . $LNG['bo_bbb_title_4'] . '\', CENTER, OFFSETX, -80, OFFSETY, -65, WIDTH, 250);" onMouseOut="return nd();"></td>';
$reas = $BANUSER['theme'];
$timesus = "<tr>\r\n\t\t\t\t\t<th>" . $LNG['bo_bbb_title_5'] . "</th>\r\n\t\t\t\t\t<th height=25 colspan=2>" . date("d-m-Y H:i:s", $BANUSER['longer']) . "</th>\r\n\t\t\t\t</tr>";
}
$vacation = $BANUSER['urlaubs_modus'] == 1 ? true : false;
$template->assign_vars(array('name' => $Name, 'bantitle' => $title, 'changedate' => $changedate, 'reas' => $reas, 'changedate_advert' => $changedate_advert, 'timesus' => $timesus, 'vacation' => $vacation, 'bo_characters_1' => $LNG['bo_characters_1'], 'bo_reason' => $LNG['bo_reason'], 'bo_username' => $LNG['bo_username'], 'bo_vacation_mode' => $LNG['bo_vacation_mode'], 'bo_vacaations' => $LNG['bo_vacaations'], 'time_seconds' => $LNG['time_seconds'], 'time_minutes' => $LNG['time_minutes'], 'time_hours' => $LNG['time_hours'], 'time_days' => $LNG['time_days']));
} elseif (isset($_POST['bannow']) && $BANUSER['id'] != 1) {
$Name = request_var('ban_name', '', true);
$reas = request_var('why', '', true);
$days = request_var('days', 0);
$hour = request_var('hour', 0);
$mins = request_var('mins', 0);
$secs = request_var('secs', 0);
$admin = $USER['username'];
$mail = $USER['email'];
$BanTime = $days * 86400 + $hour * 3600 + $mins * 60 + $secs;
if ($BANUSER['longer'] > TIMESTAMP) {
$BanTime += $BANUSER['longer'] - TIMESTAMP;
}
if ($BanTime + TIMESTAMP < TIMESTAMP) {
$BannedUntil = TIMESTAMP;
} else {
$BannedUntil = TIMESTAMP + $BanTime;
}
if ($BANUSER['banaday'] > TIMESTAMP) {
$SQL = "UPDATE " . BANNED . " SET ";
$SQL .= "`who` = '" . $Name . "', ";
$SQL .= "`theme` = '" . $reas . "', ";
$SQL .= "`who2` = '" . $Name . "', ";
$SQL .= "`time` = '" . TIMESTAMP . "', ";
$SQL .= "`longer` = '" . $BannedUntil . "', ";
$SQL .= "`author` = '" . $admin . "', ";
$SQL .= "`email` = '" . $mail . "' ";
$SQL .= "WHERE `who2` = '" . $Name . "';";
$db->query($SQL);
} else {
$SQL = "INSERT INTO " . BANNED . " SET ";
$SQL .= "`who` = '" . $Name . "', ";
$SQL .= "`theme` = '" . $reas . "', ";
$SQL .= "`who2` = '" . $Name . "', ";
$SQL .= "`time` = '" . TIMESTAMP . "', ";
$SQL .= "`longer` = '" . $BannedUntil . "', ";
$SQL .= "`author` = '" . $admin . "', ";
$SQL .= "`email` = '" . $mail . "';";
$db->query($SQL);
}
$SQL = "UPDATE " . USERS . " SET ";
$SQL .= "`bana` = '1', ";
$SQL .= "`banaday` = '" . $BannedUntil . "', ";
if (isset($_POST['vacat'])) {
$SQL .= "`urlaubs_modus` = '1'";
} else {
$SQL .= "`urlaubs_modus` = '0'";
}
$SQL .= "WHERE ";
$SQL .= "`username` = '" . $Name . "';";
$db->query($SQL);
$template->message($LNG['bo_the_player'] . $Name . $LNG['bo_banned'], '?page=bans');
exit;
} elseif (isset($_POST['unban_name'])) {
$Name = request_var('unban_name', '', true);
$db->multi_query("DELETE FROM " . BANNED . " WHERE who = '" . $db->sql_escape($Name) . "';UPDATE " . USERS . " SET bana = '0', banaday = '0' WHERE username = '" . $db->sql_escape($Name) . "';");
$template->message($LNG['bo_the_player2'] . $Name . $LNG['bo_unbanned'], '?page=bans');
exit;
}
$template->assign_vars(array('UserSelect' => $UserSelect, 'bo_ban_player' => $LNG['bo_ban_player'], 'bo_select_title' => $LNG['bo_select_title'], 'bo_order_banned' => $LNG['bo_order_banned'], 'bo_order_id' => $LNG['bo_order_id'], 'bo_order_username' => $LNG['bo_order_username'], 'button_filter' => $LNG['button_filter'], 'button_reset' => $LNG['button_reset'], 'button_deselect' => $LNG['button_deselect'], 'button_submit' => $LNG['button_submit'], 'bo_total_users' => $LNG['bo_total_users'], 'bo_total_banneds' => $LNG['bo_total_banneds'], 'bo_unban_player' => $LNG['bo_unban_player'], 'usercount' => $Users, 'bancount' => $Banneds));
$template->show('adm/BanPage.tpl');
}
示例14: unlink
$quickStartFile = 'includes/FIRST_INSTALL';
// If include/FIRST_INSTALL is present and can be deleted, automatically create include/ENABLE_INSTALL_TOOL
if (is_file($quickStartFile) && is_writeable($quickStartFile) && unlink($quickStartFile)) {
@touch($enableInstallToolFile);
}
// Only allow Install Tool access if the file "include/ENABLE_INSTALL_TOOL" is found
if (is_file($enableInstallToolFile) && time() - filemtime($enableInstallToolFile) > 3600) {
$content = file_get_contents($enableInstallToolFile);
$verifyString = 'KEEP_FILE';
if (trim($content) !== $verifyString) {
// Delete the file if it is older than 3600s (1 hour)
unlink($enableInstallToolFile);
}
}
if (!is_file($enableInstallToolFile)) {
$template->message($LNG->getTemplate('locked_install'), false, 0, true);
exit;
}
$language = HTTP::_GP('lang', '');
if (!empty($language) && in_array($language, $LNG->getAllowedLangs())) {
setcookie('lang', $language);
}
$mode = HTTP::_GP('mode', '');
switch ($mode) {
case 'ajax':
require 'includes/libs/ftp/ftp.class.php';
require 'includes/libs/ftp/ftpexception.class.php';
$LNG->includeData(array('ADMIN'));
$connectionConfig = array("host" => $_GET['host'], "username" => $_GET['user'], "password" => $_GET['pass'], "port" => 21);
try {
$ftp = FTP::getInstance();
示例15: MissilesAjax
public static function MissilesAjax()
{
global $USER, $PLANET, $LNG, $CONF, $db, $reslist, $resource;
include_once ROOT_PATH . 'includes/functions/IsVacationMode.' . PHP_EXT;
$iraks = $PLANET['interplanetary_misil'];
$TargetGalaxy = request_var('galaxy', 0);
$TargetSystem = request_var('system', 0);
$TargetPlanet = request_var('planet', 0);
$anz = min(request_var('SendMI', 0), $iraks);
$pziel = request_var('Target', "");
$PlanetRess = new ResourceUpdate($USER, $PLANET);
$Target = $db->uniquequery("SELECT `id_owner`, `id_level` FROM " . PLANETS . " WHERE `galaxy` = '" . $TargetGalaxy . "' AND `system` = '" . $TargetSystem . "' AND `planet` = '" . $TargetPlanet . "' AND `planet_type` = '1';");
$Distance = abs($TargetSystem - $PLANET['system']);
require_once ROOT_PATH . 'includes/classes/class.GalaxyRows.' . PHP_EXT;
$GalaxyRows = new GalaxyRows();
if (IsVacationMode($USER)) {
$error = $LNG['fl_vacation_mode_active'];
} elseif ($PLANET['silo'] < 4) {
$error = $LNG['ma_silo_level'];
} elseif ($USER['impulse_motor_tech'] == 0) {
$error = $LNG['ma_impulse_drive_required'];
} elseif ($TargetGalaxy != $PLANET['galaxy'] || $Distance > $GalaxyRows->GetMissileRange($USER[$resource[117]])) {
$error = $LNG['ma_not_send_other_galaxy'];
} elseif (!$Target) {
$error = $LNG['ma_planet_doesnt_exists'];
} elseif (!in_array($pziel, $reslist['defense']) && $pziel != 0) {
$error = $LNG['ma_wrong_target'];
} elseif ($iraks == 0) {
$error = $LNG['ma_no_missiles'];
} elseif ($anz == 0) {
$error = $LNG['ma_add_missile_number'];
} elseif ($Target['id_level'] > $USER['authlevel'] && $CONF['adm_attack'] == 0) {
$error = $LNG['fl_admins_cannot_be_attacked'];
}
$TargetUser = GetUserByID($Target['id_owner'], array('onlinetime'));
$UserPoints = $USER;
$User2Points = $db->uniquequery("SELECT `total_points` FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $Target['id_owner'] . "';");
$IsNoobProtec = CheckNoobProtec($UserPoints, $User2Points, $TargetUser['onlinetime']);
if ($IsNoobProtec['NoobPlayer']) {
$error = $LNG['fl_week_player'];
} elseif ($IsNoobProtec['StrongPlayer']) {
$error = $LNG['fl_strong_player'];
}
$template = new template();
$template->page_header();
$template->page_topnav();
$template->page_leftmenu();
$template->page_planetmenu();
$template->page_footer();
if ($error != "") {
$template->message($error);
exit;
}
$SpeedFactor = parent::GetGameSpeedFactor();
$Duration = max(round(30 + 60 * $Distance / $SpeedFactor), 30);
$DefenseLabel = $pziel == 0 ? $LNG['ma_all'] : $LNG['tech'][$pziel];
if (connection_aborted()) {
exit;
}
$sql = "INSERT INTO " . FLEETS . " SET\r\n\t\t\t\tfleet_owner = '" . $USER['id'] . "',\r\n\t\t\t\tfleet_mission = '10',\r\n\t\t\t\tfleet_amount = '" . $anz . "',\r\n\t\t\t\tfleet_array = '503," . $anz . "',\r\n\t\t\t\tfleet_start_time = '" . (TIMESTAMP + $Duration) . "',\r\n\t\t\t\tfleet_start_galaxy = '" . $PLANET['galaxy'] . "',\r\n\t\t\t\tfleet_start_system = '" . $PLANET['system'] . "',\r\n\t\t\t\tfleet_start_planet ='" . $PLANET['planet'] . "',\r\n\t\t\t\tfleet_start_type = '1',\r\n\t\t\t\tfleet_end_time = '" . (TIMESTAMP + $Duration + 50) . "',\r\n\t\t\t\tfleet_end_stay = '0',\r\n\t\t\t\tfleet_end_galaxy = '" . $TargetGalaxy . "',\r\n\t\t\t\tfleet_end_system = '" . $TargetSystem . "',\r\n\t\t\t\tfleet_end_planet = '" . $TargetPlanet . "',\r\n\t\t\t\tfleet_end_type = '1',\r\n\t\t\t\tfleet_target_obj = '" . $db->sql_escape($pziel) . "',\r\n\t\t\t\tfleet_resource_metal = '0',\r\n\t\t\t\tfleet_resource_crystal = '0',\r\n\t\t\t\tfleet_resource_deuterium = '0',\r\n\t\t\t\tfleet_target_owner = '" . $Target["id_owner"] . "',\r\n\t\t\t\tfleet_group = '0',\r\n\t\t\t\tfleet_mess = '0',\r\n\t\t\t\tstart_time = " . TIMESTAMP . ";\r\n\t\t\t\tUPDATE " . PLANETS . " SET \r\n\t\t\t\tinterplanetary_misil = (interplanetary_misil - " . $anz . ") WHERE id = '" . $PLANET['id'] . "';";
$db->multi_query($sql);
$template->message("<b>" . $anz . "</b>" . $LNG['ma_missiles_sended'] . $DefenseLabel, "game.php?page=overview", 3);
}