* 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('options');
$lang['PHP_SELF'] = 'options.' . PHPEXT;
$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
`urlaubs_modus` = '0',
`urlaubs_until` = '0'
WHERE `id` = '".$user['id']."' LIMIT 1", "users");
//Remise des mines au retour du mod vacance
$query = doquery("SELECT * FROM {{table}} WHERE id_owner = '{$user['id']}'", 'planets');
while ($id = $query->fetch(PDO::FETCH_BOTH)){
doquery("UPDATE {{table}} SET
energy_used = '10',
energy_max = '10',
metal_mine_porcent = '10',
crystal_mine_porcent = '10',
deuterium_sintetizer_porcent = '10',
solar_plant_porcent = '10',
fusion_plant_porcent = '10',
solar_satelit_porcent = '10'
WHERE id = '{$id['id']}' AND `planet_type` = 1 ", 'planets');}
$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") { // Array ( [db_character]
$iduser = $user["id"];
$avatar = $_POST["avatar"];
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 ($_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');
}
}
// Mostrar skin
if (isset($_POST["design"]) && $_POST["design"] == 'on') {
$design = "1";
} else {
$design = "0";
}
// Desactivar comprobaci? de IP
if (isset($_POST["noipcheck"]) && $_POST["noipcheck"] == 'on') {
$noipcheck = "1";
} else {
$noipcheck = "0";
}
// Nombre de usuario
if (isset($_POST["db_character"]) && $_POST["db_character"] != '') {
$username = CheckInputStrings ( $_POST['db_character'] );
} else {
$username = $user['username'];
}
// Adresse e-Mail
if (isset($_POST["db_email"]) && $_POST["db_email"] != '') {
$db_email = CheckInputStrings ( $_POST['db_email'] );
} else {
$db_email = $user['email'];
}
// Cantidad de sondas de espionaje
if (isset($_POST["spio_anz"]) && is_numeric($_POST["spio_anz"])) {
$spio_anz = $_POST["spio_anz"];
} else {
$spio_anz = "1";
}
// Mostrar tooltip durante
if (isset($_POST["settings_tooltiptime"]) && is_numeric($_POST["settings_tooltiptime"])) {
$settings_tooltiptime = $_POST["settings_tooltiptime"];
} else {
$settings_tooltiptime = "1";
}
// Maximo mensajes de flotas
if (isset($_POST["settings_fleetactions"]) && is_numeric($_POST["settings_fleetactions"])) {
$settings_fleetactions = $_POST["settings_fleetactions"];
} else {
$settings_fleetactions = "1";
} //
// Mostrar logos de los aliados
if (isset($_POST["settings_allylogo"]) && $_POST["settings_allylogo"] == 'on') {
$settings_allylogo = "1";
} else {
$settings_allylogo = "0";
}
// Espionaje
if (isset($_POST["settings_esp"]) && $_POST["settings_esp"] == 'on') {
$settings_esp = "1";
} else {
$settings_esp = "0";
}
// Escribir mensaje
if (isset($_POST["settings_wri"]) && $_POST["settings_wri"] == 'on') {
$settings_wri = "1";
} else {
$settings_wri = "0";
}
// A?dir a lista de amigos
if (isset($_POST["settings_bud"]) && $_POST["settings_bud"] == 'on') {
$settings_bud = "1";
} else {
$settings_bud = "0";
}
// Ataque con misiles
if (isset($_POST["settings_mis"]) && $_POST["settings_mis"] == 'on') {
$settings_mis = "1";
} else {
$settings_mis = "0";
}
// Ver reporte
if (isset($_POST["settings_rep"]) && $_POST["settings_rep"] == 'on') {
$settings_rep = "1";
} else {
$settings_rep = "0";
}
// Modo vacaciones
if (isset($_POST["urlaubs_modus"]) && $_POST["urlaubs_modus"] == 'on') {
//Selectionne si le joueur a des flottes en vol
$fleet = doquery("SELECT COUNT(fleet_owner) AS `actcnt` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', true);
//Selectionne si le joueur a des batiments en construction
$build = doquery("SELECT COUNT(id_owner) AS `building` FROM {{table}} WHERE `id_owner` = '".$user['id']."' and `b_building`!=0;", 'planets', true);
//Selectionne si le joueur a des techno en cours
$tech = doquery("SELECT COUNT(id) AS `tech` FROM {{table}} WHERE `id` = '".$user['id']."' and `b_tech_planet`!=0;", 'users', true);
//Selectionne si le joueur est en train de se faire attaquer
$attack = doquery("SELECT COUNT(fleet_taget_owner) AS `attack` FROM {{table}} WHERE `fleet_taget_owner` = '".$user['id']."';", 'fleets', true);
if($fleet['actcnt']=='0' && $build['building']=='0' && $tech['tech']=='0' && $attack['attack']=='0') {
$urlaubs_modus = "1";
$time = time() + 172800;
doquery("UPDATE {{table}} SET
`urlaubs_modus` = '$urlaubs_modus',
`urlaubs_until` = '$time'
WHERE `id` = '$iduser' LIMIT 1", "users");
} else {
message ( 'Verifiez vos flottes, technologies et batiments','