function ShowTopKB() { global $USER, $PLANET, $LNG, $db; $mode = request_var('mode', ''); $template = new template(); switch ($mode) { case "showkb": $template->page_header(); $template->page_footer(); includeLang('FLEET'); $ReportID = request_var('rid', ''); if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) { require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php'; $RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';"); } else { $RaportRAW = $db->uniquequery("SELECT * FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';"); $raport = stripslashes($RaportRAW['raport']); foreach ($LNG['tech_rc'] as $id => $s_name) { $str_replace1 = array("[ship[" . $id . "]]"); $str_replace2 = array($s_name); $raport = str_replace($str_replace1, $str_replace2, $raport); } } foreach ($LNG['tech_rc'] as $id => $s_name) { $ship[] = "[ship[" . $id . "]]"; $shipname[] = $s_name; } $template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport)); $template->show("topkb_report.tpl"); break; default: $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $top = $db->query("SELECT * FROM " . TOPKB . " ORDER BY gesamtunits DESC LIMIT 100;"); while ($data = $db->fetch_array($top)) { $TopKBList[] = array('result' => $data['fleetresult'], 'time' => date("D d M H:i:s", $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']); } $db->free_result($top); $template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList)); $template->show("topkb_overview.tpl"); break; } }
function ShowTechTreePage() { global $resource, $requeriments, $LNG, $reslist, $USER, $PLANET; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $RequeriList = array(); foreach ($LNG['tech'] as $Element => $ElementName) { if (in_array($Element, $reslist['dmfunc'])) { continue; } if (!isset($resource[$Element])) { $TechTreeList[] = $ElementName; } else { if (isset($requeriments[$Element])) { foreach ($requeriments[$Element] as $RegID => $RedCount) { $RequeriList[$Element][] = array('id' => $RegID, 'count' => $RedCount, 'own' => isset($PLANET[$resource[$RegID]]) ? $PLANET[$resource[$RegID]] : $USER[$resource[$RegID]]); } } $TechTreeList[] = array('id' => $Element, 'name' => $ElementName, 'need' => $RequeriList); } } $template->assign_vars(array('TechTreeList' => $TechTreeList, 'tt_requirements' => $LNG['tt_requirements'], 'LNG' => $LNG['tech'], 'tt_lvl' => $LNG['tt_lvl'])); $template->show("techtree_overview.tpl"); }
function ShowRecordsPage() { global $USER, $PLANET, $LNG, $resource, $db, $CONF; require_once ROOT_PATH . "cache/CacheRecords.php"; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); foreach ($RecordsArray as $ElementID => $ElementIDArray) { if ($ElementID >= 1 && $ElementID <= 39 || $ElementID == 44) { $Builds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']); } elseif ($ElementID >= 41 && $ElementID <= 99 && $ElementID != 44) { $MoonsBuilds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']); } elseif ($ElementID >= 101 && $ElementID <= 199) { $Techno[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']); } elseif ($ElementID >= 201 && $ElementID <= 399) { $Fleet[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']); } elseif ($ElementID >= 401 && $ElementID <= 599) { $Defense[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']); } } $Records = array($LNG['rec_build'] => $Builds, $LNG['rec_specb'] => $MoonsBuilds, $LNG['rec_techn'] => $Techno, $LNG['rec_fleet'] => $Fleet, $LNG['rec_defes'] => $Defense); $template->assign_vars(array('Records' => $Records, 'update' => sprintf($LNG['rec_last_update_on'], date("d. M Y, H:i:s", $CONF['stat_last_update'])), 'level' => $LNG['rec_level'], 'player' => $LNG['rec_playe'])); $template->show("records_overview.tpl"); }
function ShowTeamspeakPage() { global $CONF, $LNG; if ($_POST) { if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') { $CONF['ts_modon'] = 1; } else { $CONF['ts_modon'] = 0; } $CONF['ts_server'] = request_var('ts_ip', ''); $CONF['ts_tcpport'] = request_var('ts_tcp', 0); $CONF['ts_udpport'] = request_var('ts_udp', 0); $CONF['ts_timeout'] = request_var('ts_to', 0); $CONF['ts_version'] = request_var('ts_v', 0); update_config('ts_timeout', $CONF['ts_timeout']); update_config('ts_modon', $CONF['ts_modon']); update_config('ts_server', $CONF['ts_server']); update_config('ts_tcpport', $CONF['ts_tcpport']); update_config('ts_udpport', $CONF['ts_udpport']); update_config('ts_version', $CONF['ts_version']); } $template = new template(); $template->page_header(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'])); $template->show('adm/TeamspeakPage.tpl'); }
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)) { $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;">' . $Message . '</span>'; SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0); $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1';"); exit($LNG['ma_message_sended']); } else { exit($LNG['ma_subject_needed']); } } $template = new template(); $template->page_header(); $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'); }
function ShowNewsPage() { global $LNG, $db, $USER; if ($_GET['action'] == 'send') { $edit_id = request_var('id', 0); $title = $db->sql_escape(request_var('title', '', true)); $text = $db->sql_escape(request_var('text', '', true)); $query = $_GET['mode'] == 2 ? "INSERT INTO " . NEWS . " (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $USER['username'] . "', '" . TIMESTAMP . "', '" . $title . "', '" . $text . "');" : "UPDATE " . NEWS . " SET `title` = '" . $title . "', `text` = '" . $text . "', `date` = '" . TIMESTAMP . "' WHERE `id` = '" . $edit_id . "' LIMIT 1;"; $db->query($query); } elseif ($_GET['action'] == 'delete' && isset($_GET['id'])) { $db->query("DELETE FROM " . NEWS . " WHERE `id` = '" . request_var('id', 0) . "';"); } $query = $db->query("SELECT * FROM " . NEWS . " ORDER BY id ASC"); while ($u = $db->fetch_array($query)) { $NewsList[] = array('id' => $u['id'], 'title' => $u['title'], 'date' => date("d.m.Y H:i:s", $u['date']), 'user' => $u['user'], 'confirm' => sprintf($LNG['nws_confirm'], $u['title'])); } $template = new template(); $template->page_header(); if ($_GET['action'] == 'edit' && isset($_GET['id'])) { $News = $db->uniquequery("SELECT id, title, text FROM " . NEWS . " WHERE id = '" . $db->sql_escape($_GET['id']) . "';"); $template->assign_vars(array('mode' => 1, 'nws_head' => sprintf($LNG['nws_head_edit'], $News['title']), 'news_id' => $News['id'], 'news_title' => $News['title'], 'news_text' => $News['text'])); } elseif ($_GET['action'] == 'create') { $template->assign_vars(array('mode' => 2, 'nws_head' => $LNG['nws_head_create'])); } $template->assign_vars(array('NewsList' => $NewsList, 'button_submit' => $LNG['button_submit'], 'nws_total' => sprintf($LNG['nws_total'], count($NewsList)), 'nws_news' => $LNG['nws_news'], 'nws_id' => $LNG['nws_id'], 'nws_title' => $LNG['nws_title'], 'nws_date' => $LNG['nws_date'], 'nws_from' => $LNG['nws_from'], 'nws_del' => $LNG['nws_del'], 'nws_create' => $LNG['nws_create'], 'nws_content' => $LNG['nws_content'])); $template->show('adm/NewsPage.tpl'); }
function ShowModVersionPage() { global $LNG, $USER; $MVC = array(); $Files = scandir(ROOT_PATH . 'includes/functions/mvc/'); foreach ($Files as $File) { if (substr($File, 0, 4) == 'mvc_') { require ROOT_PATH . 'includes/functions/mvc/' . $File; } } foreach ($MVC as &$Mod) { $Mod['description'] = $Mod['description'][$USER['lang']]; $Update = @simplexml_load_file($Mod['update']); $Update = $Update->{$Mod}['tag']; if (version_compare($Mod['version'], $Update->version, '<')) { $Mod['update'] = colorRed($LNG['mvc_update_yes']); $Mod['udetails'] = array('version' => $Update->version, 'date' => $Update->date, 'download' => $Update->download, 'announcement' => $Update->announcement); } else { $Mod['update'] = colorGreen($LNG['mvc_update_no']); $Mod['udetails'] = false; } } $template = new template(); $template->page_header(); $template->assign_vars(array('MVC' => $MVC, 'mvc_title' => $LNG['mvc_title'], 'mvc_author' => $LNG['mvc_author'], 'mvc_version' => $LNG['mvc_version'], 'mvc_link' => $LNG['mvc_link'], 'mvc_update_version' => $LNG['mvc_update_version'], 'mvc_update_date' => $LNG['mvc_update_date'], 'mvc_announcement' => $LNG['mvc_announcement'], 'mvc_download' => $LNG['mvc_download'], 'mvc_desc' => $LNG['mvc_desc'])); $template->show('adm/ModVersionPage.tpl'); }
function ShowMenuPage() { global $USER, $LNG; $template = new template(); $template->page_header(); $template->assign_vars(array('rights' => $USER['rights'], 'mu_game_info' => $LNG['mu_game_info'], 'mu_settings' => $LNG['mu_settings'], 'mu_ts_options' => $LNG['mu_ts_options'], 'mu_fb_options' => $LNG['mu_fb_options'], 'mu_module' => $LNG['mu_module'], 'mu_user_logs' => $LNG['mu_user_logs'], 'mu_optimize_db' => $LNG['mu_optimize_db'], 'mu_stats_options' => $LNG['mu_stats_options'], 'mu_chat' => $LNG['mu_chat'], 'mu_update' => $LNG['mu_update'], 'mu_general' => $LNG['mu_general'], 'new_creator_title' => $LNG['new_creator_title'], 'mu_add_delete_resources' => $LNG['mu_add_delete_resources'], 'mu_ban_options' => $LNG['mu_ban_options'], 'mu_users_settings' => $LNG['mu_users_settings'], 'mu_tools' => $LNG['mu_tools'], 'mu_manual_points_update' => $LNG['mu_manual_points_update'], 'mu_global_message' => $LNG['mu_global_message'], 'mu_md5_encripter' => $LNG['mu_md5_encripter'], 'mu_mpu_confirmation' => $LNG['mu_mpu_confirmation'], 'mu_observation' => $LNG['mu_observation'], 'mu_connected' => $LNG['mu_connected'], 'mu_support' => $LNG['mu_support'], 'mu_vaild_users' => $LNG['mu_vaild_users'], 'mu_active_planets' => $LNG['mu_active_planets'], 'mu_flying_fleets' => $LNG['mu_flying_fleets'], 'mu_news' => $LNG['mu_news'], 'mu_user_list' => $LNG['mu_user_list'], 'mu_planet_list' => $LNG['mu_planet_list'], 'mu_moon_list' => $LNG['mu_moon_list'], 'mu_mess_list' => $LNG['mu_mess_list'], 'mu_info_account_page' => $LNG['mu_info_account_page'], 'mu_search_page' => $LNG['mu_search_page'], 'mu_mod_update' => $LNG['mu_mod_update'], 'mu_clear_cache' => $LNG['mu_clear_cache'])); $template->show('adm/ShowMenuPage.tpl'); }
function ShowTopnavPage() { global $LNG, $USER; $template = new template(); $template->page_header(); $template->assign_vars(array('ad_authlevel_title' => $LNG['ad_authlevel_title'], 're_reset_universe' => $LNG['re_reset_universe'], 'mu_moderation_page' => $LNG['mu_moderation_page'], 'adm_cp_title' => $LNG['adm_cp_title'], 'adm_cp_index' => $LNG['adm_cp_index'], 'adm_cp_logout' => $LNG['adm_cp_logout'], 'sid' => session_id(), 'id' => $USER['id'], 'authlevel' => $USER['authlevel'])); $template->show('adm/ShowTopnavPage.tpl'); }
function ShowInformationPage() { global $db, $LNG; $template = new template(); $template->page_header(); $template->assign_vars(array('info_information' => $LNG['info_information'], 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => VERSION, 'vMySQLc' => $db->getVersion(), 'vMySQLs' => $db->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Ja' : 'Nein', 'browser' => $_SERVER['HTTP_USER_AGENT'])); $template->show('adm/ShowInformationPage.tpl'); }
function ShowPassEncripterPage() { global $LNG; $Password = request_var('md5q', '', true); $template = new template(); $template->page_header(); $template->assign_vars(array('md5_md5' => $Password, 'md5_enc' => md5($Password), 'et_md5_encripter' => $LNG['et_md5_encripter'], 'et_encript' => $LNG['et_encript'], 'et_result' => $LNG['et_result'], 'et_pass' => $LNG['et_pass'])); $template->show('adm/PassEncripterPage.tpl'); }
function ShowFleetShortcuts() { global $USER, $LNG, $db; $a = request_var('a', ''); $mode = request_var('mode', ''); $template = new template(); $template->page_header(); $template->page_footer(); if ($mode == "add") { if ($_POST) { $name = request_var('n', $LNG['fl_anonymous']); $gala = request_var('g', 0); $sys = request_var('s', 0); $plan = request_var('p', 0); $type = request_var('t', 0); $USER['fleet_shortcut'] .= $name . ',' . $gala . ',' . $sys . ',' . $plan . ',' . $type . "\r\n"; $db->query("UPDATE " . USERS . " SET `fleet_shortcut` = '" . $USER['fleet_shortcut'] . "' WHERE `id` = '" . $USER['id'] . "';"); redirectTo("game." . PHP_EXT . "?page=shortcuts"); } $template->assign_vars(array('fl_shortcut_add_title' => $LNG['fl_shortcut_add_title'], 'fl_clean' => $LNG['fl_clean'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_back' => $LNG['fl_back'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon']))); $template->show("fleet_shortcuts_add.tpl"); } elseif (is_numeric($a)) { $scarray = explode("\r\n", $USER['fleet_shortcut']); $r = explode(",", $scarray[$a]); if ($_POST) { if ($_POST['delete']) { unset($scarray[$a]); } else { $r[0] = request_var('n', ''); $r[1] = request_var('g', 0); $r[2] = request_var('s', 0); $r[3] = request_var('p', 0); $r[4] = request_var('t', 0); $scarray[$a] = implode(",", $r); } $USER['fleet_shortcut'] = implode("\r\n", $scarray); $db->query("UPDATE " . USERS . " SET fleet_shortcut='" . $USER['fleet_shortcut'] . "' WHERE id=" . $USER['id'] . ";"); exit(redirectTo("game." . PHP_EXT . "?page=shortcuts")); } if (empty($USER['fleet_shortcut'])) { redirectTo("game." . PHP_EXT . "?page=shortcuts"); } $template->assign_vars(array('fl_back' => $LNG['fl_back'], 'fl_shortcut_edition' => $LNG['fl_shortcut_edition'], 'fl_reset_shortcut' => $LNG['fl_reset_shortcut'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_dlte_shortcut' => $LNG['fl_dlte_shortcut'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon']), 'name' => $r[0], 'galaxy' => $r[1], 'system' => $r[2], 'planet' => $r[3], 'type' => $r[4], 'id' => $a)); $template->show("fleet_shortcuts_edit.tpl"); } else { $scarray = explode("\r\n", $USER['fleet_shortcut']); foreach ($scarray as $b) { if (empty($b)) { continue; } $c = explode(',', $b); $ShortCuts[] = array('name' => $c[0], 'galaxy' => $c[1], 'system' => $c[2], 'planet' => $c[3], 'type' => $c[4]); } $template->assign_vars(array('ShortCuts' => $ShortCuts, 'fl_back' => $LNG['fl_back'], 'fl_planet_shortcut' => $LNG['fl_planet_shortcut'], 'fl_moon_shortcut' => $LNG['fl_moon_shortcut'], 'fl_debris_shortcut' => $LNG['fl_debris_shortcut'], 'fl_no_shortcuts' => $LNG['fl_no_shortcuts'], 'fl_shortcuts' => $LNG['fl_shortcuts'], 'fl_shortcut_add' => $LNG['fl_shortcut_add'])); $template->show("fleet_shortcuts.tpl"); } }
function ShowLogoutPage() { global $LNG, $SESSION; $SESSION->DestroySession(); $template = new template(); $template->page_header(); $template->page_footer(); $template->assign_vars(array('lo_title' => $LNG['lo_title'], 'lo_logout' => $LNG['lo_logout'], 'lo_redirect' => $LNG['lo_redirect'], 'lo_notify' => $LNG['lo_notify'], 'lo_continue' => $LNG['lo_continue'])); $template->show("logout_overview.tpl"); }
public function __construct() { global $USER, $PLANET, $dpath, $resource, $LNG, $db, $reslist; $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $template->loadscript('galaxy.js'); $maxfleet = $db->num_rows($db->query("SELECT fleet_id FROM " . FLEETS . " WHERE `fleet_owner` = '" . $USER['id'] . "' AND `fleet_mission` != 10;")); $mode = request_var('mode', 0); $galaxyLeft = request_var('galaxyLeft', ''); $galaxyRight = request_var('galaxyRight', ''); $systemLeft = request_var('systemLeft', ''); $systemRight = request_var('systemRight', ''); $galaxy = min(max(abs(request_var('galaxy', $PLANET['galaxy'])), 1), MAX_GALAXY_IN_WORLD); $system = min(max(abs(request_var('system', $PLANET['system'])), 1), MAX_SYSTEM_IN_GALAXY); $planet = min(max(abs(request_var('planet', $PLANET['planet'])), 1), MAX_PLANET_IN_SYSTEM); $current = request_var('current', 0); if ($mode == 1) { if (!empty($galaxyLeft)) { $galaxy = max($galaxy - 1, 1); } elseif (!empty($galaxyRight)) { $galaxy = min($galaxy + 1, MAX_GALAXY_IN_WORLD); } if (!empty($systemLeft)) { $system = max($system - 1, 1); } elseif (!empty($systemRight)) { $system = min($system + 1, MAX_SYSTEM_IN_GALAXY); } } if (!($galaxy == $PLANET['galaxy'] && $system == $PLANET['system']) && $mode != 0) { if ($PLANET['deuterium'] < 10) { $template->message($LNG['gl_no_deuterium_to_view_galaxy'], "game.php?page=galaxy&mode=0", 2); exit; } else { $PLANET['deuterium'] -= 10; } } $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); unset($reslist['defense'][array_search(502, $reslist['defense'])]); $MissleSelector[0] = $LNG['gl_all_defenses']; foreach ($reslist['defense'] as $Element) { $MissleSelector[$Element] = $LNG['tech'][$Element]; } $Result = $this->ShowGalaxyRows($galaxy, $system); $template->assign_vars(array('GalaxyRows' => $Result['Result'], 'planetcount' => sprintf($LNG['gl_populed_planets'], $Result['planetcount']), 'mode' => $mode, 'galaxy' => $galaxy, 'system' => $system, 'planet' => $planet, 'current' => $current, 'currentmip' => pretty_number($PLANET[$resource[503]]), 'maxfleetcount' => $maxfleet, 'fleetmax' => $USER['computer_tech'] + 1 + $USER['rpg_commandant'] * COMMANDANT, 'grecyclers' => pretty_number($PLANET[$resource[219]]), 'recyclers' => pretty_number($PLANET[$resource[209]]), 'spyprobes' => pretty_number($PLANET[$resource[210]]), 'missile_count' => sprintf($LNG['gl_missil_to_launch'], $PLANET[$resource[503]]), 'spio_anz' => $USER['spio_anz'], 'settings_fleetactions' => $USER['settings_fleetactions'], 'current_galaxy' => $PLANET['galaxy'], 'current_system' => $PLANET['system'], 'current_planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type'], 'MissleSelector' => $MissleSelector, 'gl_solar_system' => $LNG['gl_solar_system'], 'gl_galaxy' => $LNG['gl_galaxy'], 'gl_missil_launch_action' => $LNG['gl_missil_launch_action'], 'gl_objective' => $LNG['gl_objective'], 'gl_missil_launch' => $LNG['gl_missil_launch'], 'gl_pos' => $LNG['gl_pos'], 'gl_planet' => $LNG['gl_planet'], 'gl_alliance' => $LNG['gl_alliance'], 'gl_actions' => $LNG['gl_actions'], 'gl_name_activity' => $LNG['gl_name_activity'], 'gl_player_estate' => $LNG['gl_player_estate'], 'gl_debris' => $LNG['gl_debris'], 'gl_moon' => $LNG['gl_moon'], 'gl_show' => $LNG['gl_show'], 'gl_out_space' => $LNG['gl_out_space'], 'gl_legend' => $LNG['gl_legend'], 'gl_strong_player' => $LNG['gl_strong_player'], 'gl_s' => $LNG['gl_s'], 'gl_week_player' => $LNG['gl_week_player'], 'gl_w' => $LNG['gl_w'], 'gl_vacation' => $LNG['gl_vacation'], 'gl_v' => $LNG['gl_v'], 'gl_banned' => $LNG['gl_banned'], 'gl_b' => $LNG['gl_b'], 'gl_inactive_seven' => $LNG['gl_inactive_seven'], 'gl_i' => $LNG['gl_i'], 'gl_inactive_twentyeight' => $LNG['gl_inactive_twentyeight'], 'gl_I' => $LNG['gl_I'], 'gl_avaible_grecyclers' => $LNG['gl_avaible_grecyclers'], 'gl_avaible_recyclers' => $LNG['gl_avaible_recyclers'], 'gl_avaible_spyprobes' => $LNG['gl_avaible_spyprobes'], 'gl_fleets' => $LNG['gl_fleets'], 'gl_avaible_missiles' => $LNG['gl_avaible_missiles'], 'gl_moon' => $LNG['gl_moon'], 'gl_diameter' => $LNG['gl_diameter'], 'gl_features' => $LNG['gl_features'], 'gl_temperature' => $LNG['gl_temperature'], 'gl_actions' => $LNG['gl_actions'], 'gl_debris_field' => $LNG['gl_debris_field'], 'gl_resources' => $LNG['gl_resources'], 'gl_collect' => $LNG['gl_collect'], 'gl_with' => $LNG['gl_with'], 'gl_alliance_page' => $LNG['gl_alliance_page'], 'gl_see_on_stats' => $LNG['gl_see_on_stats'], 'gl_alliance_web_page' => $LNG['gl_alliance_web_page'], 'gl_spy' => $LNG['gl_spy'], 'gl_buddy_request' => $LNG['gl_buddy_request'], 'gl_missile_attack' => $LNG['gl_missile_attack'], 'gl_player' => $LNG['gl_player'], 'gl_playercard' => $LNG['gl_playercard'], 'gl_phalanx' => $LNG['gl_phalanx'], 'gl_points' => $LNG['gl_points'], 'gl_ajax_status_ok' => $LNG['gl_ajax_status_ok'], 'gl_ajax_status_fail' => $LNG['gl_ajax_status_fail'], 'write_message' => $LNG['write_message'])); $template->show('galaxy_overview.tpl'); }
function ShowFlyingFleetPage() { global $LNG, $db; $id = request_var('id', 0); if (!empty($id)) { $db->query("UPDATE " . FLEETS . " SET `fleet_busy` = '" . request_var('lock', 0) . "' WHERE `fleet_id` = '" . $id . "';"); } $FlyingFleetsTable = new FlyingFleetsTable(); $template = new template(); $template->page_header(); $template->assign_vars(array('FleetList' => $FlyingFleetsTable->BuildFlyingFleetTable(), 'ff_id' => $LNG['ff_id'], 'ff_ammount' => $LNG['ff_ammount'], 'ff_mission' => $LNG['ff_mission'], 'ff_beginning' => $LNG['ff_beginning'], 'ff_departure' => $LNG['ff_departure'], 'ff_departure_hour' => $LNG['ff_departure_hour'], 'ff_objective' => $LNG['ff_objective'], 'ff_arrival' => $LNG['ff_arrival'], 'ff_arrival_hour' => $LNG['ff_arrival_hour'], 'ff_hold_position' => $LNG['ff_hold_position'], 'ff_lock' => $LNG['ff_lock'], 'ff_no_fleets' => $LNG['ff_no_fleets'])); $template->show('adm/FlyingFleetPage.tpl'); }
private function ShowIndexPage() { global $LNG, $db, $USER; $template = new template(); $template->page_header(); $template->page_footer(); $NotesRAW = $db->query("SELECT * FROM " . NOTES . " WHERE owner = " . $USER['id'] . " ORDER BY time DESC;"); while ($Note = $db->fetch_array($NotesRAW)) { $NoteList[] = array('id' => $Note['id'], 'time' => date("d. M y H:i:s", $Note['time']), 'title' => $Note['title'], 'size' => strlen($Note['text']), 'priority' => $Note['priority']); } $template->assign_vars(array('NoteList' => $NoteList, 'nt_priority' => $LNG['nt_you_dont_have_notes'], 'nt_size_note' => $LNG['nt_size_note'], 'nt_date_note' => $LNG['nt_date_note'], 'nt_notes' => $LNG['nt_notes'], 'nt_create_new_note' => $LNG['nt_create_new_note'], 'nt_subject_note' => $LNG['nt_subject_note'], 'nt_dlte_note' => $LNG['nt_dlte_note'], 'nt_you_dont_have_notes' => $LNG['nt_you_dont_have_notes'])); $template->show('notes_body.tpl'); }
function ShowQuickEditorPage() { global $LNG, $db, $reslist, $resource; $action = request_var('action', ''); $edit = request_var('edit', ''); $id = request_var('id', 0); switch ($edit) { case 'planet': $DataIDs = array_merge($reslist['fleet'], $reslist['build'], $reslist['defense']); foreach ($DataIDs as $ID) { $SpecifyItemsPQ .= "`" . $resource[$ID] . "`,"; } $PlanetData = $db->uniquequery("SELECT " . $SpecifyItemsPQ . " `name`, `id_owner`, `planet_type`, `galaxy`, `system`, `planet`, `destruyed`, `diameter`, `field_current`, `field_current`, `field_max`, `temp_min`, `temp_max`, `metal`, `crystal`, `deuterium` FROM " . PLANETS . " WHERE `id` = '" . $id . "';"); $reslist['build'] = $reslist['allow'][$PlanetData['planet_type']]; if ($action == 'send') { $QryUpdateString = "UPDATE " . PLANETS . " SET "; foreach ($DataIDs as $ID) { $QryUpdateString .= "`" . $resource[$ID] . "` = '" . floattostring(round(abs(request_var($resource[$ID], 0.0)), 0)) . "', "; } $QryUpdateString .= "`metal` = '" . floattostring(round(abs(request_var('metal', 0.0)), 0)) . "', "; $QryUpdateString .= "`crystal` = '" . floattostring(round(abs(request_var('crystal', 0.0)), 0)) . "', "; $QryUpdateString .= "`deuterium` = '" . floattostring(round(abs(request_var('deuterium', 0.0)), 0)) . "', "; $QryUpdateString .= "`field_max` = '" . request_var('field_max', 0) . "', "; $QryUpdateString .= "`name` = '" . $db->sql_escape(request_var('name', '')) . "' "; $QryUpdateString .= "WHERE `id` = '" . $id . "' LIMIT 1;"; $db->query($QryUpdateString); exit(sprintf($LNG['qe_edit_sucess'], $PlanetData['name'], $PlanetData['galaxy'], $PlanetData['system'], $PlanetData['planet'])); } $UserInfo = $db->uniquequery("SELECT `username` FROM " . USERS . " WHERE `id` = '" . $PlanetData['id_owner'] . "'"); $build = $defense = $fleet = array(); foreach ($reslist['build'] as $ID) { $build[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]); } foreach ($reslist['fleet'] as $ID) { $fleet[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]); } foreach ($reslist['defense'] as $ID) { $defense[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]); } $template = new template(); $template->page_header(); $template->assign_vars(array('qe_resources' => $LNG['qe_resources'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'qe_defensive' => $LNG['qe_defensive'], 'qe_fleet' => $LNG['qe_fleet'], 'qe_build' => $LNG['qe_build'], 'qe_input' => $LNG['qe_input'], 'qe_count' => $LNG['qe_count'], 'qe_name' => $LNG['qe_name'], 'qe_reset' => $LNG['qe_reset'], 'qe_send' => $LNG['qe_send'], 'qe_temp' => $LNG['qe_temp'], 'qe_fields' => $LNG['qe_fields'], 'qe_owner' => $LNG['qe_owner'], 'qe_coords' => $LNG['qe_coords'], 'qe_id' => $LNG['qe_id'], 'qe_info' => $LNG['qe_info'], 'build' => $build, 'fleet' => $fleet, 'defense' => $defense, 'id' => $id, 'ownerid' => $PlanetData['id_owner'], 'ownername' => $UserInfo['username'], 'name' => $PlanetData['name'], 'galaxy' => $PlanetData['galaxy'], 'system' => $PlanetData['system'], 'planet' => $PlanetData['planet'], 'field_min' => $PlanetData['field_current'], 'field_max' => $PlanetData['field_max'], 'temp_min' => $PlanetData['temp_min'], 'temp_max' => $PlanetData['temp_max'], 'metal' => floattostring($PlanetData['metal']), 'crystal' => floattostring($PlanetData['crystal']), 'deuterium' => floattostring($PlanetData['deuterium']), 'metal_c' => pretty_number($PlanetData['metal']), 'crystal_c' => pretty_number($PlanetData['crystal']), 'deuterium_c' => pretty_number($PlanetData['deuterium']))); $template->show('adm/QuickEditorPlanet.tpl'); break; case 'player': break; } }
function ShowSearchPage() { global $USER, $PLANET, $dpath, $LNG, $db; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $type = request_var('type', ''); $searchtext = request_var('searchtext', ''); switch ($type) { case 'playername': $search = $db->query("SELECT a.id, a.username, a.ally_id, a.ally_name, a.galaxy, a.system, a.planet, b.name, c.total_rank FROM " . USERS . " as a LEFT JOIN " . PLANETS . " as b ON b.id = a.id_planet LEFT JOIN " . STATPOINTS . " as c ON c.stat_type = 1 AND c.id_owner = a.id WHERE a.username LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;"); while ($s = $db->fetch_array($search)) { $SearchResult[] = array('planetname' => $s['name'], 'username' => $s['username'], 'userid' => $s['id'], 'allyname' => $s['ally_name'], 'allyid' => $s['ally_id'], 'galaxy' => $s['galaxy'], 'system' => $s['system'], 'planet' => $s['planet'], 'rank' => $s['total_rank']); } $db->free_result($search); break; case 'planetname': $search = $db->query("SELECT a.name, a.galaxy, a.planet, a.system, b.ally_name, b.id, b.ally_id, b.username, c.total_rank FROM " . PLANETS . " as a LEFT JOIN " . USERS . " as b ON b.id = a.id_owner LEFT JOIN " . STATPOINTS . " as c ON c.stat_type = 1 AND c.id_owner = b.id WHERE a.name LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;"); while ($s = $db->fetch_array($search)) { $SearchResult[] = array('planetname' => $s['name'], 'username' => $s['username'], 'userid' => $s['id'], 'allyname' => $s['ally_name'], 'allyid' => $s['ally_id'], 'galaxy' => $s['galaxy'], 'system' => $s['system'], 'planet' => $s['planet'], 'rank' => $s['total_rank']); } $db->free_result($search); break; case "allytag": $search = $db->query("SELECT a.ally_name, a.ally_tag, a.ally_members, b.total_points FROM " . ALLIANCE . " as a, " . STATPOINTS . " as b WHERE b.stat_type = 1 AND b.id_owner = a.id AND a.ally_tag LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;"); while ($s = $db->fetch_array($search)) { $SearchResult[] = array('allypoints' => pretty_number($s['total_points']), 'allytag' => $s['ally_tag'], 'allymembers' => $s['ally_members'], 'allyname' => $s['ally_name']); } $db->free_result($search); break; case "allyname": $search = $db->query("SELECT a.ally_name, a.ally_tag, a.ally_members, b.total_points FROM " . ALLIANCE . " as a, " . STATPOINTS . " as b WHERE b.stat_type = 1 AND b.id_owner = a.id AND a.ally_name LIKE '%" . $db->sql_escape($searchtext, true) . "%' LIMIT 25;"); while ($s = $db->fetch_array($search)) { $SearchResult[] = array('allypoints' => pretty_number($s['total_points']), 'allytag' => $s['ally_tag'], 'allymembers' => $s['ally_members'], 'allyname' => $s['ally_name']); } $db->free_result($search); break; } $SeachTypes = array("playername" => $LNG['sh_player_name'], "planetname" => $LNG['sh_planet_name'], "allytag" => $LNG['sh_alliance_tag'], "allyname" => $LNG['sh_alliance_name']); $template->assign_vars(array('SearchResult' => $SearchResult, 'SeachTypes' => $SeachTypes, 'SeachInput' => $searchtext, 'SeachType' => $type, 'sh_search' => $LNG['sh_search'], 'sh_search_in_the_universe' => $LNG['sh_search_in_the_universe'], 'sh_buddy_request' => $LNG['sh_buddy_request'], 'sh_write_message' => $LNG['sh_write_message'], 'sh_name' => $LNG['sh_name'], 'sh_alliance' => $LNG['sh_alliance'], 'sh_planet' => $LNG['sh_planet'], 'sh_coords' => $LNG['sh_coords'], 'sh_position' => $LNG['sh_position'], 'sh_tag' => $LNG['sh_tag'], 'sh_members' => $LNG['sh_members'], 'sh_points' => $LNG['sh_points'])); $template->show("search_body.tpl"); }
function ShowModulePage() { global $CONF, $LNG; if ($_GET['mode']) { $CONF['moduls'][request_var('id', 0)] = $_GET['mode'] == 'aktiv' ? 1 : 0; update_config('moduls', implode(";", $CONF['moduls'])); $CONF['moduls'] = explode(";", $CONF['moduls']); } foreach ($LNG['modul'] as $ID => $Name) { $Modules[$ID] = array('name' => $Name, 'state' => $CONF['moduls'][$ID]); } $template = new template(); $template->page_header(); $template->assign_vars(array('Modules' => $Modules, 'mod_module' => $LNG['mod_module'], 'mod_info' => $LNG['mod_info'], 'mod_active' => $LNG['mod_active'], 'mod_deactive' => $LNG['mod_deactive'], 'mod_change_active' => $LNG['mod_change_active'], 'mod_change_deactive' => $LNG['mod_change_deactive'])); $template->show('adm/ModulePage.tpl'); }
function ShowChangelogPage() { global $USER, $PLANET, $LNG; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); includeLang('CHANGELOG'); $template->assign_vars(array('ChangelogList' => array_map('makebr', $LNG['changelog']), 'Version' => $LNG['Version'], 'Description' => $LNG['Description'])); $template->show("changelog_overview.tpl"); }
function ShowFAQPage() { global $USER, $PLANET, $LNG; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); includeLang('FAQ'); $template->assign_vars(array('FAQList' => $LNG['faq'], 'faq_overview' => $LNG['faq_overview'])); $template->show("faq_overview.tpl"); }
function ShowActivePage() { global $LNG, $db, $USER; $id = request_var('id', 0); if ($_GET['action'] == 'delete' && !empty($id)) { $db->query("DELETE FROM " . USERS_VALID . " WHERE `id` = '" . $id . "';"); } $query = $db->query("SELECT * FROM " . USERS_VALID . " ORDER BY id ASC"); $Users = array(); while ($User = $db->fetch_array($query)) { $Users[] = array('id' => $User['id'], 'name' => $User['username'], 'date' => date("d.m.Y H:i:s", $User['date']), 'email' => $User['email'], 'ip' => $User['ip'], 'password' => $User['password'], 'cle' => $User['cle']); } $template = new template(); $template->page_header(); $template->assign_vars(array('Users' => $Users, 'UserLang' => $USER['lang'])); $template->show('adm/ActivePage.tpl'); }
function ShowImperiumPage() { global $LNG, $USER, $PLANET, $resource, $reslist, $db; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->loadscript("trader.js"); $template->page_topnav(); $template->page_header(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $SQLArray = array_merge($reslist['build'], $reslist['fleet'], $reslist['defense']); $Query = ""; foreach ($SQLArray as $id => $gid) { $Query .= ",`" . $resource[$gid] . "`"; } if ($USER['planet_sort'] == 0) { $Order = "`id` "; } elseif ($USER['planet_sort'] == 1) { $Order = "`galaxy`, `system`, `planet`, `planet_type` "; } elseif ($USER['planet_sort'] == 2) { $Order = "`name` "; } $Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC"; $PlanetsRAW = $db->query("\r\n\tSELECT `id`,`name`,`galaxy`,`system`,`planet`,`planet_type`,\r\n\t`image`,`field_current`,`field_max`,`metal`,`crystal`,`deuterium`,\r\n\t`energy_used`,`energy_max` " . $Query . " FROM " . PLANETS . " WHERE `id_owner` = '" . $USER['id'] . "' AND `destruyed` = '0' ORDER BY " . $Order . ";"); while ($Planet = $db->fetch_array($PlanetsRAW)) { $InfoList = array('id' => $Planet['id'], 'name' => $Planet['name'], 'image' => $Planet['image'], 'galaxy' => $Planet['galaxy'], 'system' => $Planet['system'], 'planet' => $Planet['planet'], 'field_current' => $Planet['field_current'], 'field_max' => CalculateMaxPlanetFields($Planet), 'metal' => pretty_number($Planet['metal']), 'crystal' => pretty_number($Planet['crystal']), 'deuterium' => pretty_number($Planet['deuterium']), 'energy_used' => pretty_number($Planet['energy_max'] + $Planet['energy_used']), 'energy_max' => pretty_number($Planet['energy_max'])); foreach ($reslist['build'] as $gid) { $BuildsList[$gid] = pretty_number($Planet[$resource[$gid]]); } foreach ($reslist['fleet'] as $gid) { $FleetsList[$gid] = pretty_number($Planet[$resource[$gid]]); } foreach ($reslist['defense'] as $gid) { $DefensesList[$gid] = pretty_number($Planet[$resource[$gid]]); } $PlanetsList[] = array('InfoList' => $InfoList, 'BuildsList' => $BuildsList, 'FleetsList' => $FleetsList, 'DefensesList' => $DefensesList); } foreach ($reslist['tech'] as $gid) { $ResearchList[$gid] = pretty_number($USER[$resource[$gid]]); } $template->assign_vars(array('colspan' => count($PlanetsList) + 1, 'PlanetsList' => $PlanetsList, 'ResearchList' => $ResearchList, 'iv_imperium_title' => $LNG['iv_imperium_title'], 'iv_planet' => $LNG['iv_planet'], 'iv_name' => $LNG['iv_name'], 'iv_coords' => $LNG['iv_coords'], 'iv_fields' => $LNG['iv_fields'], 'iv_resources' => $LNG['iv_resources'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Energy' => $LNG['Energy'], 'iv_buildings' => $LNG['iv_buildings'], 'iv_technology' => $LNG['iv_technology'], 'iv_ships' => $LNG['iv_ships'], 'iv_defenses' => $LNG['iv_defenses'], 'tech' => $LNG['tech'], 'build' => $reslist['build'], 'fleet' => $reslist['fleet'], 'defense' => $reslist['defense'], 'research' => $reslist['tech'])); $template->show("empire_overview.tpl"); }
public function __construct() { global $USER, $PLANET, $resource, $reslist, $LNG, $db, $ExtraDM; $action = request_var('action', ''); $Offi = request_var('offi', 0); $Extra = request_var('extra', 0); $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); if ($action == "send" && $USER['urlaubs_modus'] == 0) { if (!empty($Offi) && !CheckModule(8)) { $this->UpdateOfficier($Offi); } elseif (!empty($Extra) && !CheckModule(18)) { $this->UpdateExtra($Extra); } } $PlanetRess->SavePlanetToDB(); $template = new template(); $template->loadscript('officier.js'); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); if (!CheckModule(8)) { foreach ($reslist['dmfunc'] as $Element) { if ($USER[$resource[$Element]] > TIMESTAMP) { $template->execscript("GetOfficerTime(" . $Element . ", " . ($USER[$resource[$Element]] - TIMESTAMP) . ");"); } $ExtraDMList[] = array('id' => $Element, 'active' => $USER[$resource[$Element]] - TIMESTAMP, 'price' => pretty_number($ExtraDM[$Element]['darkmatter']), 'isok' => $USER['darkmatter'] - $ExtraDM[$Element]['darkmatter'] >= 0 ? true : false, 'time' => pretty_time($ExtraDM[$Element]['time'] * 3600), 'name' => $LNG['tech'][$Element], 'desc' => sprintf($LNG['res']['descriptions'][$Element], $ExtraDM[$Element]['add'] * 100)); } } if (!CheckModule(18)) { foreach ($reslist['officier'] as $Element) { if (($Result = $this->IsOfficierAccessible($Element)) === 0) { continue; } $OfficierList[] = array('id' => $Element, 'level' => $USER[$resource[$Element]], 'name' => $LNG['tech'][$Element], 'desc' => $LNG['res']['descriptions'][$Element], 'Result' => $Result); } } $template->assign_vars(array('ExtraDMList' => $ExtraDMList, 'OfficierList' => $OfficierList, 'user_darkmatter' => floor($USER['darkmatter'] / DM_PRO_OFFICIER_LEVEL), 'of_max_lvl' => $LNG['of_max_lvl'], 'of_recruit' => $LNG['of_recruit'], 'of_darkmatter' => sprintf($LNG['of_points_per_thousand_darkmatter'], DM_PRO_OFFICIER_LEVEL, $LNG['Darkmatter']), 'of_available_points' => $LNG['of_available_points'], 'alv_points' => $LNG['alv_points'], 'of_lvl' => $LNG['of_lvl'], 'in_dest_durati' => $LNG['in_dest_durati'], 'of_still' => $LNG['of_still'], 'of_active' => $LNG['of_active'], 'of_update' => $LNG['of_update'], 'in_dest_durati' => $LNG['in_dest_durati'], 'of_dm_trade' => sprintf($LNG['of_dm_trade'], $LNG['Darkmatter']))); $template->show("officier_overview.tpl"); }
function ShowFacebookPage() { global $CONF, $LNG; if ($_POST) { if (isset($_POST['fb_on']) && $_POST['fb_on'] == 'on' && !empty($_POST['fb_skey']) && !empty($_POST['fb_apikey'])) { $CONF['fb_on'] = 1; } else { $CONF['fb_on'] = 0; } $CONF['fb_apikey'] = request_var('fb_apikey', ''); $CONF['fb_skey'] = request_var('fb_skey', ''); update_config('fb_on', $CONF['fb_on']); update_config('fb_apikey', $CONF['fb_apikey']); update_config('fb_skey', $CONF['fb_skey']); } $template = new template(); $template->page_header(); $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'fb_info' => $LNG['fb_info'], 'fb_secrectkey' => $LNG['fb_secrectkey'], 'fb_api_key' => $LNG['fb_api_key'], 'fb_active' => $LNG['fb_active'], 'fb_settings' => $LNG['fb_settings'], 'fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey'])); $template->show('adm/FacebookPage.tpl'); }
function ShowOverviewPage() { global $LNG, $USER; $Message = array(); if ($USER['authlevel'] >= AUTH_ADM) { if (is_writable(ROOT_PATH . 'config.php')) { $Message[] = $LNG['ow_config_file_writable']; } if ($CONF['stats_fly_lock'] != 0) { $Message[] = sprintf($LNG['ow_handler_errors'], date("d. M y H:i:s", $CONF['stats_fly_lock']), date("d. M y H:i:s", $CONF['stats_fly_lock'] + 5 * 60)); } if ($CONF['user_valid'] == 1 && (empty($CONF['smtp_host']) || empty($CONF['smtp_port']) || empty($CONF['smtp_user']) || empty($CONF['smtp_pass']))) { $Message[] = $LNG['ow_smtp_errors']; } } $template = new template(); $template->page_header(); $template->assign_vars(array('ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP))); $template->show('adm/OverviewBody.tpl'); }
function ShowBannedPage() { global $USER, $PLANET, $LNG, $db; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template = new template(); $template->page_header(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); $template->page_footer(); $query = $db->query("SELECT * FROM " . BANNED . " ORDER BY `id`;"); while ($u = $db->fetch_array($query)) { $PrangerList[] = array('player' => $u['who'], 'theme' => $u['theme'], 'from' => date("d. M Y H:i:s", $u['time']), 'to' => date("d. M Y H:i:s", $u['longer']), 'admin' => $u['author'], 'mail' => $u['email'], 'info' => sprintf($LNG['bn_writemail'], $u['author'])); } $db->free_result($query); $template->assign_vars(array('PrangerList' => $PrangerList, 'bn_no_players_banned' => $LNG['bn_no_players_banned'], 'bn_exists' => $LNG['bn_exists'], 'bn_players_banned' => $LNG['bn_players_banned'], 'bn_players_banned_list' => $LNG['bn_players_banned_list'], 'bn_player' => $LNG['bn_player'], 'bn_reason' => $LNG['bn_reason'], 'bn_from' => $LNG['bn_from'], 'bn_until' => $LNG['bn_until'], 'bn_by' => $LNG['bn_by'])); $template->show("banned_overview.tpl"); }
function ShowStatsPage() { global $LNG, $CONF; if ($_POST) { $CONF['stat_settings'] = request_var('stat_settings', 0); $CONF['stat'] = request_var('stat', 0); $CONF['stat_update_time'] = request_var('stat_update_time', 0); $CONF['stat_banner_update_time'] = request_var('stat_banner_update_time', 0); $CONF['stat_level'] = request_var('stat_level', 0); update_config('stat_settings', $CONF['stat_settings']); update_config('stat', $CONF['stat']); update_config('stat_update_time', $CONF['stat_update_time']); update_config('stat_banner_update_time', $CONF['stat_banner_update_time']); update_config('stat_level', $CONF['stat_level']); } $template = new template(); $template->page_header(); $template->assign_vars(array('stat_level' => $CONF['stat_level'], 'stat_update_time' => $CONF['stat_update_time'], 'stat_banner_update_time' => $CONF['stat_banner_update_time'], 'stat' => $CONF['stat'], 'stat_settings' => $CONF['stat_settings'], 'timeact' => date('d. M y H:i:s T', $CONF['stat_last_update']), 'banneract' => date('d. M y H:i:s T', $CONF['stat_last_banner_update']), 'cs_timeact_1' => $LNG['cs_timeact_1'], 'cs_access_lvl' => $LNG['cs_access_lvl'], 'cs_points_to_zero' => $LNG['cs_points_to_zero'], 'cs_time_between_updates' => $LNG['cs_time_between_updates'], 'cs_point_per_resources_used' => $LNG['cs_point_per_resources_used'], 'cs_title' => $LNG['cs_title'], 'cs_banner_time_between_updates' => $LNG['cs_banner_time_between_updates'], 'cs_banner_title' => $LNG['cs_banner_title'], 'cs_resources' => $LNG['cs_resources'], 'cs_minutes' => $LNG['cs_minutes'], 'cs_save_changes' => $LNG['cs_save_changes'], 'Selector' => array(1 => $LNG['cs_yes'], 2 => $LNG['cs_no_view'], 0 => $LNG['cs_no']))); $template->show('adm/StatsPage.tpl'); }
function ShowPlayerCard() { global $USER, $PLANET, $LNG, $db; $template = new template(); $template->page_header(); $template->page_footer(); $playerid = request_var('id', 0); $query = $db->uniquequery("SELECT a.wons, a.loos, a.draws, a.kbmetal, a.kbcrystal, a.lostunits, a.desunits, a.ally_id, a.ally_name, a.username, a.galaxy, a.system, a.planet, b.name, c.tech_rank, c.tech_points, c.build_rank, c.build_points, c.defs_rank, c.defs_points, c.fleet_rank, c.fleet_points, c.total_rank, c.total_points FROM " . USERS . " as a, " . PLANETS . " as b, " . STATPOINTS . " as c WHERE a.id = '" . $db->sql_escape($playerid) . "' AND a.id_planet = b.id AND a.id = c.id_owner AND c.stat_type = 1;"); $totalfights = $query['wons'] + $query['loos'] + $query['draws']; if ($totalfights == 0) { $siegprozent = 0; $loosprozent = 0; $drawsprozent = 0; } else { $siegprozent = 100 / $totalfights * $query['wons']; $loosprozent = 100 / $totalfights * $query['loos']; $drawsprozent = 100 / $totalfights * $query['draws']; } $template->assign_vars(array('id' => $playerid, 'name' => $query['username'], 'homeplanet' => $query['name'], 'galaxy' => $query['galaxy'], 'system' => $query['system'], 'planet' => $query['planet'], 'allyid' => $query['ally_id'], 'tech_rank' => pretty_number($query['tech_rank']), 'tech_points' => pretty_number($query['tech_points']), 'build_rank' => pretty_number($query['build_rank']), 'build_points' => pretty_number($query['build_points']), 'defs_rank' => pretty_number($query['defs_rank']), 'defs_points' => pretty_number($query['defs_points']), 'fleet_rank' => pretty_number($query['fleet_rank']), 'fleet_points' => pretty_number($query['fleet_points']), 'total_rank' => pretty_number($query['total_rank']), 'total_points' => pretty_number($query['total_points']), 'allyname' => $query['ally_name'], 'playerdestory' => sprintf($LNG['pl_destroy'], $query['username']), 'wons' => pretty_number($query['wons']), 'loos' => pretty_number($query['loos']), 'draws' => pretty_number($query['draws']), 'kbmetal' => pretty_number($query['kbmetal']), 'kbcrystal' => pretty_number($query['kbcrystal']), 'lostunits' => pretty_number($query['lostunits']), 'desunits' => pretty_number($query['desunits']), 'totalfights' => pretty_number($totalfights), 'siegprozent' => round($siegprozent, 2), 'loosprozent' => round($loosprozent, 2), 'drawsprozent' => round($drawsprozent, 2), 'pl_name' => $LNG['pl_name'], 'pl_overview' => $LNG['pl_overview'], 'pl_ally' => $LNG['pl_ally'], 'pl_message' => $LNG['pl_message'], 'pl_range' => $LNG['pl_range'], 'pl_builds' => $LNG['pl_builds'], 'pl_tech' => $LNG['pl_tech'], 'pl_fleet' => $LNG['pl_fleet'], 'pl_def' => $LNG['pl_def'], 'pl_fightstats' => $LNG['pl_fightstats'], 'pl_fights' => $LNG['pl_fights'], 'pl_fprocent' => $LNG['pl_fprocent'], 'pl_fightstats' => $LNG['pl_fightstats'], 'pl_fights' => $LNG['pl_fights'], 'pl_fprocent' => $LNG['pl_fprocent'], 'pl_fightwon' => $LNG['pl_fightwon'], 'pl_fightdraw' => $LNG['pl_fightdraw'], 'pl_fightlose' => $LNG['pl_fightlose'], 'pl_totalfight' => $LNG['pl_totalfight'], 'pl_unitsshot' => $LNG['pl_unitsshot'], 'pl_unitslose' => $LNG['pl_unitslose'], 'pl_dermetal' => $LNG['pl_dermetal'], 'pl_dercrystal' => $LNG['pl_dercrystal'], 'pl_total' => $LNG['pl_total'], 'pl_buddy' => $LNG['pl_buddy'], 'pl_points' => $LNG['pl_points'], 'pl_homeplanet' => $LNG['pl_homeplanet'], 'pl_etc' => $LNG['pl_etc'])); $template->show("playercard_overview.tpl"); }
public function __construct() { global $CONF, $dpath, $LNG, $db, $USER, $PLANET; $mode = request_var('mode', ''); $msg = request_var('msg', '', true); $ctype = request_var('chat_type', ''); $MessageID = request_var('id', 0); switch ($mode) { case "delete": $this->DelMeassageFromChat($MessageID); break; case "send": $this->SetMeassageInChat($ctype, $msg); break; case "call": $this->GetMessages($ctype); break; default: $template = new template(); $template->execscript("showMessage();;setInterval(showMessage,10000);"); $template->loadscript("chat.js"); $template->page_header(); $template->page_footer(); if (empty($ctype)) { $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $template->page_topnav(); $template->page_leftmenu(); $template->page_planetmenu(); } $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange'])); $template->show("chat_overview.tpl"); break; } }