diff --git a/.gitignore b/.gitignore index b74decb..24b99ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ -/config.php +config.php +.buildpath +.project +.settings/ +.idea/ +coverage/ +src/application/cache/* +src/application/configs/local.php diff --git a/.htaccess b/.htaccess deleted file mode 100644 index 5eb217c..0000000 --- a/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -SetEnv DEBUG On -SetEnv DEPRECATION Off \ No newline at end of file diff --git a/add_declare.php b/add_declare.php deleted file mode 100644 index c1cc82e..0000000 --- a/add_declare.php +++ /dev/null @@ -1,68 +0,0 @@ - - * 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 . - * - * --> 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('admin'); - - $mode = $_POST['mode']; - - $PageTpl = gettemplate("add_declare"); - $parse = $lang; - - if ($mode == 'addit') { - $declarator = $user['id']; - $declarator_name = addslashes(htmlspecialchars($user['username'])); - $decl1 = addslashes(htmlspecialchars($_POST['dec1'])); - $decl2 = addslashes(htmlspecialchars($_POST['dec2'])); - $decl3 = addslashes(htmlspecialchars($_POST['dec3'])); - $reason1 = addslashes(htmlspecialchars($_POST['reason'])); - - $QryDeclare = "INSERT INTO {{table}} SET "; - $QryDeclare .= "`declarator` = '". $declarator ."', "; - $QryDeclare .= "`declarator_name` = '". $declarator_name ."', "; $QryDeclare .= "`declared_1` = '". $decl1 ."', "; - $QryDeclare .= "`declared_2` = '". $decl2 ."', "; - $QryDeclare .= "`declared_3` = '". $decl3 ."', "; - $QryDeclare .= "`reason` = '". $reason1 ."' "; - - doquery( $QryDeclare, "declared"); - doquery("UPDATE {{table}} SET multi_validated ='1' WHERE username='{$user['username']}'","users"); - - AdminMessage ( "Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout" ); - } - $Page = parsetemplate($PageTpl, $parse); - - display ($Page, "Declaration d\'IP partagee", false, '', true); - - -?> \ No newline at end of file diff --git a/admin/activeplanet.php b/admin/activeplanet.php deleted file mode 100644 index 9cd3871..0000000 --- a/admin/activeplanet.php +++ /dev/null @@ -1,66 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { - includeLang('admin'); - - $parse = $lang; - $parse['dpath'] = $dpath; - $parse['mf'] = $mf; - - $PageTPL = gettemplate('admin/activeplanet_body'); - $AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '". (time()-15 * 60) ."' ORDER BY `id` ASC", 'planets'); - $Count = 0; - - while ($ActivPlanet = $AllActivPlanet->fetch(PDO::FETCH_BOTH)) { - $parse['online_list'] .= ""; - $parse['online_list'] .= "
". $ActivPlanet['name'] ."
"; - $parse['online_list'] .= "
[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]
"; - $parse['online_list'] .= "
". pretty_number($ActivPlanet['points'] / 1000) ."
"; - $parse['online_list'] .= "
". pretty_time(time() - $ActivPlanet['last_update']) . "
"; - $parse['online_list'] .= ""; - $Count++; - } - $parse['online_list'] .= ""; - $parse['online_list'] .= "". $lang['adm_pl_they'] ." ". $Count ." ". $lang['adm_pl_apla'] .""; - $parse['online_list'] .= ""; - - $page = parsetemplate( $PageTPL , $parse ); - display( $page, $lang['adm_pl_title'], false, '', true ); - } else { - message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } - -?> \ No newline at end of file diff --git a/admin/add_fleet.php b/admin/add_fleet.php deleted file mode 100644 index dc03f9c..0000000 --- a/admin/add_fleet.php +++ /dev/null @@ -1,101 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - if ($user['authlevel'] >= 1) { - includeLang('admin/add_fleet'); - $mode = $_GET['mode']; - - if($mode != 'add') { - $parse['ID'] = $lang['Id']; - $parse['Cle'] = $lang['cle']; - $parse['Clourd'] = $lang['clourd']; - $parse['Pt'] = $lang['pt']; - $parse['Gt'] = $lang['gt']; - $parse['Cruise'] = $lang['cruise']; - $parse['Vb'] = $lang['vb']; - $parse['Colo'] = $lang['colo']; - $parse['Rc'] = $lang['rc']; - $parse['Spy'] = $lang['spy']; - $parse['Bomb'] = $lang['bomb']; - $parse['Solar'] = $lang['solar']; - $parse['Des'] = $lang['des']; - $parse['Rip'] = $lang['rip']; - $parse['Traq'] = $lang['traq']; - - } elseif($mode == 'add') { - $id = $_POST['id']; - $cle = $_POST['cle']; - $clourd = $_POST['clourd']; - $pt = $_POST['pt']; - $gt = $_POST['gt']; - $cruise = $_POST['cruise']; - $vb = $_POST['vb']; - $colo = $_POST['colo']; - $rc = $_POST['rc']; - $spy = $_POST['spy']; - $bomb = $_POST['bomb']; - $solar = $_POST['solar']; - $des = $_POST['des']; - $rip = $_POST['rip']; - $traq = $_POST['traq']; - - $SqlAdd = "UPDATE {{table}} SET"; - $SqlAdd .= "`light_hunter` = '".$cle."+light_hunter', "; - $SqlAdd .= "`heavy_hunter` = '".$clourd."+heavy_hunter', "; - $SqlAdd .= "`small_ship_cargo` = '".$pt."+small_ship_cargo', "; - $SqlAdd .= "`big_ship_cargo` = '".$gt."+big_ship_cargo', "; - $SqlAdd .= "`crusher` = '".$cruise."+crusher', "; - $SqlAdd .= "`battle_ship` = '".$vb."+battle_ship', "; - $SqlAdd .= "`colonizer` = '".$colo."+colonizer', "; - $SqlAdd .= "`recycler` = '".$rc."+recycler', "; - $SqlAdd .= "`spy_sonde`= '".$spy."+spy_sonde', "; - $SqlAdd .= "`bomber_ship` = '".$bomb."+bomber_ship', "; - $SqlAdd .= "`solar_satelit` = '".$solar."+solar_satelit', "; - $SqlAdd .= "`destructor` = '".$des."+destructor', "; - $SqlAdd .= "`dearth_star` = '".$rip."+dearth_star', "; - $SqlAdd .= "`battleship` = '".$traq."+battleship', "; - $SqlAdd .= " WHERE `id` = '".$id."' LIMIT 1"; - doquery($SqlAdd, "planets"); - message('Ajout OK'); - } - - $page = parsetemplate(gettemplate('admin/add_fleet'), $parse); - display( $page); - - } else { - message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } - -?> \ No newline at end of file diff --git a/admin/add_money.php b/admin/add_money.php deleted file mode 100644 index 87beb94..0000000 --- a/admin/add_money.php +++ /dev/null @@ -1,67 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { - includeLang('admin'); - - $mode = $_POST['mode']; - - $PageTpl = gettemplate("admin/add_money"); - $parse = $lang; - - if ($mode == 'addit') { - $id = $_POST['id']; - $metal = $_POST['metal']; - $cristal = $_POST['cristal']; - $deut = $_POST['deut']; - - $QryUpdatePlanet = "UPDATE {{table}} SET "; - $QryUpdatePlanet .= "`metal` = `metal` + '". $metal ."', "; - $QryUpdatePlanet .= "`crystal` = `crystal` + '". $cristal ."', "; - $QryUpdatePlanet .= "`deuterium` = `deuterium` + '". $deut ."' "; - $QryUpdatePlanet .= "WHERE "; - $QryUpdatePlanet .= "`id` = '". $id ."' "; - doquery( $QryUpdatePlanet, "planets"); - - AdminMessage ( $lang['adm_am_done'], $lang['adm_am_ttle'] ); - } - $Page = parsetemplate($PageTpl, $parse); - - display ($Page, $lang['adm_am_ttle'], false, '', true); - } else { - AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } - -?> \ No newline at end of file diff --git a/admin/mass_message.php b/admin/mass_message.php deleted file mode 100644 index 3d22c76..0000000 --- a/admin/mass_message.php +++ /dev/null @@ -1,66 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); - -function mass_message_run($parent){ - if($_POST["mode"] == "change"){ - if(isset($_POST["tresc"])&& $_POST["tresc"] != ''){ - $gameConfig['tresc'] = $parent->safe_get_post_var("tresc"); - } - if(isset($_POST["temat"])&& $_POST["temat"] != ''){ - $gameConfig['temat'] = $parent->safe_get_post_var("temat"); - } - $kolor = 'red'; - if($gameConfig['tresc'] !='' and $gameConfig['temat']){ - $sq = $parent->db->query("SELECT `id` FROM {{table}}","users"); - while($u = $parent->db->fetch_assoc($sq)){ - doquery("INSERT INTO {{table}} SET - `message_owner`='{$u['id']}', - `message_sender`='1' , - `message_time`='".time()."', - `message_type`='0', - `message_from`='Administracja', - `message_subject`='{$gameConfig['temat']}', - `message_text`='{$gameConfig['tresc']}' - ","messages"); - $parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users'); - } - $parent->smarty->assign("message","Wys�a�e� wiadomo�� do wszystkich graczy"); - } - } - $parent->smarty->display("mass_message.tpl"); -} - -function mass_message_info(){ - return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0"); -} \ No newline at end of file diff --git a/admin/messall.php b/admin/messall.php deleted file mode 100644 index a05bb0d..0000000 --- a/admin/messall.php +++ /dev/null @@ -1,75 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - if ($_POST && $mode == "change") { - if (isset($_POST["tresc"]) && $_POST["tresc"] != '') { - $gameConfig['tresc'] = $_POST['tresc']; - } - if (isset($_POST["temat"]) && $_POST["temat"] != '') { - $gameConfig['temat'] = $_POST['temat']; - } - if ($user['authlevel'] == LEVEL_ADMIN) { - $kolor = 'red'; - $ranga = 'Administrator'; - } elseif ($user['authlevel'] == LEVEL_OPERATOR) { - $kolor = 'skyblue'; - $ranga = 'Operator'; - } elseif ($user['authlevel'] == LEVEL_MODERATOR) { - $kolor = 'yellow'; - $ranga = 'Moderator'; - } - if ($gameConfig['tresc'] != '' and $gameConfig['temat']) { - $sq = doquery("SELECT `id` FROM {{table}}", "users"); - $Time = time(); - $From = "". $ranga ." ".$user['username'].""; - $Subject = "". $gameConfig['temat'] .""; - $Message = "". $gameConfig['tresc'] .""; - while ($u = $sq->fetch(PDO::FETCH_BOTH)) { - SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message); - } - message("Wys�a�e� wiadomo�� do wszystkich graczy", "Complete", "../overview." . PHPEXT, 3); - } - } else { - $parse = $gameConfig; - $parse['dpath'] = $dpath; - $parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":''; - $page .= parsetemplate(gettemplate('admin/messall_body'), $parse); - display($page, '', false,'', true); - } - } else { - message($lang['sys_noalloaw'], $lang['sys_noaccess']); - } -?> \ No newline at end of file diff --git a/admin/overview.php b/admin/overview.php deleted file mode 100644 index f89a7ed..0000000 --- a/admin/overview.php +++ /dev/null @@ -1,116 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - includeLang('admin'); - - if ($_GET['cmd'] == 'sort') { - $TypeSort = $_GET['type']; - } else { - $TypeSort = "id"; - } - - $PageTPL = gettemplate('admin/overview_body'); - $RowsTPL = gettemplate('admin/overview_rows'); - - $parse = $lang; - $parse['dpath'] = $dpath; - $parse['mf'] = $mf; - $parse['adm_ov_data_yourv'] = colorRed(VERSION); - - $Last15Mins = doquery("SELECT * FROM {{table}} WHERE `onlinetime` >= '". (time() - 15 * 60) ."' ORDER BY `". $TypeSort ."` ASC;", 'users'); - $Count = 0; - $Color = "lime"; - while ( $TheUser = mysql_fetch_array($Last15Mins) ) { - if ($PrevIP != "") { - if ($PrevIP == $TheUser['user_lastip']) { - $Color = "red"; - } else { - $Color = "lime"; - } - } - - $UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $TheUser['id'] . "';", 'statpoints', true); - $Bloc['dpath'] = $dpath; - $Bloc['adm_ov_altpm'] = $lang['adm_ov_altpm']; - $Bloc['adm_ov_wrtpm'] = $lang['adm_ov_wrtpm']; - $Bloc['adm_ov_data_id'] = $TheUser['id']; - $Bloc['adm_ov_data_name'] = $TheUser['username']; - $Bloc['adm_ov_data_agen'] = $TheUser['user_agent']; - $Bloc['current_page'] = $TheUser['current_page']; - $Bloc['usr_s_id'] = $TheUser['id']; - - $Bloc['adm_ov_data_clip'] = $Color; - $Bloc['adm_ov_data_adip'] = $TheUser['user_lastip']; - $Bloc['adm_ov_data_ally'] = $TheUser['ally_name']; - $Bloc['adm_ov_data_point'] = pretty_number ( $UserPoints['total_points'] ); - $Bloc['adm_ov_data_activ'] = pretty_time ( time() - $TheUser['onlinetime'] ); - $Bloc['adm_ov_data_pict'] = "m.gif"; - $PrevIP = $TheUser['user_lastip']; - - //Tweaks vue g�n�rale - $Bloc['usr_email'] = $TheUser['email']; - $Bloc['usr_xp_raid'] = $TheUser['xpraid']; - $Bloc['usr_xp_min'] = $TheUser['xpminier']; - - if ($TheUser['urlaubs_modus'] == 1) { - $Bloc['state_vacancy'] = ""; - } else { - $Bloc['state_vacancy'] = ""; - } - - if ($TheUser['bana'] == 1) { - $Bloc['is_banned'] = ""; - } else { - $Bloc['is_banned'] = $lang['is_banned_lang']; - } - $Bloc['usr_planet_gal'] = $TheUser['galaxy']; - $Bloc['usr_planet_sys'] = $TheUser['system']; - $Bloc['usr_planet_pos'] = $TheUser['planet']; - - - $parse['adm_ov_data_table'] .= parsetemplate( $RowsTPL, $Bloc ); - $Count++; - } - - $parse['adm_ov_data_count'] = $Count; - $Page = parsetemplate($PageTPL, $parse); - - display ( $Page, $lang['sys_overview'], false, '', true); - } else { - AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } - -?> diff --git a/admin/settings.php b/admin/settings.php deleted file mode 100644 index 3c5d441..0000000 --- a/admin/settings.php +++ /dev/null @@ -1,310 +0,0 @@ - - * 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 . - * - * --> 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); -define('IN_ADMIN', true); -require_once dirname(dirname(__FILE__)) .'/common.php'; - - -function DisplayGameSettingsPage ( $CurrentUser ) { - global $lang, $gameConfig; - - includeLang('admin/settings'); - - if (in_array((int) $CurrentUser['authlevel'], array(LEVEL_ADMIN))) { - if ($_POST['opt_save'] == "1") { - // Jeu Ouvert ou Ferm� ! - if (isset($_POST['closed']) && $_POST['closed'] == 'on') { - $gameConfig['game_disable'] = "1"; - $gameConfig['close_reason'] = addslashes( $_POST['close_reason'] ); - } else { - $gameConfig['game_disable'] = "0"; - $gameConfig['close_reason'] = ""; - } - - // Y a un News Frame ? ! - if (isset($_POST['newsframe']) && $_POST['newsframe'] == 'on') { - $gameConfig['OverviewNewsFrame'] = "1"; - $gameConfig['OverviewNewsText'] = addslashes( $_POST['NewsText'] ); - } else { - $gameConfig['OverviewNewsFrame'] = "0"; - $gameConfig['OverviewNewsText'] = ""; - } - - // Y a un TCHAT externe ?? - if (isset($_POST['chatframe']) && $_POST['chatframe'] == 'on') { - $gameConfig['OverviewExternChat'] = "1"; - $gameConfig['OverviewExternChatCmd'] = addslashes( $_POST['ExternChat'] ); - } else { - $gameConfig['OverviewExternChat'] = "0"; - $gameConfig['OverviewExternChatCmd'] = ""; - } - - if (isset($_POST['googlead']) && $_POST['googlead'] == 'on') { - $gameConfig['OverviewBanner'] = "1"; - $gameConfig['OverviewClickBanner'] = addslashes( $_POST['GoogleAds'] ); - } else { - $gameConfig['OverviewBanner'] = "0"; - $gameConfig['OverviewClickBanner'] = ""; - } - - // Y a un BANNER Frame ? - if (isset($_POST['bannerframe']) && $_POST['bannerframe'] == 'on') { - $gameConfig['ForumBannerFrame'] = "1"; - } else { - $gameConfig['ForumBannerFrame'] = "0"; - } - - // Mode Debug ou pas ! - if (isset($_POST['debug']) && $_POST['debug'] == 'on') { - $gameConfig['debug'] = "1"; - } else { - $gameConfig['debug'] = "0"; - } - - // Nom du Jeu - if (isset($_POST['game_name']) && $_POST['game_name'] != '') { - $gameConfig['game_name'] = $_POST['game_name']; - } - - // Adresse du Forum - if (isset($_POST['forum_url']) && $_POST['forum_url'] != '') { - $gameConfig['forum_url'] = $_POST['forum_url']; - } - - // Vitesse du Jeu - if (isset($_POST['game_speed']) && is_numeric($_POST['game_speed'])) { - $gameConfig['game_speed'] = $_POST['game_speed']; - } - - // Vitesse des Flottes - if (isset($_POST['fleet_speed']) && is_numeric($_POST['fleet_speed'])) { - $gameConfig['fleet_speed'] = $_POST['fleet_speed']; - } - - // Multiplicateur de Production - if (isset($_POST['resource_multiplier']) && is_numeric($_POST['resource_multiplier'])) { - $gameConfig['resource_multiplier'] = $_POST['resource_multiplier']; - } - - // Taille de la planete mère - if (isset($_POST['initial_fields']) && is_numeric($_POST['initial_fields'])) { - $gameConfig['initial_fields'] = $_POST['initial_fields']; - } - - // Revenu de base Metal - if (isset($_POST['metal_basic_income']) && is_numeric($_POST['metal_basic_income'])) { - $gameConfig['metal_basic_income'] = $_POST['metal_basic_income']; - } - - // Revenu de base Cristal - if (isset($_POST['crystal_basic_income']) && is_numeric($_POST['crystal_basic_income'])) { - $gameConfig['crystal_basic_income'] = $_POST['crystal_basic_income']; - } - - // Revenu de base Deuterium - if (isset($_POST['deuterium_basic_income']) && is_numeric($_POST['deuterium_basic_income'])) { - $gameConfig['deuterium_basic_income'] = $_POST['deuterium_basic_income']; - } - - // Revenu de base Energie - if (isset($_POST['energy_basic_income']) && is_numeric($_POST['energy_basic_income'])) { - $gameConfig['energy_basic_income'] = $_POST['energy_basic_income']; - } - - // Lien supplémentaire dans le menu - if (isset($_POST['enable_link_']) && is_numeric($_POST['enable_link_'])) { - $gameConfig['link_enable'] = $_POST['enable_link_']; - } - // Texte de ce lien... -$gameConfig['link_name'] = addslashes( $_POST['name_link_']); - - // URL de ce lien... -$gameConfig['link_url'] = $_POST['url_link_']; - // Image de la bannière -$gameConfig['banner_source_post'] = $_POST['banner_source_post']; - // 1 point = ??? Ressources ? - if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings'])) { - $gameConfig['stat_settings'] = $_POST['stat_settings']; - } - // Activation -ou non- des annonces - if (isset($_POST['enable_announces_']) && is_numeric($_POST['enable_announces_'])) { - $gameConfig['enable_announces'] = $_POST['enable_announces_']; - } - // Activation -ou non- du marchand - if (isset($_POST['enable_marchand_']) && is_numeric($_POST['enable_marchand_'])) { - $gameConfig['enable_marchand'] = $_POST['enable_marchand_']; - } - // Activation -ou non- des notes - if (isset($_POST['enable_notes_']) && is_numeric($_POST['enable_notes_'])) { - $gameConfig['enable_notes'] = $_POST['enable_notes_']; - } - // Nom du bot antimulti - $gameConfig['bot_name'] = addslashes( $_POST['name_bot']); - - // email du bot antimulti - $gameConfig['bot_adress'] = addslashes( $_POST['adress_bot']); - - // Activation -ou non- des notes - if (isset($_POST['duration_ban']) && is_numeric($_POST['duration_ban'])) { - $gameConfig['ban_duration'] = $_POST['duration_ban']; - } - - // Activation -ou non- du bot - if (isset($_POST['bot_enable']) && is_numeric($_POST['bot_enable'])) { - $gameConfig['enable_bot'] = $_POST['bot_enable']; - } - - // BBCode ou pas ? - - if (isset($_POST['bbcode_field']) && is_numeric($_POST['bbcode_field'])) { - $gameConfig['enable_bbcode'] = $_POST['bbcode_field']; - } - - // Activation du jeu - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_disable'] ."' WHERE `config_name` = 'game_disable';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['close_reason'] ."' WHERE `config_name` = 'close_reason';", 'config'); - - //Stats - - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['stat_settings'] ."' WHERE `config_name` = 'stat_settings';", 'config'); - - - // Configuration du Jeu - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['forum_url'] ."' WHERE `config_name` = 'forum_url';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_name'] ."' WHERE `config_name` = 'game_name';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_speed'] ."' WHERE `config_name` = 'game_speed';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['fleet_speed'] ."' WHERE `config_name` = 'fleet_speed';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['resource_multiplier'] ."' WHERE `config_name` = 'resource_multiplier';", 'config'); - - // Page Generale - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewNewsFrame'] ."' WHERE `config_name` = 'OverviewNewsFrame';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewNewsText'] ."' WHERE `config_name` = 'OverviewNewsText';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewExternChat'] ."' WHERE `config_name` = 'OverviewExternChat';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewExternChatCmd'] ."' WHERE `config_name` = 'OverviewExternChatCmd';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewBanner'] ."' WHERE `config_name` = 'OverviewBanner';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewClickBanner'] ."' WHERE `config_name` = 'OverviewClickBanner';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ForumBannerFrame'] ."' WHERE `config_name` = 'ForumBannerFrame';", 'config'); - - //Bannière - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['banner_source_post'] ."' WHERE `config_name` = 'banner_source_post';", 'config'); - - // Lien supplémentaire dans le menu - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_enable'] ."' WHERE `config_name` = 'link_enable';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_name'] ."' WHERE `config_name` = 'link_name';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_url'] ."' WHERE `config_name` = 'link_url';", 'config'); - - // Options Planete - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['initial_fields'] ."' WHERE `config_name` = 'initial_fields';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['metal_basic_income'] ."' WHERE `config_name` = 'metal_basic_income';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['crystal_basic_income'] ."' WHERE `config_name` = 'crystal_basic_income';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['deuterium_basic_income'] ."' WHERE `config_name` = 'deuterium_basic_income';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['energy_basic_income'] ."' WHERE `config_name` = 'energy_basic_income';", 'config'); - - //Bot antimulti - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['bot_name'] ."' WHERE `config_name` = 'bot_name';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['bot_adress'] ."' WHERE `config_name` = 'bot_adress';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ban_duration'] ."' WHERE `config_name` = 'ban_duration';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_bot'] ."' WHERE `config_name` = 'enable_bot';", 'config'); - - - //Réglage du BBCode - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_bbcode'] ."' WHERE `config_name` = 'enable_bbcode';", 'config'); - - - //Controle des pages - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_announces'] ."' WHERE `config_name` = 'enable_announces';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_marchand'] ."' WHERE `config_name` = 'enable_marchand';", 'config'); - doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_notes'] ."' WHERE `config_name` = 'enable_notes';", 'config'); - - // Mode Debug - doquery("UPDATE {{table}} SET `config_value` = '" .$gameConfig['debug'] ."' WHERE `config_name` ='debug'", 'config'); - AdminMessage ('Options changees avec succes !', 'Succes', '?'); - } else { - - $parse = $lang; - $parse['game_name'] = $gameConfig['game_name']; - $parse['game_speed'] = $gameConfig['game_speed']; - $parse['fleet_speed'] = $gameConfig['fleet_speed']; - $parse['resource_multiplier'] = $gameConfig['resource_multiplier']; - $parse['forum_url'] = $gameConfig['forum_url']; - $parse['initial_fields'] = $gameConfig['initial_fields']; - $parse['metal_basic_income'] = $gameConfig['metal_basic_income']; - $parse['crystal_basic_income'] = $gameConfig['crystal_basic_income']; - $parse['deuterium_basic_income'] = $gameConfig['deuterium_basic_income']; - $parse['energy_basic_income'] = $gameConfig['energy_basic_income']; - $parse['enable_link'] = $gameConfig['link_enable']; - $parse['name_link'] = $gameConfig['link_name']; - $parse['url_link'] = $gameConfig['link_url']; - $parse['enable_announces'] = $gameConfig['enable_announces']; - $parse['enable_marchand'] = $gameConfig['enable_marchand']; - $parse['enable_notes'] = $gameConfig['enable_notes']; - $parse['bot_name'] = stripslashes($gameConfig['bot_name']); - $parse['bot_adress'] = stripslashes($gameConfig['bot_adress']); - $parse['ban_duration'] = stripslashes($gameConfig['ban_duration']); - $parse['enable_bot'] = stripslashes($gameConfig['enable_bot']); - $parse['enable_bbcode'] = stripslashes($gameConfig['enable_bbcode']); - - $parse['banner_source_post'] = $gameConfig['banner_source_post']; - $parse['stat_settings'] = stripslashes($gameConfig['stat_settings']); - - - - $parse['closed'] = ($gameConfig['game_disable'] == 1) ? " checked = 'checked' ":""; - $parse['close_reason'] = stripslashes( $gameConfig['close_reason'] ); - - $parse['newsframe'] = ($gameConfig['OverviewNewsFrame'] == 1) ? " checked = 'checked' ":""; - $parse['NewsTextVal'] = stripslashes( $gameConfig['OverviewNewsText'] ); - - $parse['chatframe'] = ($gameConfig['OverviewExternChat'] == 1) ? " checked = 'checked' ":""; - $parse['ExtTchatVal'] = stripslashes( $gameConfig['OverviewExternChatCmd'] ); - - $parse['googlead'] = ($gameConfig['OverviewBanner'] == 1) ? " checked = 'checked' ":""; - $parse['GoogleAdVal'] = stripslashes( $gameConfig['OverviewClickBanner'] ); - - $parse['debug'] = ($gameConfig['debug'] == 1) ? " checked = 'checked' ":""; - - $parse['bannerframe'] = ($gameConfig['ForumBannerFrame'] == 1) ? " checked = 'checked' ":""; - - $PageTPL = gettemplate('admin/options_body'); - $Page .= parsetemplate( $PageTPL, $parse ); - - display ( $Page, $lang['adm_opt_title'], false, '', true ); - } - } else { - AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } - return $Page; -} - - $Page = DisplayGameSettingsPage ( $user ); - -?> diff --git a/ainfo.php b/ainfo.php deleted file mode 100644 index a1ae4f2..0000000 --- a/ainfo.php +++ /dev/null @@ -1,70 +0,0 @@ - - * 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 . - * - * --> 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'; - -$dpath = (!$userrow["dpath"]) ? DEFAULT_SKINPATH : $userrow["dpath"]; - - -if(!is_numeric($_GET["a"]) || !$_GET["a"] ){ message("Ungültige Allianz-ID","Fehler");} - -$allyrow = doquery("SELECT ally_name,ally_tag,ally_description,ally_web,ally_image FROM {{table}} WHERE id=".$_GET["a"],"alliance",true); - -if(!$allyrow){ message("Alliance non trouvée","Erreur");} - -$count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=".$_GET["a"].";","users",true); -$ally_member_scount = $count[0]; - -$page .=""; - - if($allyrow["ally_image"] != ""){ - $page .= ""; - } - - $page .= ""; - - if($allyrow["ally_description"] != ""){ - $page .= ""; - } - - - if($allyrow["ally_web"] != ""){ - $page .=" - - - "; - } - $page .= "
Informations sur l'alliance
Tag".$allyrow["ally_tag"]."
Nom".$allyrow["ally_name"]."
Membres$ally_member_scount
".$allyrow["ally_description"]."
Site internet".$allyrow["ally_web"]."
"; - - display($page,"Information sur l'alliance [".$allyrow["ally_name"]."]",false); - -?> \ No newline at end of file diff --git a/alliance.php b/alliance.php deleted file mode 100644 index 1301154..0000000 --- a/alliance.php +++ /dev/null @@ -1,1199 +0,0 @@ - - * 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 . - * - * --> 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('INSTALL' , false); - -$mode = $_GET['mode']; -if (empty($mode)) { unset($mode); } -$a = intval($_GET['a']); -if (empty($a)) { unset($a); } -$sort1 = intval($_GET['sort1']); -if (empty($sort1)) { unset($sort1); } -$sort2 = intval($_GET['sort2']); -if (empty($sort2)) { unset($sort2); } -$d = $_GET['d']; -if ((!is_numeric($d)) || (empty($d) && $d != 0)) - unset($d); - -$edit = $_GET['edit']; - -if (empty($edit)) - unset($edit); - -$rank = intval($_GET['rank']); -if (empty($rank)) - unset($rank); - -$kick = intval($_GET['kick']); -if (empty($kick)) - unset($kick); - -$id = intval($_GET['id']); -if (empty($id)) - unset($id); - -define('INSIDE' , true); -require_once dirname(__FILE__) .'/common.php'; - - -if(empty($user['id'])){ -echo ''; -} - -$mode = $_GET['mode']; -$yes = $_GET['yes']; -$edit = $_GET['edit']; -$allyid = intval($_GET['allyid']); -$show = intval($_GET['show']); -$sort = intval($_GET['sort']); -$sendmail = intval($_GET['sendmail']); -$t = $_GET['t']; -$a = intval($_GET['a']); -$tag = mysql_escape_string($_GET['tag']); - -includeLang('alliance'); - - -/* - Alianza consiste en tres partes. - La primera es la comun. Es decir, no se necesita comprobar si se esta en una alianza o no. - La segunda, es sin alianza. Eso implica las solicitudes. - La ultima, seria cuando ya se esta dentro de una. -*/ -// Parte inicial. - -if ($_GET['mode'] == 'ainfo') { - $a = intval($_GET['a']); - $tag = mysql_escape_string($_GET['tag']); - // Evitamos errores casuales xD - // query - $lang['Alliance_information'] = "Information Alliance"; - - if (isset($_GET['tag'])) { - $allyrow = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$tag}'", "alliance", true); - } elseif (is_numeric($a) && $a != 0) { - $allyrow = doquery("SELECT * FROM {{table}} WHERE id='{$a}'", "alliance", true); - } else { - message("Cette alliance n'existe pas !", "Information Alliance (1)"); - } - // Si no existe - if (!$allyrow) { - message("Cette alliance n'existe pas !", "Information Alliance (1)"); - } - extract($allyrow); - - if ($ally_image != "") { - $ally_image = ""; - } - - if ($ally_description != "") { - $ally_description = "{$ally_description}"; - } else - $ally_description = "Il n'y as aucune descriptions de cette alliance."; - - if ($ally_web != "") { - $ally_web = " - {$lang['Initial_page']} - {$ally_web} - "; - } - - $lang['ally_member_scount'] = $ally_members; - $lang['ally_name'] = $ally_name; - $lang['ally_tag'] = $ally_tag; - // codigo raro - $patterns[] = "#\[fc\]([a-z0-9\#]+)\[/fc\](.*?)\[/f\]#Ssi"; - $replacements[] = '\2'; - $patterns[] = '#\[img\](.*?)\[/img\]#Smi'; - $replacements[] = '\1'; - $patterns[] = "#\[fc\]([a-z0-9\#\ \[\]]+)\[/fc\]#Ssi"; - $replacements[] = ''; - $patterns[] = "#\[/f\]#Ssi"; - $replacements[] = ''; - $ally_description = preg_replace($patterns, $replacements, $ally_description); - - $lang['ally_description'] = nl2br($ally_description); - $lang['ally_image'] = $ally_image; - $lang['ally_web'] = $ally_web; - - if ($user['ally_id'] == 0) { - $lang['bewerbung'] = " - Candidature - Cliquer ici pour ecrire votre candidature - - "; - } else - $lang['bewerbung'] = "Candidature"; - - $page .= parsetemplate(gettemplate('alliance_ainfo'), $lang); - display($page, str_replace('%s', $ally_name, $lang['Info_of_Alliance'])); -} -// --[Comprobaciones de alianza]------------------------- -if ($user['ally_id'] == 0) { // Sin alianza - if ($mode == 'make' && $user['ally_request'] == 0) { // Make alliance - /* - Aca se crean las alianzas... - */ - if ($yes == 1 && $_POST) { - /* - Por el momento solo estoy improvisando, luego se perfeccionara el sistema :) - Creo que aqui se realiza una query para comprovar el nombre, y luego le pregunta si es el tag correcto... - */ - if (!$_POST['atag']) { - message($lang['have_not_tag'], $lang['make_alliance']); - } - if (!$_POST['aname']) { - message($lang['have_not_name'], $lang['make_alliance']); - } - $_POST['aname']=addslashes($_POST['aname']); - $_POST['atag']=addslashes($_POST['atag']); - - $tagquery = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$_POST['atag']}'", 'alliance', true); - - if ($tagquery) { - message(str_replace('%s', $_POST['atag'], $lang['always_exist']), $lang['make_alliance']); - } - - doquery("INSERT INTO {{table}} SET - `ally_name`='{$_POST['aname']}', - `ally_tag`='{$_POST['atag']}' , - `ally_owner`='{$user['id']}', - `ally_owner_range`='Leader', - `ally_members`='1', - `ally_register_time`=" . time() , "alliance"); - - $allyquery = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$_POST['atag']}'", 'alliance', true); - - doquery("UPDATE {{table}} SET - `ally_id`='{$allyquery['id']}', - `ally_name`='{$allyquery['ally_name']}', - `ally_register_time`='" . time() . "' - WHERE `id`='{$user['id']}'", "users"); - - $page = MessageForm(str_replace('%s', $_POST['atag'], $lang['ally_maked']), - - str_replace('%s', $_POST['atag'], $lang['alliance_has_been_maked']) . "

