function ShowTopKB() { global $lang; //anzeige der Top 100 Liste includeLang('INGAME'); $parse = $lang; $RowsTPL = gettemplate('topkb/topkb_rows'); $top = doquery("SELECT * FROM {{table}} ORDER BY gesamtunits DESC LIMIT 100;", 'topkb'); $a = 0; while ($data = mysql_fetch_array($top)) { $a++; $timedeut = date("D d M H:i:s", $data['time']); $user1 = doquery("SELECT * FROM {{table}} WHERE username='******';", 'users', true); if ($data['fleetresult'] == "a" and $user1['hof'] == 1) { $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\"><font color=\"green\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"red\">" . $data['defender'] . "</font></a>"; } else { if ($data['fleetresult'] == "r" and $user1['hof'] == 1) { $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?page=showtopkb&mode=" . $data['rid'] . "', '');\"><font color=\"red\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"green\">" . $data['defender'] . "</font></a>"; } else { if ($data['fleetresult'] == "w" and $user1['hof'] == 1) { $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\">" . $data['angreifer'] . "<b> VS </b>" . $data['defender'] . "</a>"; } } } $bloc['top_rank'] = $a; $bloc['top_time'] = $timedeut; $bloc['top_units'] = pretty_number($data['gesamtunits']); $bloc['underrow'] = $lang['grata'] . "test"; // date("r", $data['time']); $parse['top_list'] .= parsetemplate($RowsTPL, $bloc); } display(parsetemplate(gettemplate('topkb/topkb'), $parse), false); }
function ShowGouv($user) { global $dpath, $lang; includeLang('INGAME'); $mode = $_GET['mode']; if ($_POST && $mode == "change") { $iduser = $user["id"]; $SetSort = intval($_POST['settings_sort']); if ($user['staatsform'] < 1) { doquery("UPDATE {{table}} SET `staatsform` = '.{$SetSort}.' WHERE `id` = '.{$iduser}.' LIMIT 1", 'users'); message($lang['erfolgreichestaatsformwahl'], $lang['Staatsform']); dispay(gettemplate('staatsform_confirm'), 'Confirmation', false); } else { message($lang['badstaatsformwahl'], $lang['Staatsform']); } } else { $parse = $lang; $parse['dpath'] = $dpath; $parse['staatsformeins'] = "<option value =\"1\"" . ($user['staatsform'] == 1 ? " selected" : "") . ">" . $lang['barbarisch'] . "</option>"; $parse['staatsformeins'] .= "<option value =\"2\"" . ($user['staatsform'] == 2 ? " selected" : "") . ">" . $lang['demokratie'] . "</option>"; $parse['staatsformeins'] .= "<option value =\"3\"" . ($user['staatsform'] == 3 ? " selected" : "") . ">" . $lang['monarchie'] . "</option>"; $parse['staatsformeins'] .= "<option value =\"4\"" . ($user['staatsform'] == 4 ? " selected" : "") . ">" . $lang['diktatur'] . "</option>"; $parse['staatsformeins'] .= "<option value =\"5\"" . ($user['staatsform'] == 5 ? " selected" : "") . ">" . $lang['imperialisme'] . "</option>"; $parse['staatsformeins'] .= "<option value =\"6\"" . ($user['staatsform'] == 6 ? " selected" : "") . ">" . $lang['aristocratie'] . "</option>"; display(parsetemplate(gettemplate('staatsform_body'), $parse), 'Gouvernement', false); } }
function ShowAdminMenu($Level) { global $lang, $dpath; includeLang('leftmenu'); if ($Level == "1") { $parse = $lang; $parse['dpath'] = $dpath; $parse['XNovaRelease'] = VERSION; $parse['servername'] = XNova; $Page = parsetemplate(gettemplate('admin/left_menu_go'), $parse); } elseif ($Level == "2") { $parse = $lang; $parse['mf'] = "Hauptframe"; $parse['dpath'] = $dpath; $parse['XNovaRelease'] = VERSION; $parse['servername'] = XNova; $Page = parsetemplate(gettemplate('admin/left_menu_sgo'), $parse); } elseif ($Level >= "3") { $parse = $lang; $parse['mf'] = "Hauptframe"; $parse['dpath'] = $dpath; $parse['XNovaRelease'] = VERSION; $parse['servername'] = XNova; $Page = parsetemplate(gettemplate('admin/left_menu_admin'), $parse); } else { header('Location: indexGame.php'); } return $Page; }
function ShowChangelogPage() { if ($_POST) { global $lang, $displays, $db; includeLang('CHANGELOG'); //$displays->assignContent('changelog'); $displays->TemplatePower($svn_root . TEMPLATE_DIR . "changelog" . $displays->tpl); $displays->prepare(); foreach ($lang['changelog'] as $a => $b) { $displays->newBlock("version"); if ($a == $db->game_config["VERSION"]) { $parse['version_number'] = "<span style=\"color:red\">" . $a . "</span>"; } else { $parse['version_number'] = $a; } $parse['description'] = nl2br($b); foreach ($parse as $name => $trans) { $displays->assign($name, $trans); } } $displays->getOutputContent(); $displays->printToScreen(); //$displays->display('Changelog'); } else { header("location: ?page=overview"); } }
function ShowLeftMenu($Level, $Template = 'left_menu') { global $lang, $dpath, $game_config; includeLang('leftmenu'); $MenuTPL = gettemplate($Template); $InfoTPL = gettemplate('serv_infos'); $parse = $lang; $parse['lm_tx_serv'] = $game_config['resource_multiplier']; $parse['lm_tx_game'] = $game_config['game_speed'] / 2500; $parse['lm_tx_fleet'] = $game_config['fleet_speed'] / 2500; $parse['lm_tx_queue'] = MAX_FLEET_OR_DEFS_PER_ROW; $SubFrame = parsetemplate($InfoTPL, $parse); $parse['server_info'] = $SubFrame; $parse['XNovaRelease'] = VERSION; $parse['dpath'] = $dpath; $parse['forum_url'] = $game_config['forum_url']; $parse['mf'] = "Hauptframe"; $rank = doquery("SELECT `total_rank` FROM {{table}} WHERE `stat_code` = '1' AND `stat_type` = '1' AND `id_owner` = '" . $user['id'] . "';", 'statpoints', true); $parse['user_rank'] = $rank['total_rank']; if ($Level > 0) { $parse['ADMIN_LINK'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"admin/leftmenu.php\"><font color=\"lime\">" . $lang['user_level'][$Level] . "</font></a></div></td>\r\n\t\t</tr>"; } else { $parse['ADMIN_LINK'] = ""; } $parse['servername'] = $game_config['game_name']; $Menu = parsetemplate($MenuTPL, $parse); return $Menu; }
function DisplayGameSettingsPage($CurrentUser) { global $lang, $game_config, $_POST, $Adminerlaubt, $user; includeLang('admin/einstellung/einstellung_az'); if ($user['authlevel'] >= 1 and in_array($user['id'], $Adminerlaubt)) { if ($_POST['opt_save'] == "1") { if (isset($_POST['angriffszone']) && $_POST['angriffszone'] == 'on') { $game_config['angriffszone'] = "1"; } else { $game_config['angriffszone'] = "0"; } doquery("UPDATE {{table}} SET `config_value` = '" . $game_config['angriffszone'] . "' WHERE `config_name` = 'angriffszone';", 'config'); AdminMessage($lang['speichern'][100], $lang['speichern'][101], '?'); } else { $parse = $lang; $parse['angriffszone'] = $game_config['angriffszone'] == 1 ? " checked = 'checked' " : ""; $PageTPL = gettemplate('admin/einstellung/einstellung_az'); $Page .= parsetemplate($PageTPL, $parse); display($Page, $lang['adm_opt_title'], false, '', true); } } else { AdminMessage($lang['system'][9000], $lang['system'][9001]); } return $Page; }
function CheckCookies($IsUserChecked) { global $lang, $game_config, $xnova_root_path, $phpEx; includeLang('cookies'); $UserRow = array(); include $xnova_root_path . 'config.' . $phpEx; if (isset($_COOKIE[$game_config['COOKIE_NAME']])) { $TheCookie = explode("/%/", $_COOKIE[$game_config['COOKIE_NAME']]); $UserResult = doquery("SELECT * FROM {{table}} WHERE `username` = '" . $TheCookie[1] . "';", 'users'); // On verifie s'il y a qu'un seul enregistrement pour ce nom if (mysql_num_rows($UserResult) != 1) { message($lang['cookies']['Error1']); } $UserRow = mysql_fetch_array($UserResult); // On teste si on a bien le bon UserID if ($UserRow["id"] != $TheCookie[0]) { message($lang['cookies']['Error2']); } // On teste si le mot de passe est correct ! if (md5($UserRow["password"] . "--" . $dbsettings["secretword"]) !== $TheCookie[2]) { message($lang['cookies']['Error3']); } $NextCookie = implode("/%/", $TheCookie); // Au cas ou dans l'ancien cookie il etait question de se souvenir de moi // 3600 = 1 Heure // 86400 = 1 Jour // 31536000 = 365 Jours // on ajoute au compteur! if ($TheCookie[3] == 1) { $ExpireTime = time() + 31536000; } else { $ExpireTime = 0; } if ($IsUserChecked == false) { setcookie($game_config['COOKIE_NAME'], $NextCookie, $ExpireTime, "/", "", 0); $QryUpdateUser = "******"; $QryUpdateUser .= "`onlinetime` = '" . time() . "', "; $QryUpdateUser .= "`current_page` = '" . addslashes($_SERVER['REQUEST_URI']) . "', "; $QryUpdateUser .= "`user_lastip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $QryUpdateUser .= "`user_agent` = '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "' "; $QryUpdateUser .= "WHERE "; $QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;"; doquery($QryUpdateUser, 'users'); $IsUserChecked = true; } else { $QryUpdateUser = "******"; $QryUpdateUser .= "`onlinetime` = '" . time() . "', "; $QryUpdateUser .= "`current_page` = '" . $_SERVER['REQUEST_URI'] . "', "; $QryUpdateUser .= "`user_lastip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $QryUpdateUser .= "`user_agent` = '" . $_SERVER['HTTP_USER_AGENT'] . "' "; $QryUpdateUser .= "WHERE "; $QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;"; doquery($QryUpdateUser, 'users'); $IsUserChecked = true; } } unset($dbsettings); $Return['state'] = $IsUserChecked; $Return['record'] = $UserRow; return $Return; }
function ShowLeftMenu($Level, $Template = 'left_menu') { global $lang, $dpath, $game_config, $adsense_config; includeLang('leftmenu'); $MenuTPL = gettemplate($Template); $InfoTPL = gettemplate('serv_infos'); $parse = $lang; $parse['lm_tx_serv'] = $game_config['resource_multiplier']; $parse['lm_tx_game'] = $game_config['game_speed'] / 2500; $parse['lm_tx_fleet'] = $game_config['fleet_speed'] / 2500; $parse['lm_tx_queue'] = MAX_FLEET_OR_DEFS_PER_ROW; $SubFrame = parsetemplate($InfoTPL, $parse); $parse['server_info'] = $SubFrame; $parse['XNovaRelease'] = VERSION; $parse['dpath'] = $dpath; $parse['forum_url'] = $game_config['forum_url']; $parse['mf'] = "Hauptframe"; $rank = doquery("SELECT `total_rank` FROM {{table}} WHERE `stat_code` = '1' AND `stat_type` = '1' AND `id_owner` = '" . $user['id'] . "';", 'statpoints', true); $parse['user_rank'] = $rank['total_rank']; // Show Administrator Link if ($Level > 0) { $parse['ADMIN_LINK'] = "\r\r\n\t\t\r\r\n\t\t\t<div><a href=\"admin/leftmenu.php\"><font color=\"lime\">" . $lang['user_level'][$Level] . "</font></a></div>\r\r\n\t\t"; } else { $parse['ADMIN_LINK'] = ""; } // Show Forum Link $parse['forum_link'] = "\r\r\n\t\t<br><div><a href=\"" . $game_config['forum_url'] . "\" target=\"_blank\">Forum</a></div>"; // Show Custom Link if ($game_config['link_enable'] == 1) { $parse['added_link'] = "\r\r\n\t\t\r\r\n\t\t\t<div align=\"center\"><a href=\"" . $game_config['link_url'] . "\" target=\"_blank\">" . stripslashes($game_config['link_name']) . "</a></div>\r\r\n\t\t"; } else { $parse['added_link'] = ""; } // Show Source Code Link if ($game_config['enable_source'] == 1 && $game_config['enable_donate'] != 1) { $parse['source_link'] = "\r\r\n\t\t<tr>\r\r\n\t\t\t<td colspan=\"2\"><div align=\"center\"><a href=\"source.php\" target=\"Hauptframe\">Source Code</a></div></td>\r\r\n\t\t</tr>"; } elseif ($game_config['enable_source'] == 1 && $game_config['enable_donate'] == 1) { $parse['source_link'] = "\r\r\n\t\t<tr>\r\r\n\t\t\t<th width=\"51%\"><a href=\"source.php\" target=\"Hauptframe\">Source Code</a></th>"; } else { $parse['source_link'] = ""; } // Show Donations Link if ($game_config['enable_donate'] == 1 && $game_config['enable_source'] != 1) { $parse['donate_link'] = "\r\r\n\t\t<tr>\r\r\n\t\t\t<td colspan=\"2\"><div align=\"center\"><a href=\"donate.php\" target=\"Hauptframe\">Donate</a></div></td>\r\r\n\t\t</tr>"; } elseif ($game_config['enable_donate'] == 1 && $game_config['enable_source'] == 1) { $parse['donate_link'] = "\r\r\n\t\t\t<th width=\"49%\"><a href=\"donate.php\" target=\"Hauptframe\">Donate</a></th>\r\r\n\t\t</tr>"; } else { $parse['donate_link'] = ""; } // Show Adsense Ad if ($adsense_config['leftmenu_on'] == 1) { $parse['leftmenu_script'] = "<div>" . $adsense_config['leftmenu_script'] . "</div>"; } else { $parse['leftmenu_script'] = ""; } $parse['servername'] = $game_config['game_name']; $Menu = parsetemplate($MenuTPL, $parse); return $Menu; }
public function __construct() { global $lang; if (empty($lang)) { includeLang('INGAME'); } $this->lang = $lang; }
function ShowLeftMenu($Level, $Template = 'redesign_menu') { global $lang, $dpath, $game_config; includeLang('leftmenu'); includeLang('changelog'); //includeLang('sides'); $MenuTPL = gettemplate($Template); $InfoTPL = gettemplate('serv_infos'); $parse = $lang; $use_alliances = 1; $parse['lm_tx_serv'] = $game_config['resource_multiplier']; $parse['lm_tx_game'] = $game_config['game_speed'] / 2500; $parse['lm_tx_fleet'] = $game_config['fleet_speed'] / 2500; $parse['lm_tx_queue'] = MAX_FLEET_OR_DEFS_PER_ROW; $SubFrame = parsetemplate($InfoTPL, $parse); $parse['server_info'] = $SubFrame; $parse['XNovaRelease'] = VERSION; $parse['dpath'] = $dpath; $parse['forum_url'] = $game_config['forum_url']; $parse['mf'] = "_self"; $rank['total_rank'] = 1; //$rank = doquery("SELECT `total_rank` FROM {{table}} WHERE `stat_code` = '1' AND `stat_type` = '1' AND `id_owner` = '". $user['id'] ."';",'statpoints',true); $parse['user_rank'] = $rank['total_rank']; $parse['option1'] = "<tr height=\"22\">\n\r\n\t<td colspan=\"2\" align=\"center\" style=\"border-top: 0px; color: #FFFFFF; font-size: 10px;\" background=\"../graphics/menu_optbg.png\">\n\r\n\t\t<div>\n\t\t\t"; $parse['option2'] = "\n\t\t</div>\n\r\n\t</td>\n\r\n</tr>\n\n\n\n"; if ($Level > 0) { $parse['ADMIN_LINK'] = "<a href=\"admin/overview.php\"><font color=\"lime\">" . $lang['user_level'][$Level] . "</font></a>"; } else { $parse['ADMIN_LINK'] = ""; } //Lien suppl�mentaire d�termin� dans le panel admin if ($game_config['link_enable'] == 1) { $parse['added_link'] = "<a href=\"" . $game_config['link_url'] . "\" target=\"_blank\">" . stripslashes($game_config['link_name']) . "</a></div></td>\r\n\t\t</tr>"; } else { $parse['added_link'] = ""; } //Maintenant on v�rifie si les annonces sont activ�es ou non if ($game_config['enable_marchand'] == 1) { $parse['marchand_link'] = "<a href=\"marchand.php\" target=\"" . $parse['mf'] . "\">" . $lang['Marchand'] . "</a>"; } else { $parse['marchand_link'] = ""; } //Maintenant on v�rifie si les annonces sont activ�es ou non if ($game_config['enable_announces'] == 1) { $parse['announce_link'] = "<a href=\"annonce.php\" target=\"" . $parse['mf'] . "\">" . $lang['Annonces'] . "</a>"; } else { $parse['announce_link'] = ""; } //Maintenant les notes if ($game_config['enable_notes'] == 1) { $parse['notes_link'] = "<a href=\"#\" onClick=\"f('notes.php', 'Notes');\" accesskey=\"n\">Notes</a>"; } else { $parse['notes_link'] = ""; } $parse['servername'] = $game_config['game_name']; $Menu = parsetemplate($MenuTPL, $parse); return $Menu; }
function CheckCookies($IsUserChecked) { global $lang, $game_config, $xnova_root_path, $phpEx; includeLang('cookies'); $UserRow = array(); include $xnova_root_path . 'config.' . $phpEx; if (isset($_COOKIE[$game_config['COOKIE_NAME']])) { $TheCookie = explode("/%/", $_COOKIE[$game_config['COOKIE_NAME']]); $UserResult = doquery("SELECT * FROM {{table}} WHERE `username` = '" . $TheCookie[1] . "';", 'users'); if (mysql_num_rows($UserResult) != 1) { message($lang['cookies']['Error1']); } $UserRow = mysql_fetch_array($UserResult); if ($UserRow["id"] != $TheCookie[0]) { message($lang['cookies']['Error2']); } if (md5($UserRow["password"] . "--" . $dbsettings["secretword"]) !== $TheCookie[2]) { message($lang['cookies']['Error3']); } $NextCookie = implode("/%/", $TheCookie); if ($TheCookie[3] == 1) { $ExpireTime = time() + 31536000; } else { $ExpireTime = 0; } if ($IsUserChecked == false) { setcookie($game_config['COOKIE_NAME'], $NextCookie, $ExpireTime, "/", "", 0); $QryUpdateUser = "******"; $QryUpdateUser .= "`onlinetime` = '" . time() . "', "; $QryUpdateUser .= "`current_page` = '" . addslashes($_SERVER['REQUEST_URI']) . "', "; $QryUpdateUser .= "`user_lastip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $QryUpdateUser .= "`user_agent` = '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "' "; $QryUpdateUser .= "WHERE "; $QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;"; doquery($QryUpdateUser, 'users'); $IsUserChecked = true; } else { $QryUpdateUser = "******"; $QryUpdateUser .= "`onlinetime` = '" . time() . "', "; $QryUpdateUser .= "`current_page` = '" . $_SERVER['REQUEST_URI'] . "', "; $QryUpdateUser .= "`user_lastip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $QryUpdateUser .= "`user_agent` = '" . $_SERVER['HTTP_USER_AGENT'] . "' "; $QryUpdateUser .= "WHERE "; $QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;"; doquery($QryUpdateUser, 'users'); $IsUserChecked = true; } } unset($dbsettings); $Return['state'] = $IsUserChecked; $Return['record'] = $UserRow; return $Return; }
function ShowLeftMenu($Level, $Template = 'left_menu2') { global $lang, $dpath, $game_config; includeLang('leftmenu'); $MenuTPL = gettemplate($Template); $InfoTPL = gettemplate('serv_infos'); $parse = $lang; $parse['lm_tx_serv'] = $game_config['resource_multiplier']; $parse['lm_tx_game'] = $game_config['game_speed'] / 2500; $parse['lm_tx_fleet'] = $game_config['fleet_speed'] / 2500; $parse['lm_tx_queue'] = MAX_FLEET_OR_DEFS_PER_ROW; $SubFrame = parsetemplate($InfoTPL, $parse); $parse['server_info'] = $SubFrame; $parse['XNovaRelease'] = VERSION; $parse['dpath'] = $dpath; $parse['forum_url'] = $game_config['forum_url']; $parse['mf'] = "Hauptframe"; $rank = doquery("SELECT `total_rank` FROM {{table}} WHERE `stat_code` = '1' AND `stat_type` = '1' AND `id_owner` = '" . $user['id'] . "';", 'statpoints', true); $parse['user_rank'] = $rank['total_rank']; if ($Level > 0) { $parse['ADMIN_LINK'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"admin/leftmenu.php\"><font color=\"lime\">" . $lang['user_level'][$Level] . "</font></a></div></td>\r\n\t\t</tr>"; } else { $parse['ADMIN_LINK'] = ""; } //Lien supplémentaire déterminé dans le panel admin if ($game_config['link_enable'] == 1) { $parse['added_link'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"" . $game_config['link_url'] . "\" target=\"_blank\">" . stripslashes($game_config['link_name']) . "</a></div></td>\r\n\t\t</tr>"; } else { $parse['added_link'] = ""; } //Maintenant on vérifie si les annonces sont activées ou non if ($game_config['enable_announces'] == 1) { $parse['announce_link'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"annonces.php\" target=\"Hauptframe\">Annonces</a></div></td>\r\n\t\t</tr>"; } else { $parse['announce_link'] = ""; } //Maintenant le marchand if ($game_config['enable_marchand'] == 1) { $parse['marchand_link'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"marchand.php\" target=\"Hauptframe\">Marchand</a></div></td>\r\n\t\t</tr>"; } else { $parse['marchand_link'] = ""; } //Maintenant les notes if ($game_config['enable_notes'] == 1) { $parse['notes_link'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"#\" onClick=\"f(\\'notes.php\\', \\'Report\\');\" accesskey=\"n\">Notes</a></div></td>\r\n\t\t</tr>"; } else { $parse['notes_link'] = ""; } $parse['servername'] = $game_config['game_name']; $Menu = parsetemplate($MenuTPL, $parse); return $Menu; }
function ShowChangelogPage() { global $lang; includeLang('CHANGELOG'); foreach ($lang['changelog'] as $a => $b) { $parse['version_number'] = $a; $parse['description'] = nl2br($b); $body .= parsetemplate(gettemplate('changelog_table'), $parse); } $parse = $lang; $parse['body'] = $body; return display(parsetemplate(gettemplate('changelog_body'), $parse)); }
function checkcookies() { global $lang, $game_config, $ugamela_root_path, $phpEx, $user; //mas adelante esta variable formara parte de la $game_config includeLang('cookies'); include $ugamela_root_path . 'config.' . $phpEx; $row = false; if (isset($_COOKIE[$game_config['COOKIE_NAME']])) { // Formato de la cookie: // {ID} {USERNAME} {PASSWORDHASH} {REMEMBERME} $theuser = explode(" ", $_COOKIE[$game_config['COOKIE_NAME']]); $query = doquery("SELECT * FROM {{table}} LEFT JOIN ugml_stat ON id = userID WHERE id='" . WCF::getUser()->userID . "'", "users"); //$sql = "SELECT activityPoints FROM wcf".WCF_N."_user WHERE userID = '".WCF::getUser()->userID."'"; //$boardQry = WCF::getDB()->getFirstRow($sql); if (mysql_num_rows($query) != 1) { message($lang['cookies']['Error1']); } $row = mysql_fetch_array($query); /*if ($row["id"] != $theuser[0]) { message($lang['cookies']['Error2']); } if (md5($row["password"]."--".$dbsettings["secretword"]) !== $theuser[1]) { message($lang['cookies']['Error3']); }*/ // Si llegamos hasta aca... quiere decir que la cookie es valida, // entonces escribimos una nueva. $newcookie = implode(" ", $theuser); if ($theuser[2] == 1) { $expiretime = time() + 31536000; } else { $expiretime = 0; } setcookie($game_config['COOKIE_NAME'], $newcookie, $expiretime, "/", "", 0); //doquery("UPDATE {{table}} SET onlinetime=".time().", user_lastip='{$_SERVER['REMOTE_ADDR']}' WHERE id='{$theuser[0]}' LIMIT 1", "users"); } unset($dbsettings); if (!$row) { $row = $user; } // correct rank & points $row['rank'] = $row['rankPoints']; $row['points_points'] = $row['points'] * 1000; $row['dilizium'] += WCF::getUser()->additionalDilizium; $row['dilizium'] -= $row['lostDilizium']; return $row; }
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 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 ShowChatPage($CurrentUser) { global $game_config, $dpath, $lang; ini_set('display_error', 0); ini_set('error_reporting', 0); includeLang('INGAME'); $nick = $CurrentUser['username']; $parse = $lang; if (isset($_GET["chat_type"])) { $parse['chat_type'] = $_GET["chat_type"]; $parse['ally_id'] = $CurrentUser['ally_id']; display(parsetemplate(gettemplate('chat_body'), $parse), false, '', false, false); } else { display("<div id=\"content\">\n" . parsetemplate(gettemplate('chat_body'), $parse) . "\n</div>"); } }
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 ShowAdminLeftMenu($Level) { global $lang, $dpath, $game_config; includeLang('leftmenu'); $Template = 'admin/left_menu'; $MenuTPL = gettemplate($Template); $InfoTPL = gettemplate('serv_infos'); $SubFrame = parsetemplate($InfoTPL, $parse); $parse['server_info'] = $SubFrame; $parse = $lang; $parse['mf'] = "_self"; $parse['dpath'] = $dpath; $parse['XNovaRelease'] = VERSION; $parse['servername'] = XNova; $Menu = parsetemplate($MenuTPL, $parse); return $Menu; }
function ShowChangelogPage() { global $lang; includeLang('CHANGELOG'); foreach ($lang['changelog'] as $a => $b) { if (VERSION == "v" . $a) { $parse['version_number'] = "<span style=color:lime; >" . $a . "</span>"; } else { $parse['version_number'] = $a; } $parse['description'] = nl2br($b); $body .= parsetemplate(gettemplate('changelog_table'), $parse); } $parse = $lang; $parse['body'] = $body; return display(parsetemplate(gettemplate('changelog_body'), $parse)); }
/** * 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 CheckCookies($IsUserChecked) { global $lang, $game_config; includeLang('cookies'); if (isset($_SESSION['user_id'])) { $sql = <<<EOF SELECT * FROM {{table}} WHERE id={$_SESSION['user_id']} LIMIT 1 EOF; $userData = doquery($sql, 'users', true); } else { if (isset($_COOKIE['nova-cookie'])) { $_COOKIE['nova-cookie'] = unserialize($_COOKIE['nova-cookie']); $cookieData = array('id' => (string) (isset($_COOKIE['nova-cookie']['id']) ? (int) $_COOKIE['nova-cookie']['id'] : 0), 'key' => isset($_COOKIE['nova-cookie']['key']) ? (string) $_COOKIE['nova-cookie']['key'] : NULL); $sql = <<<EOF SELECT users.* FROM {{table}} AS users WHERE id={$cookieData['id']} AND (@key:="{$cookieData['key']}")=CONCAT((@salt:=MID(@key, 0, 4)), SHA1(CONCAT(users.username, users.password, @salt))) LIMIT 1 EOF; $userData = doquery($sql, 'users', true); $_SESSION['user_id'] = $userData['id']; if (empty($userData)) { message($lang['cookies']['Error2']); } } else { return array('state' => false, 'record' => array()); } } $sessionData = array('request_uri' => mysql_real_escape_string($_SERVER['REQUEST_URI']), 'remote_addr' => mysql_real_escape_string($_SERVER['REMOTE_ADDR']), 'user_agent' => mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])); $sql = <<<EOF UPDATE {{table}} SET `onlinetime` = UNIX_TIMESTAMP(NOW()), `current_page` = "{$sessionData['request_uri']}", `user_lastip` = "{$sessionData['remote_addr']}", `user_agent` = "{$sessionData['user_agent']}" WHERE `id`={$_SESSION['user_id']} LIMIT 1; EOF; doquery($sql, 'users'); return array('state' => true, 'record' => $userData); }
/** * Tis 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-Present, 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 CheckTheUser($IsUserChecked) { global $user; includeLang('admin'); $Result = CheckCookies($IsUserChecked); $IsUserChecked = $Result['state']; if ($Result['record'] != false) { $user = $Result['record']; if ($user['bana'] == "1") { die($page .= parsetemplate(gettemplate('usr_banned'), $lang)); } $RetValue['record'] = $user; $RetValue['state'] = $IsUserChecked; } else { $RetValue['record'] = array(); $RetValue['state'] = false; } return $RetValue; }
function DisplayGameSettingsPage() { global $lang, $game_config; includeLang('admin/settings'); if ($_POST) { $game_config_keys = array_keys($game_config); $game_config_old = $game_config; foreach ($_POST as $key => $value) { if (in_array($key, $game_config_keys)) { $key = mysql_real_escape_string($key); $value = mysql_real_escape_string($value); $game_config[$key] = $value == 'on' ? '1' : $value; } } $checkboxArray = array('game_disable', 'OverviewNewsFrame', 'OverviewExternChat', 'OverviewBanner', 'debug'); foreach ($checkboxArray as $checkbox) { if (is_null($_POST[$checkbox])) { $game_config[$checkbox] = '0'; } } $game_config_newValues = array_diff_assoc($game_config, $game_config_old); $readConnection = Nova::getSingleton('core/database_connection_pool')->getConnection('core_read'); foreach ($game_config_newValues as $key => $value) { $readConnection->update($readConnection->getDeprecatedTable('config'), array('config_value' => $value), array('config_name =?' => $key)); } AdminMessage($lang['GameSettings_SettingsChanged'], $lang['GameSettings_Success']); } else { $parse = $lang; foreach ($game_config as $key => $value) { $parse[$key] = $value; } $parse['closed'] = $game_config['game_disable'] == 1 ? " checked = 'checked' " : ""; $parse['newsframe'] = $game_config['OverviewNewsFrame'] == 1 ? " checked = 'checked' " : ""; $parse['chatframe'] = $game_config['OverviewExternChat'] == 1 ? " checked = 'checked' " : ""; $parse['googlead'] = $game_config['OverviewBanner'] == 1 ? " checked = 'checked' " : ""; $parse['debug'] = $game_config['debug'] == 1 ? " checked = 'checked' " : ""; $parse['bannerframe'] = $game_config['ForumBannerFrame'] == 1 ? " checked = 'checked' " : ""; $PageTPL = gettemplate('admin/options_body'); $Page = parsetemplate($PageTPL, $parse); display($Page, $lang['GameSettings_Title'], false, '', true); } return $Page; }
/** * CheckUser.php * * @version 1.0 * @copyright 2008 By Chlorel for XNova */ function CheckTheUser($IsUserChecked) { global $user; includeLang('admin'); $Result = CheckCookies($IsUserChecked); $IsUserChecked = $Result['state']; if ($Result['record'] != false) { $user = $Result['record']; if ($user['banned_until'] > time()) { if (!defined('VIEW_BANNED')) { getLang('ban'); info($lang['Your_Nanned'], $lang['Banned'], "./?page=pillory", "./?page=pillory"); } } $RetValue['record'] = $user; $RetValue['state'] = $IsUserChecked; } else { $RetValue['record'] = array(); $RetValue['state'] = false; } return $RetValue; }
function CheckSessions() { global $lang, $game_config, $ugamela_root_path, $phpEx; includeLang('cookies'); include $ugamela_root_path . 'config.' . $phpEx; $UserRow = array(); if ($_SESSION[USER_SESSION]) { $UserRow = doquery("SELECT * FROM {{table}} WHERE `id` = " . $_SESSION[USER_SESSION][id], 'users', true); // USER FOUND? if (!$UserRow) { message($lang['cookies']['Error2']); } // CHECK PASS $Hash = md5($UserRow["password"] . "--" . $dbsettings["secretword"]); if ($Hash !== $_SESSION[USER_SESSION][password]) { message($lang['cookies']['Error3']); } // ONLY 1 IP :D if ($UserRow['user_lastip'] != $_SESSION[USER_SESSION][ip]) { message($lang['cookies']['Error1']); } $Qry = "UPDATE {{table}} SET "; $Qry .= "`onlinetime` = UNIX_TIMESTAMP(), "; $Qry .= "`user_lastip` = '" . getIP() . "', "; $Qry .= "`user_agent` = '" . $_SERVER['HTTP_USER_AGENT'] . "'"; $Qry .= " WHERE `id` = " . $_SESSION[USER_SESSION][id] . " LIMIT 1;"; doquery($Qry, 'users'); if ($IsUserChecked == false) { $IsUserChecked = true; } else { $IsUserChecked = true; } } unset($dbsettings); $Return['state'] = $IsUserChecked; $Return['record'] = $UserRow; return $Return; }
function checkcookies() { global $lang, $game_config, $ugamela_root_path, $phpEx; //mas adelante esta variable formara parte de la $game_config includeLang('cookies'); include $ugamela_root_path . 'config.' . $phpEx; $row = false; if (isset($_COOKIE[$game_config['COOKIE_NAME']])) { // Formato de la cookie: // {ID} {USERNAME} {PASSWORDHASH} {REMEMBERME} $theuser = explode(" ", $_COOKIE[$game_config['COOKIE_NAME']]); $query = doquery("SELECT * FROM {{table}} WHERE username='******'", "users"); if (mysql_num_rows($query) != 1) { message($lang['cookies']['Error1']); } $row = mysql_fetch_array($query); if ($row["id"] != $theuser[0]) { message($lang['cookies']['Error2']); } if (md5($row["password"] . "--" . $dbsettings["secretword"]) !== $theuser[2]) { message($lang['cookies']['Error3']); } // Si llegamos hasta aca... quiere decir que la cookie es valida, // entonces escribimos una nueva. $newcookie = implode(" ", $theuser); if ($theuser[3] == 1) { $expiretime = time() + 31536000; } else { $expiretime = 0; } setcookie($game_config['COOKIE_NAME'], $newcookie, $expiretime, "/", "", 0); doquery("UPDATE {{table}} SET onlinetime=" . time() . ", user_lastip='{$_SERVER['REMOTE_ADDR']}' WHERE id='{$theuser[0]}' LIMIT 1", "users"); } unset($dbsettings); return $row; }
<?php /** * XNovaResetUnivers.php * * @version 1 * @copyright 2008 By Chlorel for XNova */ define('INSIDE', true); define('INSTALL', false); define('IN_ADMIN', true); $ugamela_root_path = './../'; include $ugamela_root_path . 'extension.inc'; include $ugamela_root_path . 'common.' . $phpEx; includeLang('admin'); function XNovaResetUnivers($CurrentUser) { global $lang; if ($CurrentUser['authlevel'] == 4) { // Copier la table users et planets vers des tables de replis ! doquery("RENAME TABLE {{table}} TO {{table}}_s", 'planets'); doquery("RENAME TABLE {{table}} TO {{table}}_s", 'users'); // Recreer la structure des tables renommées doquery("CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'planets'); doquery("CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'users'); // Vider toutes les tables ! doquery("TRUNCATE TABLE {{table}}", 'aks'); doquery("TRUNCATE TABLE {{table}}", 'alliance'); doquery("TRUNCATE TABLE {{table}}", 'annonce'); doquery("TRUNCATE TABLE {{table}}", 'banned'); doquery("TRUNCATE TABLE {{table}}", 'buddy');
<?php /** * options.php * * @version 1.0 * @copyright 2008 by ??????? for XNova */ define('INSIDE', true); define('INSTALL', false); $ugamela_root_path = './'; include $ugamela_root_path . 'extension.inc'; include $ugamela_root_path . 'common.' . $phpEx; includeLang('options'); $lang['PHP_SELF'] = 'options.' . $phpEx; $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"]; $mode = $_GET['mode']; if ($_POST && $mode == "exit") { // Array ( [db_character] if (isset($_POST["exit_modus"]) && $_POST["exit_modus"] == 'on' and $user['urlaubs_until'] <= time()) { $urlaubs_modus = "0"; doquery("UPDATE {{table}} SET \r\n `urlaubs_modus` = '0',\r\n `urlaubs_until` = '0'\r\n WHERE `id` = '" . $user['id'] . "' LIMIT 1", "users"); $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"]; message($lang['succeful_save'], $lang['Options'], "options.php", 1); } else { $urlaubs_modus = "1"; $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"]; message($lang['You_cant_exit_vmode'], $lan['Error'], "options.php", 1); } } if ($_POST && $mode == "change") {
<?php /** * topkbuser.php * @Licence GNU (GPL) * @version 1.0 * @copyright 2010 * @Team Space Beginner * **/ define('INSIDE', true); define('INSTALL', false); includeLang('tech'); includeLang('menu_05/topkb'); if (!isset($mode)) { if (isset($_GET['mode'])) { $mode = $_GET['mode']; } else { $mode = 0; } } $anzeige = doquery("SELECT * FROM {{table}} WHERE `rid` = '" . $mode . "';", 'topkb'); $BodyTPL = gettemplate('topkb/topkb_03'); $RowsTPL = gettemplate('topkb/topkb_04'); $parse = $lang; $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"]; $parse['dpath'] = $dpath; while ($tabelle = mysql_fetch_assoc($anzeige)) { $report = stripslashes($tabelle['raport']); foreach ($lang['tech_rc'] as $id => $s_name) { $str_replace1 = array("[ship[" . $id . "]]");
* 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. * */ define('INSIDE', true); define('INSTALL', false); require_once dirname(__FILE__) . '/common.php'; includeLang('chat'); $BodyTPL = gettemplate('chat_body'); $nick = $user['username']; $parse = $lang; $page = parsetemplate($BodyTPL, $parse); display($page, $lang['Chat'], false); // Shoutbox by e-Zobar - Copyright XNova Team 2008