diff --git a/.gitignore b/.gitignore index 24b99ed..c40f034 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ config.php .idea/ coverage/ src/application/cache/* -src/application/configs/local.php diff --git a/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php b/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php index ba30531..c4fc32e 100644 --- a/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php +++ b/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php @@ -351,8 +351,8 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('planets')} ( `gauss_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, `ionic_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, `buster_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, - `small_protection_shield` ENUM('0','1') NOT NULL DEFAULT '0', - `big_protection_shield` ENUM('0','1') NOT NULL DEFAULT '0', + `small_protection_shield` ENUM('0','1') NOT NULL DEFAULT 0, + `big_protection_shield` ENUM('0','1') NOT NULL DEFAULT 0, `interceptor_misil` SMALLINT NOT NULL DEFAULT 0, `interplanetary_misil` SMALLINT NOT NULL DEFAULT 0, `metal_mine_porcent` TINYINT NOT NULL DEFAULT 10, diff --git a/src/includes/functions/SendSimpleMessage.php b/src/includes/functions/SendSimpleMessage.php index 3d2b0ab..3e19e1c 100644 --- a/src/includes/functions/SendSimpleMessage.php +++ b/src/includes/functions/SendSimpleMessage.php @@ -49,7 +49,7 @@ function SendSimpleMessage ( $Owner, $Sender, $Time, $Type, $From, $Subject, $Me $QryInsertMessage = "INSERT INTO {{table}} SET "; $QryInsertMessage .= "`message_owner` = '". $Owner ."', "; $QryInsertMessage .= "`message_sender` = '". $Sender ."', "; -// $QryInsertMessage .= "`message_time` = '" . $Time . "', "; + $QryInsertMessage .= "`message_time` = '" . $Time . "', "; $QryInsertMessage .= "`message_type` = '". $Type ."', "; $QryInsertMessage .= "`message_from` = '". addslashes( $From ) ."', "; $QryInsertMessage .= "`message_subject` = '". addslashes( $Subject ) ."', "; diff --git a/src/marchand.php b/src/marchand.php index ed76401..6f6876e 100644 --- a/src/marchand.php +++ b/src/marchand.php @@ -39,13 +39,13 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) { $parse = $lang; - if (isset($_POST['ress']) && $_POST['ress'] != '') { + if ($_POST['ress'] != '') { $PageTPL = gettemplate('message_body'); $Error = false; $CheatTry = false; - $Metal = isset($_POST['metal']) ? $_POST['metal'] : 0; - $Crystal = isset($_POST['cristal']) ? $_POST['cristal'] : 0; - $Deuterium = isset($_POST['deut']) ? $_POST['deut'] : 0; + $Metal = $_POST['metal']; + $Crystal = $_POST['cristal']; + $Deuterium = $_POST['deut']; if ($Metal < 0) { $Metal *= -1; $CheatTry = true; @@ -72,8 +72,8 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) { case 'cristal': $Necessaire = (( $Metal * 0.5) + ( $Deuterium * 2)); - if ($CurrentPlanet['cristal'] > $Necessaire) { - $CurrentPlanet['cristal'] -= $Necessaire; + if ($CurrentPlanet['crystal'] > $Necessaire) { + $CurrentPlanet['crystal'] -= $Necessaire; } else { $Message = $lang['mod_ma_noten'] ." ". $lang['Crystal'] ."! "; $Error = true; @@ -94,17 +94,17 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) { if ($Error == false) { if ($CheatTry == true) { $CurrentPlanet['metal'] = 0; - $CurrentPlanet['cristal'] = 0; + $CurrentPlanet['crystal'] = 0; $CurrentPlanet['deuterium'] = 0; } else { $CurrentPlanet['metal'] += $Metal; - $CurrentPlanet['cristal'] += $Crystal; + $CurrentPlanet['crystal'] += $Crystal; $CurrentPlanet['deuterium'] += $Deuterium; } $QryUpdatePlanet = "UPDATE {{table}} SET "; $QryUpdatePlanet .= "`metal` = '". $CurrentPlanet['metal'] ."', "; - $QryUpdatePlanet .= "`cristal` = '". $CurrentPlanet['cristal'] ."', "; + $QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet['crystal'] ."', "; $QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet['deuterium'] ."' "; $QryUpdatePlanet .= "WHERE "; $QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."';"; @@ -118,7 +118,7 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) { } $parse['mes'] = $Message; } else { - if (!isset($_POST['action']) || $_POST['action'] != 2) { + if ($_POST['action'] != 2) { $PageTPL = gettemplate('marchand_main'); } else { $parse['mod_ma_res'] = "1"; @@ -145,7 +145,8 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) { $Page = parsetemplate ( $PageTPL, $parse ); return $Page; } - $Page = ModuleMarchand ( $user, $planet ); + + $Page = ModuleMarchand ( $user, $planetrow ); display ( $Page, $lang['mod_marchand'], true, '', false ); // ----------------------------------------------------------------------------------------------------------- diff --git a/src/messages.php b/src/messages.php index 9d080e5..bb8bb1d 100644 --- a/src/messages.php +++ b/src/messages.php @@ -40,11 +40,11 @@ if(!isset($user['authlevel'])) { includeLang('messages'); -$OwnerID = isset($_GET['id']) ? $_GET['id'] : null; -$MessCategory = isset($_GET['messcat']) ? $_GET['messcat'] : null; -$MessPageMode = isset($_GET['mode']) ? (string) $_GET['mode'] : null; -$DeleteWhat = isset($_POST['deletemessages']) ? $_POST['deletemessages'] : null; -if (!empty($DeleteWhat)) { +$OwnerID = $_GET['id']; +$MessCategory = $_GET['messcat']; +$MessPageMode = (string) $_GET['mode']; +$DeleteWhat = $_POST['deletemessages']; +if (isset ($DeleteWhat)) { $MessPageMode = "delete"; } @@ -55,9 +55,6 @@ $MessageType = array (0, 1, 2, 3, 4, 5, 15, 99, 100 ); $TitleColor = array (0 => '#FFFF00', 1 => '#FF6699', 2 => '#FF3300', 3 => '#FF9900', 4 => '#773399', 5 => '#009933', 15 => '#030070', 99 => '#007070', 100 => '#ABABAB'); $BackGndColor = array (0 => '#663366', 1 => '#336666', 2 => '#000099', 3 => '#666666', 4 => '#999999', 5 => '#999999', 15 => '#999999', 99 => '#999999', 100 => '#999999'); -$page = null; -$text = null; - for ($MessType = 0; $MessType < 101; $MessType++) { if (in_array($MessType, $MessageType) ) { $WaitingMess[$MessType] = $UnRead[$messfields[$MessType]]; @@ -233,7 +230,7 @@ $Message = trim ( nl2br ( strip_tags ( $_POST['text'], '
' ) ) ); } $page .= "". stripslashes( $CurMess['message_subject'] ) ." "; if ($CurMess['message_type'] == 1) { $page .= ""; - $page .= "\"".$lang['mess_answer']."\""; + $page .= "\"".$lang['mess_answer']."\""; } else { $page .= ""; } @@ -257,12 +254,12 @@ $Message = trim ( nl2br ( strip_tags ( $_POST['text'], '
' ) ) ); } $page .= "\n"; $page .= ""; $page .= ""; - $page .= "". date("d-m-Y H:i:s", strtotime($CurMess['message_time'])) .""; + $page .= "". date("m-d H:i:s O", $CurMess['message_time']) .""; $page .= "". stripslashes( $CurMess['message_from'] ) .""; $page .= "". stripslashes( $CurMess['message_subject'] ) ." "; if ($CurMess['message_type'] == 1) { $page .= ""; - $page .= "\"".$lang['mess_answer']."\""; + $page .= "\"".$lang['mess_answer']."\""; } else { $page .= ""; } diff --git a/src/options.php b/src/options.php index 8490b7a..a33c7bb 100644 --- a/src/options.php +++ b/src/options.php @@ -49,19 +49,19 @@ $mode = isset($_GET['mode']) ? $_GET['mode'] : null; message($lang['You_cant_exit_vmode'], $lan['Error'] ,"options.php",1); } } - - $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; if ($_POST && $mode == "change") { // Array ( [db_character] - $iduser = $user["id"]; - $avatar = $_POST["avatar"]; + $iduser = $user["id"]; + $avatar = $_POST["avatar"]; - if ($_POST["dpath"] != "") - $dpath = $_POST["dpath"]; + if ($_POST["dpath"] != "") + $dpath = $_POST["dpath"]; + else + $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; // Gestion des options speciales pour les admins if ($user['authlevel'] != LEVEL_PLAYER) { - if (isset($_POST['adm_pl_prot']) && $_POST['adm_pl_prot'] == 'on') { + if ($_POST['adm_pl_prot'] == 'on') { doquery ("UPDATE {{table}} SET `id_level` = '".$user['authlevel']."' WHERE `id_owner` = '".$user['id']."';", 'planets'); } else { doquery ("UPDATE {{table}} SET `id_level` = '0' WHERE `id_owner` = '".$user['id']."';", 'planets'); @@ -191,7 +191,10 @@ $mode = isset($_GET['mode']) ? $_GET['mode'] : null; `settings_bud` = '$settings_bud', `settings_mis` = '$settings_mis', `settings_rep` = '$settings_rep', - `db_deaktjava` = '$db_deaktjava' + `db_deaktjava` = '$db_deaktjava', + `kolorminus` = '$kolorminus', + `kolorplus` = '$kolorplus', + `kolorpoziom` = '$kolorpoziom' WHERE `id` = '$iduser' LIMIT 1", "users"); if (isset($_POST["db_password"]) && md5($_POST["db_password"]) == $user["password"]) { @@ -247,7 +250,7 @@ $mode = isset($_GET['mode']) ? $_GET['mode'] : null; $parse['opt_modev_data'] = ($user['urlaubs_modus'] == 1)?" checked='checked'/":''; $parse['opt_modev_exit'] = ($user['urlaubs_modus'] == 0)?" checked='1'/":''; $parse['Vaccation_mode'] = $lang['Vaccation_mode']; - $parse['vacation_until'] = date("d.m.Y G:i:s",$user['urlaubs_until']->getTimestamp()); + $parse['vacation_until'] = date("d.m.Y G:i:s",$user['urlaubs_until']); $parse['user_settings_rep'] = ($user['settings_rep'] == 1) ? " checked='checked'/":''; $parse['user_settings_esp'] = ($user['settings_esp'] == 1) ? " checked='checked'/":''; $parse['user_settings_wri'] = ($user['settings_wri'] == 1) ? " checked='checked'/":''; diff --git a/src/resources.php b/src/resources.php index 0d0ff77..222c86d 100644 --- a/src/resources.php +++ b/src/resources.php @@ -252,7 +252,7 @@ $user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); $planet = $user->getCurrentPlanet(); $Page = BuildRessourcePage($user, $planet); -display($Page, 'Resources', false); +display($Page, $lang['Resources']); // ----------------------------------------------------------------------------------------------------------- // History version diff --git a/src/search.php b/src/search.php index 5b469f5..7a90a53 100644 --- a/src/search.php +++ b/src/search.php @@ -32,15 +32,15 @@ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/application/bootstrap.php'; -$searchtext = isset($_POST['searchtext']) ? mysql_escape_string($_POST['searchtext']) : null; -$type = isset($_POST['type']) ? $_POST['type'] : null; +$searchtext = mysql_escape_string($_POST['searchtext']); +$type = $_POST['type']; -$dpath = (empty($user["dpath"])) ? DEFAULT_SKINPATH : $user["dpath"]; +$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; includeLang('search'); -$search_results = null; -$result_list = null; $i = 0; +//creamos la query +$searchtext = mysql_escape_string($_POST["searchtext"]); switch($type){ case "playername": $table = gettemplate('search_user_table'); @@ -89,7 +89,7 @@ if(isset($searchtext) && isset($type)){ }else{ $pquery = doquery("SELECT name FROM {{table}} WHERE id = {$s['id_planet']}","planets",true); $s['planet_name'] = $pquery['name']; - $s['ally_name'] = (!empty($aquery['ally_name']))?"{$aquery['ally_name']}":''; + $s['ally_name'] = ($aquery['ally_name']!='')?"{$aquery['ally_name']}":''; } //ahora la alianza if($s['ally_id']!=0&&$s['ally_request']==0){ @@ -99,9 +99,8 @@ if(isset($searchtext) && isset($type)){ } - if (!empty($s['rank'])) { - $s['position'] = "".$s['rank'].""; - } + + $s['position'] = "".$s['rank'].""; $s['dpath'] = $dpath; $s['coordinated'] = "{$s['galaxy']}:{$s['system']}:{$s['planet']}"; $s['buddy_request'] = $lang['buddy_request']; @@ -123,10 +122,10 @@ if(isset($searchtext) && isset($type)){ } //el resto... -$lang['type_playername'] = (isset($_POST["type"]) && $_POST["type"] == "playername") ? " SELECTED" : ""; -$lang['type_planetname'] = (isset($_POST["type"]) && $_POST["type"] == "planetname") ? " SELECTED" : ""; -$lang['type_allytag'] = (isset($_POST["type"]) && $_POST["type"] == "allytag") ? " SELECTED" : ""; -$lang['type_allyname'] = (isset($_POST["type"]) && $_POST["type"] == "allyname") ? " SELECTED" : ""; +$lang['type_playername'] = ($_POST["type"] == "playername") ? " SELECTED" : ""; +$lang['type_planetname'] = ($_POST["type"] == "planetname") ? " SELECTED" : ""; +$lang['type_allytag'] = ($_POST["type"] == "allytag") ? " SELECTED" : ""; +$lang['type_allyname'] = ($_POST["type"] == "allyname") ? " SELECTED" : ""; $lang['searchtext'] = $searchtext; $lang['search_results'] = $search_results; //esto es algo repetitivo ... w diff --git a/src/stat.php b/src/stat.php index e99027e..c623527 100644 --- a/src/stat.php +++ b/src/stat.php @@ -35,20 +35,19 @@ require_once dirname(__FILE__) .'/application/bootstrap.php'; includeLang('stat'); $parse = $lang; -$who = (isset($_POST['who'])) ? $_POST['who'] : isset($_GET['who']) ? $_GET['who'] : null; +$who = (isset($_POST['who'])) ? $_POST['who'] : $_GET['who']; if (!isset($who)) { $who = 1; } -$type = (isset($_POST['type'])) ? $_POST['type'] : isset($_GET['type']) ? $_GET['type'] : null; +$type = (isset($_POST['type'])) ? $_POST['type'] : $_GET['type']; if (!isset($type)) { $type = 1; } -$range = (isset($_POST['range'])) ? $_POST['range'] : isset($_GET['range']) ? $_GET['range'] : null; +$range = (isset($_POST['range'])) ? $_POST['range'] : $_GET['range']; if (!isset($range)) { $range = 1; } -$start = 0; $parse['who'] = ""; $parse['who'] .= ""; @@ -145,7 +144,6 @@ if ($who == 2) { } } else { $MaxUsers = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE `db_deaktjava` = '0';", 'users', true); - $LastPage = 0; if ($MaxUsers['count'] > 100) { $LastPage = floor($MaxUsers['count'] / 100); }