", "", $lang['Ok']); - } else { - $page .= parsetemplate(gettemplate('alliance_make'), $lang); - } - - display($page, $lang['make_alliance']); - } - - if ($mode == 'search' && $user['ally_request'] == 0) { // search one - - $parse = $lang; - $lang['searchtext'] = $_POST['searchtext']; - $page = parsetemplate(gettemplate('alliance_searchform'), $lang); - - if ($_POST) { // esta parte es igual que el buscador de search.php... - // searchtext - $search = doquery("SELECT * FROM {{table}} WHERE ally_name LIKE '%{$_POST['searchtext']}%' or ally_tag LIKE '%{$_POST['searchtext']}%' LIMIT 30", "alliance"); - - if (mysql_num_rows($search) != 0) { - $template = gettemplate('alliance_searchresult_row'); - - while ($s = $search->fetch(PDO::FETCH_BOTH)) { - $entry = array(); - $entry['ally_tag'] = "[{$s['ally_tag']}]"; - $entry['ally_name'] = $s['ally_name']; - $entry['ally_members'] = $s['ally_members']; - - $parse['result'] .= parsetemplate($template, $entry); - } - - $page .= parsetemplate(gettemplate('alliance_searchresult_table'), $parse); - } - } - - display($page, $lang['search_alliance']); - } - - if ($mode == 'apply' && $user['ally_request'] == 0) { // solicitudes - if (!is_numeric($_GET['allyid']) || !$_GET['allyid'] || $user['ally_request'] != 0 || $user['ally_id'] != 0) { - message($lang['it_is_not_posible_to_apply'], $lang['it_is_not_posible_to_apply']); - } - // pedimos la info de la alianza - $allyrow = doquery("SELECT ally_tag,ally_request FROM {{table}} WHERE id='" . intval($_GET['allyid']) . "'", "alliance", true); - - if (!$allyrow) { - message($lang['it_is_not_posible_to_apply'], $lang['it_is_not_posible_to_apply']); - } - - extract($allyrow); - - if ($_POST['further'] == $lang['Send']) { // esta parte es igual que el buscador de search.php... - doquery("UPDATE {{table}} SET `ally_request`='" . intval($allyid) . "', ally_request_text='" . mysql_escape_string(strip_tags($_POST['text'])) . "', ally_register_time='" . time() . "' WHERE `id`='" . $user['id'] . "'", "users"); - // mensaje de cuando se envia correctamente el mensaje - message($lang['apply_registered'], $lang['your_apply']); - // mensaje de cuando falla el envio - // message($lang['apply_cantbeadded'], $lang['your_apply']); - } else { - $text_apply = ($ally_request) ? $ally_request : $lang['There_is_no_a_text_apply']; - } - - $parse = $lang; - $parse['allyid'] = intval($_GET['allyid']); - $parse['chars_count'] = strlen($text_apply); - $parse['text_apply'] = $text_apply; - $parse['Write_to_alliance'] = str_replace('%s', $ally_tag, $lang['Write_to_alliance']); - - $page = parsetemplate(gettemplate('alliance_applyform'), $parse); - - display($page, $lang['Write_to_alliance']); - } - - if ($user['ally_request'] != 0) { // Esperando una respuesta - // preguntamos por el ally_tag - $allyquery = doquery("SELECT ally_tag FROM {{table}} WHERE id='" . intval($user['ally_request']) . "' ORDER BY `id`", "alliance", true); - - extract($allyquery); - if ($_POST['bcancel']) { - doquery("UPDATE {{table}} SET `ally_request`=0 WHERE `id`=" . $user['id'], "users"); - - $lang['request_text'] = str_replace('%s', $ally_tag, $lang['Canceled_a_request_text']); - $lang['button_text'] = $lang['Ok']; - $page = parsetemplate(gettemplate('alliance_apply_waitform'), $lang); - } else { - $lang['request_text'] = str_replace('%s', $ally_tag, $lang['Waiting_a_request_text']); - $lang['button_text'] = $lang['Delete_apply']; - $page = parsetemplate(gettemplate('alliance_apply_waitform'), $lang); - } - // mysql_escape_string(strip_tags()); - display($page, "Deine Anfrage"); - } else { // Vista sin allianza - /* - Vista normal de cuando no se tiene ni solicitud ni alianza - */ - $page .= parsetemplate(gettemplate('alliance_defaultmenu'), $lang); - display($page, $lang['alliance']); - } -} - -//--------------------------------------------------------------------------------------------------------------------------------------------------- -// Parte de adentro de la alianza -elseif ($user['ally_id'] != 0 && $user['ally_request'] == 0) { // Con alianza - - $ally = doquery("SELECT * FROM {{table}} WHERE id='{$user['ally_id']}'", "alliance", true); - - $ally_ranks = unserialize($ally['ally_ranks']); - - $allianz_raenge = unserialize($ally['ally_ranks']); - - if ($allianz_raenge[$user['ally_rank_id']-1]['onlinestatus'] == 1 || $ally['ally_owner'] == $user['id']) { - $user_can_watch_memberlist_status = true; - } else - $user_can_watch_memberlist_status = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['memberlist'] == 1 || $ally['ally_owner'] == $user['id']) { - $user_can_watch_memberlist = true; - } else - $user_can_watch_memberlist = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['mails'] == 1 || $ally['ally_owner'] == $user['id']) { - $user_can_send_mails = true; - } else - $user_can_send_mails = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['kick'] == 1 || $ally['ally_owner'] == $user['id']) { - $user_can_kick = true; - } else - $user_can_kick = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['rechtehand'] == 1 || $ally['ally_owner'] == $user['id']) - $user_can_edit_rights = true; - else - $user_can_edit_rights = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['delete'] == 1 || $ally['ally_owner'] == $user['id']) - $user_can_exit_alliance = true; - else - $user_can_exit_alliance = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['bewerbungen'] == 1 || $ally['ally_owner'] == $user['id']) - $user_bewerbungen_einsehen = true; - else - $user_bewerbungen_einsehen = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['bewerbungenbearbeiten'] == 1 || $ally['ally_owner'] == $user['id']) - $user_bewerbungen_bearbeiten = true; - else - $user_bewerbungen_bearbeiten = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['administrieren'] == 1 || $ally['ally_owner'] == $user['id']) - $user_admin = true; - else - $user_admin = false; - - if ($allianz_raenge[$user['ally_rank_id']-1]['onlinestatus'] == 1 || $ally['ally_owner'] == $user['id']) - $user_onlinestatus = true; - else - $user_onlinestatus = false; - - if (!$ally) { - doquery("UPDATE {{table}} SET `ally_name`='',`ally_id`=0 WHERE `id`='{$user['id']}'", "users"); - message($lang['ally_notexist'], $lang['your_alliance'], 'alliance.php'); - } - - if ($mode == 'exit') { - if ($ally['ally_owner'] == $user['id']) { - message($lang['Owner_cant_go_out'], $lang['Alliance']); - } - // se sale de la alianza - if ($_GET['yes'] == 1) { - doquery("UPDATE {{table}} SET `ally_id`=0, `ally_name` = '' WHERE `id`='{$user['id']}'", "users"); - $lang['Go_out_welldone'] = str_replace("%s", $ally_name, $lang['Go_out_welldone']); - $page = MessageForm($lang['Go_out_welldone'], "
", $PHP_SELF, $lang['Ok']); - // Se quitan los puntos del user en la alianza - } else { - // se pregunta si se quiere salir - $lang['Want_go_out'] = str_replace("%s", $ally_name, $lang['Want_go_out']); - $page = MessageForm($lang['Want_go_out'], "
", "?mode=exit&yes=1", "Oui"); - } - display($page); - } - - if ($mode == 'memberslist') { // Lista de miembros. - /* - Lista de miembros. - Por lo que parece solo se hace una query fijandose los usuarios con el mismo ally_id. - seguido del query del planeta principal de cada uno para sacarle la posicion, pero - voy a ver si tambien agrego las cordenadas en el id user... - */ - // obtenemos el array de los rangos - // $ally_ranks = unserialize($ally['ally_ranks']); - $allianz_raenge = unserialize($ally['ally_ranks']); - // $user_can_watch_memberlist - // comprobamos el permiso - if ($ally['ally_owner'] != $user['id'] && !$user_can_watch_memberlist) { - message($lang['Denied_access'], $lang['Members_list']); - } - // El orden de aparicion - if ($sort2) { - $sort1 = intval($_GET['sort1']); - $sort2 = intval($_GET['sort2']); - - if ($sort1 == 1) { - $sort = " ORDER BY `username`"; - } elseif ($sort1 == 2) { - $sort = " ORDER BY `username`"; - } elseif ($sort1 == 4) { - $sort = " ORDER BY `ally_register_time`"; - } elseif ($sort1 == 5) { - $sort = " ORDER BY `onlinetime`"; - } else { - $sort = " ORDER BY `id`"; - } - - if ($sort2 == 1) { - $sort .= " DESC;"; - } elseif ($sort2 == 2) { - $sort .= " ASC;"; - } - $listuser = doquery("SELECT * FROM {{table}} WHERE ally_id='{$user['ally_id']}'{$sort}", 'users'); - } else { - $listuser = doquery("SELECT * FROM {{table}} WHERE ally_id='{$user['ally_id']}'", 'users'); - } - // contamos la cantidad de usuarios. - $i = 0; - // Como es costumbre. un row template - $template = gettemplate('alliance_memberslist_row'); - $page_list = ''; - while ($u = $listuser->fetch(PDO::FETCH_BOTH)) { - $UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $u['id'] . "';", 'statpoints', true); - - $i++; - $u['i'] = $i; - - if ($u["onlinetime"] + 60 * 10 >= time() && $user_can_watch_memberlist_status) { - $u["onlinetime"] = "lime>{$lang['On']}<"; - } elseif ($u["onlinetime"] + 60 * 20 >= time() && $user_can_watch_memberlist_status) { - $u["onlinetime"] = "yellow>{$lang['15_min']}<"; - } elseif ($user_can_watch_memberlist_status) { - $u["onlinetime"] = "red>{$lang['Off']}<"; - } else $u["onlinetime"] = "orange>-<"; - // Nombre de rango - if ($ally['ally_owner'] == $u['id']) { - $u["ally_range"] = ($ally['ally_owner_range'] == '')?"Leader":$ally['ally_owner_range']; - } elseif (isset($allianz_raenge[$u['ally_rank_id']]['name'])) { - $u["ally_range"] = $allianz_raenge[$u['ally_rank_id']]['name']; - } else { - $u["ally_range"] = $lang['Novate']; - } - - $u["dpath"] = $dpath; - $u['points'] = "" . pretty_number($UserPoints['total_points']) . ""; - - if ($u['ally_register_time'] > 0) - $u['ally_register_time'] = date("Y-m-d h:i:s", $u['ally_register_time']); - else - $u['ally_register_time'] = "-"; - - $page_list .= parsetemplate($template, $u); - } - // para cambiar el link de ordenar. - if ($sort2 == 1) { - $s = 2; - } elseif ($sort2 == 2) { - $s = 1; - } else { - $s = 1; - } - - if ($i != $ally['ally_members']) { - doquery("UPDATE {{table}} SET `ally_members`='{$i}' WHERE `id`='{$ally['id']}'", 'alliance'); - } - - $parse = $lang; - $parse['i'] = $i; - $parse['s'] = $s; - $parse['list'] = $page_list; - - $page .= parsetemplate(gettemplate('alliance_memberslist_table'), $parse); - - display($page, $lang['Members_list']); - } - - if ($mode == 'circular') { // Correo circular - /* - Mandar un correo circular. - creo que aqui tendria que ver yo como crear el sistema de mensajes... - */ - // un loop para mostrar losrangos - $allianz_raenge = unserialize($ally['ally_ranks']); - // comprobamos el permiso - if ($ally['ally_owner'] != $user['id'] && !$user_can_send_mails) { - message($lang['Denied_access'], $lang['Send_circular_mail']); - } - - if ($sendmail == 1) { - $_POST['r'] = intval($_POST['r']); - $_POST['text'] = mysql_escape_string(strip_tags($_POST['text'])); - - if ($_POST['r'] == 0) { - $sq = doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user['ally_id']}'", "users"); - } else { - $sq = doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user['ally_id']}' AND ally_rank_id='{$_POST['r']}'", "users"); - } - // looooooop - $list = ''; - while ($u = $sq->fetch(PDO::FETCH_BOTH)) { - doquery("INSERT INTO {{table}} SET - `message_owner`='{$u['id']}', - `message_sender`='{$user['id']}' , - `message_time`='" . time() . "', - `message_type`='2', - `message_from`='{$ally['ally_tag']}', - `message_subject`='{$user['username']}', - `message_text`='{$_POST['text']}' - ", "messages"); - $list .= "
{$u['username']} "; - } - // doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user['ally_id']}' ORDER BY `id`","users"); - doquery("UPDATE {{table}} SET `new_message`=new_message+1 WHERE ally_id='{$user['ally_id']}' AND ally_rank_id='{$_POST['r']}'", "users"); - doquery("UPDATE {{table}} SET `mnl_alliance`=mnl_alliance+1 WHERE ally_id='{$user['ally_id']}' AND ally_rank_id='{$_POST['r']}'", "users"); - /* - Aca un mensajito diciendo que a quien se mando. - */ - $page = MessageForm($lang['Circular_sended'], "Les membres suivants ont re�u un message:" . $list, "alliance.php", $lang['Ok'], true); - display($page, $lang['Send_circular_mail']); - } - - $lang['r_list'] = ""; - if ($allianz_raenge) { - foreach($allianz_raenge as $id => $array) { - $lang['r_list'] .= ""; - } - } - - $page .= parsetemplate(gettemplate('alliance_circular'), $lang); - - display($page, $lang['Send_circular_mail']); - } - - if ($mode == 'admin' && $edit == 'rights') { // Administrar leyes - $allianz_raenge = unserialize($ally['ally_ranks']); - - if ($ally['ally_owner'] != $user['id'] && !$user_can_edit_rights) { - message($lang['Denied_access'], $lang['Members_list']); - } elseif (!empty($_POST['newrangname'])) { - $name = mysql_escape_string(strip_tags($_POST['newrangname'])); - - $allianz_raenge[] = array('name' => $name, - 'mails' => 0, - 'delete' => 0, - 'kick' => 0, - 'bewerbungen' => 0, - 'administrieren' => 0, - 'bewerbungenbearbeiten' => 0, - 'memberlist' => 0, - 'onlinestatus' => 0, - 'rechtehand' => 0 - ); - - $ranks = serialize($allianz_raenge); - - doquery("UPDATE {{table}} SET `ally_ranks`='" . $ranks . "' WHERE `id`=" . $ally['id'], "alliance"); - - $goto = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']; - - header("Location: " . $goto); - exit(); - } elseif ($_POST['id'] != '' && is_array($_POST['id'])) { - $ally_ranks_new = array(); - - foreach ($_POST['id'] as $id) { - $name = $allianz_raenge[$id]['name']; - - $ally_ranks_new[$id]['name'] = $name; - - if (isset($_POST['u' . $id . 'r0'])) { - $ally_ranks_new[$id]['delete'] = 1; - } else { - $ally_ranks_new[$id]['delete'] = 0; - } - - if (isset($_POST['u' . $id . 'r1']) && $ally['ally_owner'] == $user['id']) { - $ally_ranks_new[$id]['kick'] = 1; - } else { - $ally_ranks_new[$id]['kick'] = 0; - } - - if (isset($_POST['u' . $id . 'r2'])) { - $ally_ranks_new[$id]['bewerbungen'] = 1; - } else { - $ally_ranks_new[$id]['bewerbungen'] = 0; - } - - if (isset($_POST['u' . $id . 'r3'])) { - $ally_ranks_new[$id]['memberlist'] = 1; - } else { - $ally_ranks_new[$id]['memberlist'] = 0; - } - - if (isset($_POST['u' . $id . 'r4'])) { - $ally_ranks_new[$id]['bewerbungenbearbeiten'] = 1; - } else { - $ally_ranks_new[$id]['bewerbungenbearbeiten'] = 0; - } - - if (isset($_POST['u' . $id . 'r5'])) { - $ally_ranks_new[$id]['administrieren'] = 1; - } else { - $ally_ranks_new[$id]['administrieren'] = 0; - } - - if (isset($_POST['u' . $id . 'r6'])) { - $ally_ranks_new[$id]['onlinestatus'] = 1; - } else { - $ally_ranks_new[$id]['onlinestatus'] = 0; - } - - if (isset($_POST['u' . $id . 'r7'])) { - $ally_ranks_new[$id]['mails'] = 1; - } else { - $ally_ranks_new[$id]['mails'] = 0; - } - - if (isset($_POST['u' . $id . 'r8'])) { - $ally_ranks_new[$id]['rechtehand'] = 1; - } else { - $ally_ranks_new[$id]['rechtehand'] = 0; - } - } - - $ranks = serialize($ally_ranks_new); - - doquery("UPDATE {{table}} SET `ally_ranks`='" . $ranks . "' WHERE `id`=" . $ally['id'], "alliance"); - - $goto = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']; - - header("Location: " . $goto); - exit(); - } - // borrar una entrada - elseif (isset($d) && isset($ally_ranks[$d])) { - unset($ally_ranks[$d]); - $ally['ally_rank'] = serialize($ally_ranks); - - doquery("UPDATE {{table}} SET `ally_ranks`='{$ally['ally_rank']}' WHERE `id`={$ally['id']}", "alliance"); - } - - if (count($ally_ranks) == 0 || $ally_ranks == '') { // si no hay rangos - $list = "{$lang['There_is_not_range']}"; - } else { // Si hay rangos - // cargamos la template de tabla - $list = parsetemplate(gettemplate('alliance_admin_laws_head'), $lang); - $template = gettemplate('alliance_admin_laws_row'); - // Creamos la lista de rangos - $i = 0; - - foreach($ally_ranks as $a => $b) { - if ($ally['ally_owner'] == $user['id']) { - // $i++;u2r5 - $lang['id'] = $a; - $lang['delete'] = "\"{$lang['Delete_range']}\""; - $lang['r0'] = $b['name']; - $lang['a'] = $a; - $lang['r1'] = ""; //{$b[1]} - $lang['r2'] = ""; - $lang['r3'] = ""; - $lang['r4'] = ""; - $lang['r5'] = ""; - $lang['r6'] = ""; - $lang['r7'] = ""; - $lang['r8'] = ""; - $lang['r9'] = ""; - - $list .= parsetemplate($template, $lang); - } else { - $lang['id'] = $a; - $lang['r0'] = $b['name']; - $lang['delete'] = "\"{$lang['Delete_range']}\""; - $lang['a'] = $a; - $lang['r1'] = "-"; - $lang['r2'] = ""; - $lang['r3'] = ""; - $lang['r4'] = ""; - $lang['r5'] = ""; - $lang['r6'] = ""; - $lang['r7'] = ""; - $lang['r8'] = ""; - $lang['r9'] = ""; - - $list .= parsetemplate($template, $lang); - } - } - - if (count($ally_ranks) != 0) { - $list .= parsetemplate(gettemplate('alliance_admin_laws_feet'), $lang); - } - } - - $lang['list'] = $list; - $lang['dpath'] = $dpath; - $page .= parsetemplate(gettemplate('alliance_admin_laws'), $lang); - - display($page, $lang['Law_settings']); - } - - if ($mode == 'admin' && $edit == 'ally') { // Administrar la alianza *pendiente urgente* - if ($t != 1 && $t != 2 && $t != 3) { - $t = 1; - } - // post! - if ($_POST) { - if (!get_magic_quotes_gpc()) { - $_POST['owner_range'] = stripslashes($_POST['owner_range']); - $_POST['web'] = stripslashes($_POST['web']); - $_POST['image'] = stripslashes($_POST['image']); - $_POST['text'] = stripslashes($_POST['text']); - } - } - - if ($_POST['options']) { - $ally['ally_owner_range'] = mysql_escape_string(htmlspecialchars(strip_tags($_POST['owner_range']))); - - $ally['ally_web'] = mysql_escape_string(htmlspecialchars(strip_tags($_POST['web']))); - - $ally['ally_image'] = mysql_escape_string(htmlspecialchars(strip_tags($_POST['image']))); - - $ally['ally_request_notallow'] = intval($_POST['request_notallow']); - - if ($ally['ally_request_notallow'] != 0 && $ally['ally_request_notallow'] != 1) { - message("Aller � \"Candidature\" et sur une option dans le formulaire!", "Erreur"); - exit; - } - - doquery("UPDATE {{table}} SET - `ally_owner_range`='{$ally['ally_owner_range']}', - `ally_image`='{$ally['ally_image']}', - `ally_web`='{$ally['ally_web']}', - `ally_request_notallow`='{$ally['ally_request_notallow']}' - WHERE `id`='{$ally['id']}'", "alliance"); - } elseif ($_POST['t']) { - if ($t == 3) { - $ally['ally_request'] = mysql_escape_string(strip_tags($_POST['text'])); - - doquery("UPDATE {{table}} SET - `ally_request`='{$ally['ally_request']}' - WHERE `id`='{$ally['id']}'", "alliance"); - } elseif ($t == 2) { - $ally['ally_text'] = mysql_escape_string(strip_tags($_POST['text'])); - doquery("UPDATE {{table}} SET - `ally_text`='{$ally['ally_text']}' - WHERE `id`='{$ally['id']}'", "alliance"); - } else { - $ally['ally_description'] = mysql_escape_string(strip_tags(stripslashes($_POST['text']))); - - doquery("UPDATE {{table}} SET - `ally_description`='" . $ally['ally_description'] . "' - WHERE `id`='{$ally['id']}'", "alliance"); - } - } - $lang['dpath'] = $dpath; - /* - Depende del $t, muestra el formulario para cada tipo de texto. - */ - if ($t == 3) { - $lang['request_type'] = $lang['Show_of_request_text']; - } elseif ($t == 2) { - $lang['request_type'] = $lang['Internal_text_of_alliance']; - } else { - $lang['request_type'] = $lang['Public_text_of_alliance']; - } - - if ($t == 2) { - $lang['text'] = $ally['ally_text']; - $lang['Texts'] = "Texte Interne"; - $lang['Show_of_request_text'] = "Texte Interne d'ALliance"; - } else { - $lang['text'] = $ally['ally_description']; - } - - if ($t == 3) { - } - $lang['t'] = $t; - - $lang['ally_web'] = $ally['ally_web']; - $lang['ally_image'] = $ally['ally_image']; - $lang['ally_request_notallow_0'] = (($ally['ally_request_notallow'] == 1) ? ' SELECTED' : ''); - $lang['ally_request_notallow_1'] = (($ally['ally_request_notallow'] == 0) ? ' SELECTED' : ''); - $lang['ally_owner_range'] = $ally['ally_owner_range']; - $lang['Transfer_alliance'] = MessageForm("Abandonner / Transférer L'alliance", "", "?mode=admin&edit=give", $lang['Continue']); - $lang['Disolve_alliance'] = MessageForm("Dissoudre L'alliance", "", "?mode=admin&edit=exit", $lang['Continue']); - - $page .= parsetemplate(gettemplate('alliance_admin'), $lang); - display($page, $lang['Alliance_admin']); - } - - if ($mode == 'admin' && $edit == 'give') { - if ($_POST["id"]) { - doquery("update {{table}} set `ally_owner`='".$_POST["id"]."' where `id`='".$user['ally_id']."'",'alliance'); - } else { - $selection=doquery("SELECT * FROM {{table}} where ally_id='".$user['ally_id']."'",'users'); - $select=''; -while ($data = $selection->fetch(PDO::FETCH_BOTH)){ - $select.='