diff --git a/.gitignore b/.gitignore
index c40f034..24b99ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ 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 c4fc32e..ba30531 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 3e19e1c..3d2b0ab 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 6f6876e..ed76401 100644
--- a/src/marchand.php
+++ b/src/marchand.php
@@ -39,13 +39,13 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
$parse = $lang;
- if ($_POST['ress'] != '') {
+ if (isset($_POST['ress']) && $_POST['ress'] != '') {
$PageTPL = gettemplate('message_body');
$Error = false;
$CheatTry = false;
- $Metal = $_POST['metal'];
- $Crystal = $_POST['cristal'];
- $Deuterium = $_POST['deut'];
+ $Metal = isset($_POST['metal']) ? $_POST['metal'] : 0;
+ $Crystal = isset($_POST['cristal']) ? $_POST['cristal'] : 0;
+ $Deuterium = isset($_POST['deut']) ? $_POST['deut'] : 0;
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['crystal'] > $Necessaire) {
- $CurrentPlanet['crystal'] -= $Necessaire;
+ if ($CurrentPlanet['cristal'] > $Necessaire) {
+ $CurrentPlanet['cristal'] -= $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['crystal'] = 0;
+ $CurrentPlanet['cristal'] = 0;
$CurrentPlanet['deuterium'] = 0;
} else {
$CurrentPlanet['metal'] += $Metal;
- $CurrentPlanet['crystal'] += $Crystal;
+ $CurrentPlanet['cristal'] += $Crystal;
$CurrentPlanet['deuterium'] += $Deuterium;
}
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet['metal'] ."', ";
- $QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet['crystal'] ."', ";
+ $QryUpdatePlanet .= "`cristal` = '". $CurrentPlanet['cristal'] ."', ";
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet['deuterium'] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."';";
@@ -118,7 +118,7 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
}
$parse['mes'] = $Message;
} else {
- if ($_POST['action'] != 2) {
+ if (!isset($_POST['action']) || $_POST['action'] != 2) {
$PageTPL = gettemplate('marchand_main');
} else {
$parse['mod_ma_res'] = "1";
@@ -145,8 +145,7 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
$Page = parsetemplate ( $PageTPL, $parse );
return $Page;
}
-
- $Page = ModuleMarchand ( $user, $planetrow );
+ $Page = ModuleMarchand ( $user, $planet );
display ( $Page, $lang['mod_marchand'], true, '', false );
// -----------------------------------------------------------------------------------------------------------
diff --git a/src/messages.php b/src/messages.php
index bb8bb1d..9d080e5 100644
--- a/src/messages.php
+++ b/src/messages.php
@@ -40,11 +40,11 @@ if(!isset($user['authlevel'])) {
includeLang('messages');
-$OwnerID = $_GET['id'];
-$MessCategory = $_GET['messcat'];
-$MessPageMode = (string) $_GET['mode'];
-$DeleteWhat = $_POST['deletemessages'];
-if (isset ($DeleteWhat)) {
+$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)) {
$MessPageMode = "delete";
}
@@ -55,6 +55,9 @@ $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]];
@@ -230,7 +233,7 @@ $Message = trim ( nl2br ( strip_tags ( $_POST['text'], '
' ) ) ); }
$page .= "