Fix Marchand
Fix undefined value in options.php
This commit is contained in:
parent
8ebc4cd91f
commit
6f1e5e4467
2 changed files with 13 additions and 17 deletions
|
|
@ -39,13 +39,13 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
|
||||||
|
|
||||||
$parse = $lang;
|
$parse = $lang;
|
||||||
|
|
||||||
if ($_POST['ress'] != '') {
|
if (isset($_POST['ress']) && $_POST['ress'] != '') {
|
||||||
$PageTPL = gettemplate('message_body');
|
$PageTPL = gettemplate('message_body');
|
||||||
$Error = false;
|
$Error = false;
|
||||||
$CheatTry = false;
|
$CheatTry = false;
|
||||||
$Metal = $_POST['metal'];
|
$Metal = isset($_POST['metal']) ? $_POST['metal'] : 0;
|
||||||
$Crystal = $_POST['cristal'];
|
$Crystal = isset($_POST['cristal']) ? $_POST['cristal'] : 0;
|
||||||
$Deuterium = $_POST['deut'];
|
$Deuterium = isset($_POST['deut']) ? $_POST['deut'] : 0;
|
||||||
if ($Metal < 0) {
|
if ($Metal < 0) {
|
||||||
$Metal *= -1;
|
$Metal *= -1;
|
||||||
$CheatTry = true;
|
$CheatTry = true;
|
||||||
|
|
@ -72,8 +72,8 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
|
||||||
|
|
||||||
case 'cristal':
|
case 'cristal':
|
||||||
$Necessaire = (( $Metal * 0.5) + ( $Deuterium * 2));
|
$Necessaire = (( $Metal * 0.5) + ( $Deuterium * 2));
|
||||||
if ($CurrentPlanet['crystal'] > $Necessaire) {
|
if ($CurrentPlanet['cristal'] > $Necessaire) {
|
||||||
$CurrentPlanet['crystal'] -= $Necessaire;
|
$CurrentPlanet['cristal'] -= $Necessaire;
|
||||||
} else {
|
} else {
|
||||||
$Message = $lang['mod_ma_noten'] ." ". $lang['Crystal'] ."! ";
|
$Message = $lang['mod_ma_noten'] ." ". $lang['Crystal'] ."! ";
|
||||||
$Error = true;
|
$Error = true;
|
||||||
|
|
@ -94,17 +94,17 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
|
||||||
if ($Error == false) {
|
if ($Error == false) {
|
||||||
if ($CheatTry == true) {
|
if ($CheatTry == true) {
|
||||||
$CurrentPlanet['metal'] = 0;
|
$CurrentPlanet['metal'] = 0;
|
||||||
$CurrentPlanet['crystal'] = 0;
|
$CurrentPlanet['cristal'] = 0;
|
||||||
$CurrentPlanet['deuterium'] = 0;
|
$CurrentPlanet['deuterium'] = 0;
|
||||||
} else {
|
} else {
|
||||||
$CurrentPlanet['metal'] += $Metal;
|
$CurrentPlanet['metal'] += $Metal;
|
||||||
$CurrentPlanet['crystal'] += $Crystal;
|
$CurrentPlanet['cristal'] += $Crystal;
|
||||||
$CurrentPlanet['deuterium'] += $Deuterium;
|
$CurrentPlanet['deuterium'] += $Deuterium;
|
||||||
}
|
}
|
||||||
|
|
||||||
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||||
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet['metal'] ."', ";
|
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet['metal'] ."', ";
|
||||||
$QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet['crystal'] ."', ";
|
$QryUpdatePlanet .= "`cristal` = '". $CurrentPlanet['cristal'] ."', ";
|
||||||
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet['deuterium'] ."' ";
|
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet['deuterium'] ."' ";
|
||||||
$QryUpdatePlanet .= "WHERE ";
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."';";
|
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."';";
|
||||||
|
|
@ -118,7 +118,7 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
|
||||||
}
|
}
|
||||||
$parse['mes'] = $Message;
|
$parse['mes'] = $Message;
|
||||||
} else {
|
} else {
|
||||||
if ($_POST['action'] != 2) {
|
if (!isset($_POST['action']) || $_POST['action'] != 2) {
|
||||||
$PageTPL = gettemplate('marchand_main');
|
$PageTPL = gettemplate('marchand_main');
|
||||||
} else {
|
} else {
|
||||||
$parse['mod_ma_res'] = "1";
|
$parse['mod_ma_res'] = "1";
|
||||||
|
|
@ -145,8 +145,7 @@ function ModuleMarchand ( $CurrentUser, &$CurrentPlanet ) {
|
||||||
$Page = parsetemplate ( $PageTPL, $parse );
|
$Page = parsetemplate ( $PageTPL, $parse );
|
||||||
return $Page;
|
return $Page;
|
||||||
}
|
}
|
||||||
|
$Page = ModuleMarchand ( $user, $planet );
|
||||||
$Page = ModuleMarchand ( $user, $planetrow );
|
|
||||||
display ( $Page, $lang['mod_marchand'], true, '', false );
|
display ( $Page, $lang['mod_marchand'], true, '', false );
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ $mode = isset($_GET['mode']) ? $_GET['mode'] : null;
|
||||||
|
|
||||||
// Gestion des options speciales pour les admins
|
// Gestion des options speciales pour les admins
|
||||||
if ($user['authlevel'] != LEVEL_PLAYER) {
|
if ($user['authlevel'] != LEVEL_PLAYER) {
|
||||||
if ($_POST['adm_pl_prot'] == 'on') {
|
if (isset($_POST['adm_pl_prot']) && $_POST['adm_pl_prot'] == 'on') {
|
||||||
doquery ("UPDATE {{table}} SET `id_level` = '".$user['authlevel']."' WHERE `id_owner` = '".$user['id']."';", 'planets');
|
doquery ("UPDATE {{table}} SET `id_level` = '".$user['authlevel']."' WHERE `id_owner` = '".$user['id']."';", 'planets');
|
||||||
} else {
|
} else {
|
||||||
doquery ("UPDATE {{table}} SET `id_level` = '0' WHERE `id_owner` = '".$user['id']."';", 'planets');
|
doquery ("UPDATE {{table}} SET `id_level` = '0' WHERE `id_owner` = '".$user['id']."';", 'planets');
|
||||||
|
|
@ -191,10 +191,7 @@ $mode = isset($_GET['mode']) ? $_GET['mode'] : null;
|
||||||
`settings_bud` = '$settings_bud',
|
`settings_bud` = '$settings_bud',
|
||||||
`settings_mis` = '$settings_mis',
|
`settings_mis` = '$settings_mis',
|
||||||
`settings_rep` = '$settings_rep',
|
`settings_rep` = '$settings_rep',
|
||||||
`db_deaktjava` = '$db_deaktjava',
|
`db_deaktjava` = '$db_deaktjava'
|
||||||
`kolorminus` = '$kolorminus',
|
|
||||||
`kolorplus` = '$kolorplus',
|
|
||||||
`kolorpoziom` = '$kolorpoziom'
|
|
||||||
WHERE `id` = '$iduser' LIMIT 1", "users");
|
WHERE `id` = '$iduser' LIMIT 1", "users");
|
||||||
|
|
||||||
if (isset($_POST["db_password"]) && md5($_POST["db_password"]) == $user["password"]) {
|
if (isset($_POST["db_password"]) && md5($_POST["db_password"]) == $user["password"]) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue