Compare commits

..
1637 changed files with 21688 additions and 43491 deletions

9
.gitignore vendored
View file

@ -1,8 +1 @@
config.php
.buildpath
.project
.settings/
.idea/
coverage/
src/application/cache/*
src/application/configs/local.php
/config.php

2
.htaccess Normal file
View file

@ -0,0 +1,2 @@
SetEnv DEBUG On
SetEnv DEPRECATION Off

68
add_declare.php Normal file
View file

@ -0,0 +1,68 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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);
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
includeLang('admin/Queries');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,24 +24,27 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
doquery("UPDATE {{table}} SET `banaday` =` banaday` - '1' WHERE `banaday` != '0';",'users');
doquery("UPDATE {{table}} SET `bana` = '0' WHERE `banaday` < '1';",'users');
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin/fleets');
$PageTPL = gettemplate('admin/fleet_body');
$response = Wootook::getResponse()
->setRedirect(Wootook::getStaticUrl('admin/overview.php'))
->sendHeaders();
exit(0);
} else {
message ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
$parse = $lang;
$parse['flt_table'] = BuildFlyingFleetTable ();
$page = parsetemplate( $PageTPL, $parse );
display ( $page, $lang['flt_title'], false, '', true);
} else {
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,18 +24,18 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('admin');
function WootookResetUnivers ( $CurrentUser ) {
function XNovaResetUnivers ( $CurrentUser ) {
global $lang;
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN))) {
@ -129,7 +129,7 @@ function WootookResetUnivers ( $CurrentUser ) {
$parse = $lang;
if ($mode == 'reset') {
WootookResetUnivers ( $user );
XNovaResetUnivers ( $user );
} else {
$Page = parsetemplate($PageTpl, $parse);
display ($Page, $lang['Reset'], false, '', true);

66
admin/activeplanet.php Normal file
View file

@ -0,0 +1,66 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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'] .= "<tr>";
$parse['online_list'] .= "<td class=b><center><b>". $ActivPlanet['name'] ."</b></center></td>";
$parse['online_list'] .= "<td class=b><center><b>[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]</b></center></td>";
$parse['online_list'] .= "<td class=m><center><b>". pretty_number($ActivPlanet['points'] / 1000) ."</b></center></td>";
$parse['online_list'] .= "<td class=b><center><b>". pretty_time(time() - $ActivPlanet['last_update']) . "</b></center></td>";
$parse['online_list'] .= "</tr>";
$Count++;
}
$parse['online_list'] .= "<tr>";
$parse['online_list'] .= "<th class=\"b\" colspan=\"4\">". $lang['adm_pl_they'] ." ". $Count ." ". $lang['adm_pl_apla'] ."</th>";
$parse['online_list'] .= "</tr>";
$page = parsetemplate( $PageTPL , $parse );
display( $page, $lang['adm_pl_title'], false, '', true );
} else {
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

101
admin/add_fleet.php Normal file
View file

@ -0,0 +1,101 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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'] );
}
?>

67
admin/add_money.php Normal file
View file

@ -0,0 +1,67 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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'] );
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('admin/addmoon');

48
admin/autounban.php Normal file
View file

@ -0,0 +1,48 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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))) {
$lang['PHP_SELF'] = 'options.'.PHPEXT;
doquery("UPDATE {{table}} SET `banaday` =` banaday` - '1' WHERE `banaday` != '0';",'users');
doquery("UPDATE {{table}} SET `bana` = '0' WHERE `banaday` < '1';",'users');
$parse = $gameConfig;
$parse['dpath'] = $dpath;
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":'';
} else {
message ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('changelog');
$template = gettemplate('changelog_table');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('admin');
$parse = $lang;

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('credit');
$parse = $lang;

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,23 +24,19 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('admin');
if ($_GET['cmd'] == 'dele') {
$player = new Wootook_Player_Model_Entity();
$player->load(intval($_GET['user']));
if ($player->getId()) {
$player->delete();
}
DeleteSelectedUser ( $_GET['user'] );
}
if ($_GET['cmd'] == 'sort') {
$TypeSort = $_GET['type'];
@ -57,7 +53,7 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
$parse['adm_ul_table'] = "";
$i = 0;
$Color = "lime";
while ($u = $query->fetch(PDO::FETCH_ASSOC) ) {
while ($u = mysql_fetch_assoc ($query) ) {
if ($PrevIP != "") {
if ($PrevIP == $u['declarator']) {
$Color = "red";

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
$PageTpl = gettemplate( "admin/deletuser" );

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('admin');
$parse = $lang;

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,25 +24,25 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
includeLang('leftmenu');
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
$parse = $lang;
$parse['mf'] = "Hauptframe";
$parse['dpath'] = $dpath;
$parse['WootookRelease'] = VERSION;
$parse['servername'] = 'Wootook';
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
display($Page, "", false, '', true);
$parse = $lang;
$parse['mf'] = "Hauptframe";
$parse['dpath'] = $dpath;
$parse['XNovaRelease'] = VERSION;
$parse['servername'] = XNova;
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
display( $Page, "", false, '', true);
} else {
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}

66
admin/mass_message.php Normal file
View file

@ -0,0 +1,66 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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`='<font color=\"$kolor\">Administracja</font>',
`message_subject`='<font color=\"$kolor\">{$gameConfig['temat']}</font>',
`message_text`='<font color=\"$kolor\"><b>{$gameConfig['tresc']}</b></font>'
","messages");
$parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users');
}
$parent->smarty->assign("message","<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>");
}
}
$parent->smarty->display("mass_message.tpl");
}
function mass_message_info(){
return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0");
}

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin/changepass');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin/md5enc');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('admin/messagelist');

75
admin/messall.php Normal file
View file

@ -0,0 +1,75 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 = "<font color=\"". $kolor ."\">". $ranga ." ".$user['username']."</font>";
$Subject = "<font color=\"". $kolor ."\">". $gameConfig['temat'] ."</font>";
$Message = "<font color=\"". $kolor ."\"><b>". $gameConfig['tresc'] ."</b></font>";
while ($u = $sq->fetch(PDO::FETCH_BOTH)) {
SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message);
}
message("<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>", "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']);
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('overview');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin/multi');

116
admin/overview.php Normal file
View file

@ -0,0 +1,116 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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<EFBFBD>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'] = "<img src=\"../images/true.png\" >";
} else {
$Bloc['state_vacancy'] = "<img src=\"../images/false.png\">";
}
if ($TheUser['bana'] == 1) {
$Bloc['is_banned'] = "<img src=\"../images/banned.png\" >";
} 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'] );
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,7 +24,7 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
@ -32,7 +32,7 @@ define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
@ -50,79 +50,37 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
switch ($_GET['result']){
case 'usr_search':
$db = Legacies_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT
planet.id AS planet_id,
planet.name AS planet_name,
planet.galaxy AS planet_galaxy,
planet.system AS planet_system,
planet.planet AS planet_position,
user.id AS user_id,
user.username AS username,
user.user_lastip AS user_lastip,
user.email AS email,
user.authlevel AS authlevel,
user.sex AS sex
FROM {{table}}planets AS planet
INNER JOIN {{table}}users AS user ON user.id_planet=planet.id
WHERE user.id = {$db->quote('%' . str_replace('*', '%', str_replace('%', '%%', $_GET['player'])) . '%')}"
SQL_EOF;
$statement = $db->prepare($sql);
$statement->execute();
$data = $statement->fetch(PDO::FETCH_ASSOC);
$pattern = mysql_real_escape_string($_GET['player']);
$SelUser = doquery("SELECT * FROM {{table}} WHERE `username` LIKE '%". $pattern ."%' LIMIT 1;", 'users', true);
$UsrMain = doquery("SELECT `name` FROM {{table}} WHERE `id` = '". $SelUser['id_planet'] ."';", 'planets', true);
$bloc = $lang;
$bloc['answer1'] = $data['user_id'];
$bloc['answer2'] = $data['username'];
$bloc['answer3'] = $data['user_lastip'];
$bloc['answer4'] = $data['email'];
$bloc['answer5'] = $lang['adm_usr_level'][$data['authlevel']];
$bloc['answer6'] = $lang['adm_usr_genre'][$data['sex']];
$bloc['answer7'] = "[".$data['planet_id']."] {$data['planet_name']}";
$bloc['answer8'] = "[".$SelUser['planet_galaxy'].":".$SelUser['planet_system'].":".$SelUser['planet_position']."] ";
$bloc['answer1'] = $SelUser['id'];
$bloc['answer2'] = $SelUser['username'];
$bloc['answer3'] = $SelUser['user_lastip'];
$bloc['answer4'] = $SelUser['email'];
$bloc['answer5'] = $lang['adm_usr_level'][ $SelUser['authlevel'] ];
$bloc['answer6'] = $lang['adm_usr_genre'][ $SelUser['sex'] ];
$bloc['answer7'] = "[".$SelUser['id_planet']."] ".$UsrMain['name'];
$bloc['answer8'] = "[".$SelUser['galaxy'].":".$SelUser['system'].":".$SelUser['planet']."] ";
$SubPanelTPL = gettemplate('admin/admin_panel_asw1');
$parse['adm_sub_form2'] = parsetemplate($SubPanelTPL, $bloc);
$parse['adm_sub_form2'] = parsetemplate( $SubPanelTPL, $bloc );
break;
case 'usr_data':
$db = Legacies_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT
planet.id AS planet_id,
planet.name AS planet_name,
planet.galaxy AS planet_galaxy,
planet.system AS planet_system,
planet.planet AS planet_position,
user.id AS user_id,
user.username AS username,
user.user_lastip AS user_lastip,
user.email AS email,
user.authlevel AS authlevel,
user.sex AS sex
FROM {{table}}planets AS planet
INNER JOIN {{table}}users AS user ON user.id_planet=planet.id
WHERE user.id = {$db->quote('%' . str_replace('*', '%', str_replace('%', '%%', $_GET['player'])) . '%')}"
SQL_EOF;
$statement = $db->prepare($sql);
$statement->execute();
$data = $statement->fetch(PDO::FETCH_ASSOC);
$pattern = mysql_real_escape_string($_GET['player']);
$SelUser = doquery("SELECT * FROM {{table}} WHERE `username` LIKE '%". $pattern ."%' LIMIT 1;", 'users', true);
$UsrMain = doquery("SELECT `name` FROM {{table}} WHERE `id` = '". $SelUser['id_planet'] ."';", 'planets', true);
$bloc = $lang;
$bloc['answer1'] = $data['user_id'];
$bloc['answer2'] = $data['username'];
$bloc['answer3'] = $data['user_lastip'];
$bloc['answer4'] = $data['email'];
$bloc['answer5'] = $lang['adm_usr_level'][$data['authlevel']];
$bloc['answer6'] = $lang['adm_usr_genre'][$data['sex']];
$bloc['answer7'] = "[".$data['planet_id']."] {$data['planet_name']}";
$bloc['answer8'] = "[".$SelUser['planet_galaxy'].":".$SelUser['planet_system'].":".$SelUser['planet_position']."] ";
$bloc['answer1'] = $SelUser['id'];
$bloc['answer2'] = $SelUser['username'];
$bloc['answer3'] = $SelUser['user_lastip'];
$bloc['answer4'] = $SelUser['email'];
$bloc['answer5'] = $lang['adm_usr_level'][ $SelUser['authlevel'] ];
$bloc['answer6'] = $lang['adm_usr_genre'][ $SelUser['sex'] ];
$bloc['answer7'] = "[".$SelUser['id_planet']."] ".$UsrMain['name'];
$bloc['answer8'] = "[".$SelUser['galaxy'].":".$SelUser['system'].":".$SelUser['planet']."] ";
$SubPanelTPL = gettemplate('admin/admin_panel_asw1');
$parse['adm_sub_form1'] = parsetemplate( $SubPanelTPL, $bloc );

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
@ -59,5 +59,5 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
}
// Created by e-Zobar. All rights reversed (C) Wootook Team 2008
// Created by e-Zobar. All rights reversed (C) XNova Team 2008
?>

310
admin/settings.php Normal file
View file

@ -0,0 +1,310 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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<72> !
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 );
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,7 +24,7 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
@ -32,7 +32,7 @@ define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
include(ROOT_PATH . 'admin/statfunctions.' . PHPEXT);
@ -42,16 +42,14 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$StatDate = time();
// Rotation des statistiques
doquery ( "DELETE FROM {{table}} WHERE `stat_code` >= '10';" , 'statpoints');
doquery ( "DELETE FROM {{table}} WHERE `stat_code` = '2';" , 'statpoints');
doquery ( "UPDATE {{table}} SET `stat_code` = `stat_code` + '1';" , 'statpoints');
$GameUsers = doquery("SELECT * FROM {{table}} WHERE authlevel<3", 'users');
$resourceMultiplier = Wootook::getGameConfig('game/resource/multiplier');
while ($CurUser = $GameUsers->fetch(PDO::FETCH_ASSOC)) {
// Recuperation des anciennes statistiques
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';", 'statpoints', true);
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';",'statpoints');
if ($OldStatRecord) {
$OldTotalRank = $OldStatRecord['total_rank'];
$OldTechRank = $OldStatRecord['tech_rank'];
@ -71,7 +69,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
// Total des unitées consommée pour la recherche
$Points = GetTechnoPoints ( $CurUser );
$TTechCount = $Points['TechCount'];
$TTechPoints = ($Points['TechPoint'] / $resourceMultiplier);
$TTechPoints = ($Points['TechPoint'] / $gameConfig['stat_settings']);
// Totalisation des points accumulés par planete
$TBuildCount = 0;
@ -83,24 +81,24 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$GCount = $TTechCount;
$GPoints = $TTechPoints;
$UsrPlanets = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '". $CurUser['id'] ."';", 'planets');
while ($CurPlanet = $UsrPlanets->fetch(PDO::FETCH_ASSOC)) {
while ($CurPlanet = mysql_fetch_assoc($UsrPlanets) ) {
$Points = GetBuildPoints ( $CurPlanet );
$TBuildCount += $Points['BuildCount'];
$GCount += $Points['BuildCount'];
$PlanetPoints = ($Points['BuildPoint'] / $resourceMultiplier);
$TBuildPoints += ($Points['BuildPoint'] / $resourceMultiplier);
$PlanetPoints = ($Points['BuildPoint'] / $gameConfig['stat_settings']);
$TBuildPoints += ($Points['BuildPoint'] / $gameConfig['stat_settings']);
$Points = GetDefensePoints ( $CurPlanet );
$TDefsCount += $Points['DefenseCount'];;
$GCount += $Points['DefenseCount'];
$PlanetPoints += ($Points['DefensePoint'] / $resourceMultiplier);
$TDefsPoints += ($Points['DefensePoint'] / $resourceMultiplier);
$PlanetPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']);
$TDefsPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']);
$Points = GetFleetPoints ( $CurPlanet );
$TFleetCount += $Points['FleetCount'];
$GCount += $Points['FleetCount'];
$PlanetPoints += ($Points['FleetPoint'] / $resourceMultiplier);
$TFleetPoints += ($Points['FleetPoint'] / $resourceMultiplier);
$PlanetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']);
$TFleetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']);
$GPoints += $PlanetPoints;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
@ -136,7 +134,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$Rank = 1;
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `tech_points` DESC;", 'statpoints');
while ($TheRank = $RankQry->fetch(PDO::FETCH_ASSOC)) {
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
$QryUpdateStats = "UPDATE {{table}} SET ";
$QryUpdateStats .= "`tech_rank` = '". $Rank ."' ";
$QryUpdateStats .= "WHERE ";
@ -147,7 +145,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$Rank = 1;
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `build_points` DESC;", 'statpoints');
while ($TheRank = $RankQry->fetch(PDO::FETCH_ASSOC) ) {
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
$QryUpdateStats = "UPDATE {{table}} SET ";
$QryUpdateStats .= "`build_rank` = '". $Rank ."' ";
$QryUpdateStats .= "WHERE ";
@ -158,7 +156,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$Rank = 1;
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `defs_points` DESC;", 'statpoints');
while ($TheRank = $RankQry->fetch(PDO::FETCH_ASSOC)) {
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
$QryUpdateStats = "UPDATE {{table}} SET ";
$QryUpdateStats .= "`defs_rank` = '". $Rank ."' ";
$QryUpdateStats .= "WHERE ";
@ -169,7 +167,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$Rank = 1;
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `fleet_points` DESC;", 'statpoints');
while ($TheRank = $RankQry->fetch(PDO::FETCH_ASSOC)) {
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
$QryUpdateStats = "UPDATE {{table}} SET ";
$QryUpdateStats .= "`fleet_rank` = '". $Rank ."' ";
$QryUpdateStats .= "WHERE ";
@ -180,7 +178,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
$Rank = 1;
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `total_points` DESC;", 'statpoints');
while ($TheRank = $RankQry->fetch(PDO::FETCH_ASSOC)) {
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
$QryUpdateStats = "UPDATE {{table}} SET ";
$QryUpdateStats .= "`total_rank` = '". $Rank ."' ";
$QryUpdateStats .= "WHERE ";
@ -194,7 +192,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'],
while ($CurAlly = $GameAllys->fetch(PDO::FETCH_ASSOC)) {
// Recuperation des anciennes statistiques
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '".$CurAlly['id']."';",'statpoints', true);
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '".$CurAlly['id']."';",'statpoints');
if ($OldStatRecord) {
$OldTotalRank = $OldStatRecord['total_rank'];
$OldTechRank = $OldStatRecord['tech_rank'];

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,7 +24,7 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
@ -36,7 +36,7 @@ function GetTechnoPoints ( $CurrentUser ) {
foreach ( $reslist['tech'] as $n => $Techno ) {
if ( $CurrentUser[ $resource[ $Techno ] ] > 0 ) {
for ( $Level = 1; $Level < $CurrentUser[ $resource[ $Techno ] ]; $Level++ ) {
$Units = $pricelist[ $Techno ]['metal'] + $pricelist[ $Techno ]['cristal'] + $pricelist[ $Techno ]['deuterium'];
$Units = $pricelist[ $Techno ]['metal'] + $pricelist[ $Techno ]['crystal'] + $pricelist[ $Techno ]['deuterium'];
$LevelMul = pow( $pricelist[ $Techno ]['factor'], $Level );
$TechPoints += ($Units * $LevelMul);
$TechCounts += 1;
@ -57,7 +57,7 @@ function GetBuildPoints ( $CurrentPlanet ) {
foreach($reslist['build'] as $n => $Building) {
if ( $CurrentPlanet[ $resource[ $Building ] ] > 0 ) {
for ( $Level = 1; $Level < $CurrentPlanet[ $resource[ $Building ] ]; $Level++ ) {
$Units = $pricelist[ $Building ]['metal'] + $pricelist[ $Building ]['cristal'] + $pricelist[ $Building ]['deuterium'];
$Units = $pricelist[ $Building ]['metal'] + $pricelist[ $Building ]['crystal'] + $pricelist[ $Building ]['deuterium'];
$LevelMul = pow( $pricelist[ $Building ]['factor'], $Level );
$BuildPoints += ($Units * $LevelMul);
$BuildCounts += 1;
@ -77,7 +77,7 @@ function GetDefensePoints ( $CurrentPlanet ) {
$DefensePoints = 0;
foreach($reslist['defense'] as $n => $Defense) {
if ($CurrentPlanet[ $resource[ $Defense ] ] > 0) {
$Units = $pricelist[ $Defense ]['metal'] + $pricelist[ $Defense ]['cristal'] + $pricelist[ $Defense ]['deuterium'];
$Units = $pricelist[ $Defense ]['metal'] + $pricelist[ $Defense ]['crystal'] + $pricelist[ $Defense ]['deuterium'];
$DefensePoints += ($Units * $CurrentPlanet[ $resource[ $Defense ] ]);
$DefenseCounts += $CurrentPlanet[ $resource[ $Defense ] ];
}
@ -95,7 +95,7 @@ function GetFleetPoints ( $CurrentPlanet ) {
$FleetPoints = 0;
foreach($reslist['fleet'] as $n => $Fleet) {
if ($CurrentPlanet[ $resource[ $Fleet ] ] > 0) {
$Units = $pricelist[ $Fleet ]['metal'] + $pricelist[ $Fleet ]['cristal'] + $pricelist[ $Fleet ]['deuterium'];
$Units = $pricelist[ $Fleet ]['metal'] + $pricelist[ $Fleet ]['crystal'] + $pricelist[ $Fleet ]['deuterium'];
$FleetPoints += ($Units * $CurrentPlanet[ $resource[ $Fleet ] ]);
$FleetCounts += $CurrentPlanet[ $resource[ $Fleet ] ];
}

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,23 +24,19 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
includeLang('admin');
if ($_GET['cmd'] == 'dele') {
$player = new Wootook_Player_Model_Entity();
$player->load(intval($_GET['user']));
if ($player->getId()) {
$player->delete();
}
DeleteSelectedUser ( $_GET['user'] );
}
if ($_GET['cmd'] == 'sort') {
$TypeSort = $_GET['type'];

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
require_once dirname(dirname(__FILE__)) .'/common.php';
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {

70
ainfo.php Normal file
View file

@ -0,0 +1,70 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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&uuml;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&eacute;e","Erreur");}
$count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=".$_GET["a"].";","users",true);
$ally_member_scount = $count[0];
$page .="<table width=519><tr><td class=c colspan=2>Informations sur l'alliance</td></tr>";
if($allyrow["ally_image"] != ""){
$page .= "<tr><th colspan=2><img src=\"".$allyrow["ally_image"]."\"></td></tr>";
}
$page .= "<tr><th>Tag</th><th>".$allyrow["ally_tag"]."</th></tr><tr><th>Nom</th><th>".$allyrow["ally_name"]."</th></tr><tr><th>Membres</th><th>$ally_member_scount</th></tr>";
if($allyrow["ally_description"] != ""){
$page .= "<tr><th colspan=2 height=100>".$allyrow["ally_description"]."</th></tr>";
}
if($allyrow["ally_web"] != ""){
$page .="<tr>
<th>Site internet</th>
<th><a href=\"".$allyrow["ally_web"]."\">".$allyrow["ally_web"]."</a></th>
</tr>";
}
$page .= "</table>";
display($page,"Information sur l'alliance [".$allyrow["ally_name"]."]",false);
?>

1199
alliance.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,33 +24,42 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write');
$action = isset($_GET['action']) ? $_GET['action'] : null;
require_once dirname(__FILE__) .'/common.php';
$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users');
$annonce = doquery("SELECT * FROM {{table}} ", 'annonce');
$action = $_GET['action'];
if ($action == 5) {
$writeAdapter->insert()
->into($writeAdapter->getTable('annonce'))
->set('user', $user->getUsername())
->set('galaxie', $planet->getGalaxy())
->set('systeme', $planet->getSystem())
->set('metala', Wootook::getRequest()->getParam('metalvendre'))
->set('cristala', Wootook::getRequest()->getParam('cristalvendre'))
->set('deuta', Wootook::getRequest()->getParam('deutvendre'))
->set('metals', Wootook::getRequest()->getParam('metalsouhait'))
->set('cristals', Wootook::getRequest()->getParam('cristalsouhait'))
->set('deuts', Wootook::getRequest()->getParam('deutsouhait'))
->execute()
;
$metalvendre = $_POST['metalvendre'];
$cristalvendre = $_POST['cristalvendre'];
$deutvendre = $_POST['deutvendre'];
$metalsouhait = $_POST['metalsouhait'];
$cristalsouhait = $_POST['cristalsouhait'];
$deutsouhait = $_POST['deutsouhait'];
while ($v_annonce = $users->fetch(PDO::FETCH_BOTH)) {
$user = $v_annonce['username'];
$galaxie = $v_annonce['galaxy'];
$systeme = $v_annonce['system'];
}
doquery("INSERT INTO {{table}} SET
user='{$user}',
galaxie='{$galaxie}',
systeme='{$systeme}',
metala='{$metalvendre}',
cristala='{$cristalvendre}',
deuta='{$deutvendre}',
metals='{$metalsouhait}',
cristals='{$cristalsouhait}',
deuts='{$deutsouhait}'" , "annonce");
$page2 .= <<<HTML
<center>
@ -64,7 +73,7 @@ HTML;
}
if ($action != 5) {
$statement = $readAdapter->select()->from(array('annonce' => $readAdapter->getTable('annonce')))->order('id', 'DESC')->prepare();
$annonce = doquery("SELECT * FROM {{table}} ORDER BY `id` DESC ", "annonce");
$page2 = "<HTML>
<center>
@ -73,9 +82,12 @@ if ($action != 5) {
<td class=\"c\" colspan=\"10\"><font color=\"#FFFFFF\">Petites Annonces</font></td></tr>
<tr><th colspan=\"3\">Infos de livraison</th><th colspan=\"3\">Ressources &agrave; vendre</th><th colspan=\"3\">Ressources souhait&eacute;es</th><th>Action</th></tr>
<tr><th>Vendeur</th><th>Galaxie</th><th>Syst&egrave;me</th><th>M&eacute;tal</th><th>Cristal</th><th>Deuterium</th><th>M&eacute;tal</th><th>Cristal</th><th>Deuterium</th><th>Delet</th></tr>
";
foreach ($statement as $b) {
";
while ($b = $annonce->fetch(PDO::FETCH_BOTH)) {
$page2 .= '<tr><th> ';
$page2 .= $b["user"] ;
$page2 .= '</th><th>';
@ -107,3 +119,4 @@ if ($action != 5) {
display($page2);
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
$actions = $_GET['action'];

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('banned');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('buddy');
@ -146,7 +146,7 @@ if ( $a == 1 ) {
}
$buddyrow = doquery( "SELECT * FROM {{table}} " . $query, 'buddy' );
while ( $b = $buddyrow->fetch(PDO::FETCH_BOTH) ) {
while ( $b = mysql_fetch_array( $buddyrow ) ) {
// para solicitudes
if ( !isset( $i ) && isset( $a ) ) {
$page .= "

146
build.xml
View file

@ -1,146 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpunit,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel"
description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc"/>
<antcall target="phpdoc"/>
</parallel>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
</target>
<target name="prepare" depends="clean"
description="Prepare for build">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>
<fileset dir="${basedir}/tests">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="pdepend"
description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
</target>
<target name="phpmd-ci"
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>
<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs">
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpcs-ci"
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpdoc"
description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg value="--directory" />
<arg path="${basedir}/src" />
<arg value="--target" />
<arg path="${basedir}/build/api" />
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true"/>
</target>
<target name="phpcb"
description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg value="--log" />
<arg path="${basedir}/build/logs" />
<arg value="--source" />
<arg path="${basedir}/src" />
<arg value="--output" />
<arg path="${basedir}/build/code-browser" />
</exec>
</target>
</project>

View file

@ -1,36 +0,0 @@
<?xml version="1.0"?>
<ruleset name="PPW-DEFAULT">
<description>Default coding standard</description>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.PHP.UpperCaseConstant"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</ruleset>

View file

@ -1,26 +0,0 @@
<?xml version="1.0"?>
<ruleset name="PPW-DEFAULT"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Default coding standard</description>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
<rule ref="rulesets/codesize.xml/NPathComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
</ruleset>

178
buildings.php Normal file
View file

@ -0,0 +1,178 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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('buildings');
$user = Legacies_Empire_Model_User::getSingleton();
$planet = $user->getCurrentPlanet();
$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
switch ($mode) {
case 'fleet':
if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) === null) {
$layout = new Legacies_Core_Layout();
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Legacies::__('Shipyard is required');
$block['message'] = Legacies::__('In order to build ships you will need to build a shipyard building.');
$layout->render();
break;
}
/** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */
$shipyard = $planet->getShipyard();
if (isset($_POST['ship']) && is_array($_POST['ship'])) {
foreach ($_POST['ship'] as $shipId => $count) {
$shipId = intval($shipId);
$count = intval($count);
$shipyard->appendQueue($shipId, $count);
}
$planet->save();
}
$types = Legacies_Empire_Model_Game_Types::getSingleton();
$layout = new Legacies_Core_Layout();
$layout->load('planet.shipyard');
/** @var Legacies_Core_Block_Concat $parentBlock */
$parentBlock = $layout->getBlock('item-list.items');
foreach ($types->getData(Legacies_Empire::TYPE_SHIP) as $shipId) {
if (!$shipyard->checkAvailability($shipId)) {
continue;
}
$blockName = "ship({$shipId})";
$block = $layout->createBlock('empire/planet.shipyard.item', $blockName);
$block->setTemplate('empire/planet/shipyard/item.phtml');
$block->setPlanet($planet);
$block->setItemId($shipId);
$parentBlock->setPartial($blockName, $block);
}
echo $layout->render();
break;
case 'research':
// --------------------------------------------------------------------------------------------------
ResearchBuildingPage($planet, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] );
break;
case 'defense':
if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) === null) {
$layout = new Legacies_Core_Layout();
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Legacies::__('Shipyard is required');
$block['title'] = Legacies::__('In order to build ships you will need to build a shipyard building.');
$layout->render();
break;
}
/** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */
$shipyard = $planet->getShipyard();
if (isset($_POST['defense']) && is_array($_POST['defense'])) {
foreach ($_POST['defense'] as $defenseId => $count) {
$defenseId = intval($defenseId);
$count = intval($count);
$shipyard->appendQueue($defenseId, $count);
}
$planet->save();
}
$types = Legacies_Empire_Model_Game_Types::getSingleton();
$layout = new Legacies_Core_Layout();
$layout->load('planet.shipyard');
/** @var Legacies_Core_Block_Concat $parentBlock */
$parentBlock = $layout->getBlock('item-list.items');
foreach ($types->getData(Legacies_Empire::TYPE_DEFENSE) as $defenseId) {
if (!$shipyard->checkAvailability($defenseId)) {
continue;
}
$blockName = "defense({$defenseId})";
$block = $layout->createBlock('empire/planet.shipyard.item', $blockName);
$block->setTemplate('empire/planet/shipyard/item.phtml');
$block->setPlanet($planet);
$block->setItemId($defenseId);
$parentBlock->setPartial($blockName, $block);
}
echo $layout->render();
break;
default:
if (isset($_GET['building']) && !empty($_GET['building'])) {
$buildingId = intval($_GET['building']);
$planet->appendBuildingQueue($shipId, isset($_GET['destroy']));
$planet->save();
}
$types = Legacies_Empire_Model_Game_Types::getSingleton();
$layout = new Legacies_Core_Layout();
$layout->load('planet.buildings');
/** @var Legacies_Core_Block_Concat $parentBlock */
$parentBlock = $layout->getBlock('item-list.items');
$type = Legacies_Empire::TYPE_BUILDING_PLANET;
if ($planet->isMoon()) {
$type = Legacies_Empire::TYPE_BUILDING_MOON;
}
foreach ($types->getData($type) as $buildingId) {
if (!$planet->checkAvailability($buildingId)) {
continue;
}
$blockName = "building({$buildingId})";
$block = $layout->createBlock('empire/planet.buildings.item', $blockName);
$block->setTemplate('empire/planet/buildings/item.phtml');
$block->setPlanet($planet);
$block->setItemId($buildingId);
$parentBlock->setPartial($blockName, $block);
}
echo $layout->render();
break;
}

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,7 +24,7 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('changelog');
$template = gettemplate('changelog_table');

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('chat');
$BodyTPL = gettemplate('chat_body');
@ -41,5 +41,5 @@ require_once dirname(__FILE__) .'/application/bootstrap.php';
$page = parsetemplate($BodyTPL, $parse);
display($page, $lang['Chat'], false);
// Shoutbox by e-Zobar - Copyright Wootook Team 2008
// Shoutbox by e-Zobar - Copyright XNova Team 2008
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
// On récupère les informations du message et de l'envoyeur
if (isset($_POST["msg"]) && isset($user['username'])) {
@ -49,5 +49,5 @@ require_once dirname(__FILE__) .'/application/bootstrap.php';
$query = doquery("INSERT INTO {{table}}(user, message, timestamp) VALUES ('".$nick."', '".$msg."', '".time()."')", "chat");
}
// Shoutbox by e-Zobar - Copyright Wootook Team 2008
// Shoutbox by e-Zobar - Copyright XNova Team 2008
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
// On efface les anciens messages
$timemoment=time();
@ -62,12 +62,12 @@ while($v=mysql_fetch_object($query)){
$msg=preg_replace("#:\(#isU","<img src=\"images/smileys/sad.png\" align=\"absmiddle\" title=\":(\" alt=\":(\">",$msg);
$msg=preg_replace("#;\)#isU","<img src=\"images/smileys/wink.png\" align=\"absmiddle\" title=\";)\" alt=\";)\">",$msg);
$msg=preg_replace("#:s#isU","<img src=\"images/smileys/shit.png\" align=\"absmiddle\" title=\":s\" alt=\":s\">",$msg);
$msg=preg_replace("#xnova#","<a href=\"http://wootook.org\">Wootook</a>",$msg);
$msg=preg_replace("#xnova#","<a href=\"http://www.xnova-ng.org\">XNova</a>",$msg);
// Affichage du message
$msg="<div align=\"left\">".$nick." > ".$msg."<br></div>";
print stripslashes($msg);
}
// Shoutbox by e-Zobar - Copyright Wootook Team 2008
// Shoutbox by e-Zobar - Copyright XNova Team 2008
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,15 +24,12 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
if (!defined('PHP_VERSION_ID')) {
$version = explode('.',PHP_VERSION);
define('PHP_VERSION_ID', (((int)$version[0]) * 10000 + ((int)$version[1]) * 100 + ((int)$version[2])));
unset($version);
}
define('DEPRECATION', true);
define('DEBUG', true);
if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
define('DEBUG', true);
@ -59,12 +56,12 @@ if (!defined('DEBUG')) {
@error_reporting(E_ALL | E_STRICT);
}
defined('ROOT_PATH') || define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
defined('ROOT_PATH') || define('ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
defined('PHPEXT') || define('PHPEXT', 'php');
defined('PHPEXT') || define('PHPEXT', require 'extension.inc');
defined('VERSION') || define('VERSION', '1.5.0-beta2');
defined('VERSION') || define('VERSION', '2011.1');
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
@ -78,63 +75,52 @@ function __autoload($class) {
include_once str_replace('_', '/', $class) . '.php';
}
if (defined('IN_ADMIN')) {
$website = new Wootook_Core_Model_Website();
$website->setId(0)->setData('code', 'admin');
Wootook::addWebsite($website);
Wootook::setDefaultWebsite($website);
Legacies_Core_Time::init();
Legacies_Core_ErrorProfiler::register();
$game = new Wootook_Core_Model_Game();
$game->setId(0)->setData('code', 'admin')->setData('website_id', $website->getId());
Wootook::addGame($game);
Wootook::setDefaultGame($game);
if (0 === filesize(ROOT_PATH . 'config.php')) {
header('Location: install/');
die();
}
include ROOT_PATH . 'includes/constants.php';
if (defined('DEBUG')) {
Wootook_Core_ErrorProfiler::register();
}
Wootook_Core_Helper_Config_Events::registerEvents();
if (!Wootook::$isInstalled) {
Wootook::getResponse()
->setRedirect(Wootook::getStaticUrl('install/'), Wootook_Core_Mvc_Controller_Response_Http::REDIRECT_TEMPORARY)
->sendHeaders();
exit(0);
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
foreach ($listenerList as $listener) {
Legacies::registerListener($event, $listener);
}
}
$lang = array();
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
define('TEMPLATE_NAME', 'OpenGame');
define('DEFAULT_LANG', 'fr');
include(ROOT_PATH . 'includes/debug.class.'.PHPEXT);
$debug = new Debug();
include(ROOT_PATH . 'includes/constants.' . PHPEXT);
include(ROOT_PATH . 'includes/functions.' . PHPEXT);
include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT);
include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT);
include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
include(ROOT_PATH . 'db/mysql.' . PHPEXT);
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
$user = Wootook_Player_Model_Session::getSingleton()->getPlayer();
$gameConfig = Legacies_Core_Model_Config::getSingleton();
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
Legacies_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
}
$user = Legacies_Empire_Model_User::getSingleton();
if (!defined('DISABLE_IDENTITY_CHECK')) {
if ($user === null || !$user->getId()) {
Wootook::getResponse()
->setRedirect(Wootook::getUrl('player/account/login'))
->sendHeaders();
if (($user === null || !$user->getId())) {
header('Location: login.php');
exit(0);
}
//var_dump(Wootook::getGameConfig('game/general/active'));
if (!Wootook::getGameConfig('game/general/active')/* && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))*/) {
$layout = new Wootook_Core_Model_Layout(Wootook_Core_Model_Layout::DOMAIN_FRONTEND);
$layout->load('message');
$block = $layout->getBlock('message');
$block['title'] = Wootook::__('Game is disabled.');
$block['message'] = Wootook::getGameConfig('game/general/closing-message');
echo $layout->render();
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
exit(0);
}
}
@ -149,15 +135,15 @@ if (($user !== null && $user->getId())) {
$planet = $user->getCurrentPlanet();
foreach ($user->getPlanetCollection() as $userPlanet) {
FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model
foreach ($user->getPlanetCollection() as $planet) {
FlyingFleetHandler($planet); // TODO: implement logic into a refactored model
}
/*
* Update planet resources and constructions
*/
Wootook::dispatchEvent('planet.update', array(
Legacies::dispatchEvent('planet.update', array(
'planet' => $planet
));
$planet->save();
}
}

21
config.php.default Normal file
View file

@ -0,0 +1,21 @@
<?php return array(
'global' => array(
'date' => array(
'timezone' => 'Europe/Paris'
),
'database' => array(
'engine' => 'mysql',
'options' => array(
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'db_xnova'
),
'table_prefix' => 'game_',
),
'layout' => array(
'page' => 'page.php',
'empire' => 'empire.php'
)
)
);

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,14 +24,14 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('DISABLE_IDENTITY_CHECK', true);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('contact');
@ -44,7 +44,7 @@ require_once dirname(__FILE__) .'/application/bootstrap.php';
$QrySelectUser .= "WHERE `authlevel` != '0' ORDER BY `authlevel` DESC;";
$GameOps = doquery ( $QrySelectUser, 'users');
while( $Ops = $GameOps->fetch(PDO::FETCH_ASSOC) ) {
while( $Ops = mysql_fetch_assoc($GameOps) ) {
$bloc['ctc_data_name'] = $Ops['username'];
$bloc['ctc_data_auth'] = $lang['user_level'][$Ops['authlevel']];
$bloc['ctc_data_mail'] = "<a href=mailto:".$Ops['email'].">".$Ops['email']."</a>";

View file

@ -1,10 +1,10 @@
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify

View file

@ -1,10 +1,10 @@
/**
* This file is part of Wootook
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -47,7 +47,7 @@ a:hover {
position: relative;
width: 886px;
height: 580px;
background-image: url(../graphics/images/tlo.jpg);
background-image: url(../images/tlo.jpg);
background-repeat: none;
}

64
db/mysql.php Normal file
View file

@ -0,0 +1,64 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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.
*
*/
/**
*
* Enter description here ...
* @deprecated
* @param string $query
* @param string $table
* @param bool $fetch
*/
function doquery($query, $table, $fetch = false)
{
/**
* @var Legacies_Database $database
*/
$database = Legacies_Database::getSingleton();
$sql = str_replace("{{table}}", $database->getTable($table), $query);
/**
* @var PDOStatement $statement
*/
try {
$statement = $database->prepare($sql);
$statement->execute(array());
} catch (PDOException $e) {
trigger_error($e->getMessage() . PHP_EOL . "<br /><pre></code>$sql<code></pre><br />" . PHP_EOL, E_USER_WARNING);
}
if ($fetch) {
return $statement->fetch(PDO::FETCH_BOTH);
} else {
return $statement;
}
}

View file

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 718 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 669 B

After

Width:  |  Height:  |  Size: 669 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 576 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 850 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 683 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 954 B

After

Width:  |  Height:  |  Size: 954 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

Before After
Before After

1
extension.inc Normal file
View file

@ -0,0 +1 @@
<?php return 'php';

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

285
fleet.php Normal file
View file

@ -0,0 +1,285 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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';
$maxfleet = doquery("SELECT COUNT(fleet_owner) AS `actcnt` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', true);
$MaxFlyingFleets = $maxfleet['actcnt'];
//Compteur de flotte en expéditions et nombre d'expédition maximum
$MaxExpedition = $user[$resource[124]];
if ($MaxExpedition >= 1) {
$maxexpde = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets', true);
$ExpeditionEnCours = $maxexpde['expedi'];
$EnvoiMaxExpedition = 1 + floor( $MaxExpedition / 3 );
}
$MaxFlottes = 1 + $user[$resource[108]];
CheckPlanetUsedFields($planetrow);
includeLang('fleet');
$missiontype = array(
1 => $lang['type_mission'][1],
2 => $lang['type_mission'][2],
3 => $lang['type_mission'][3],
4 => $lang['type_mission'][4],
5 => $lang['type_mission'][5],
6 => $lang['type_mission'][6],
7 => $lang['type_mission'][7],
8 => $lang['type_mission'][8],
9 => $lang['type_mission'][9],
15 => $lang['type_mission'][15]
);
// Histoire de recuperer les infos passées par galaxy
$galaxy = $_GET['galaxy'];
$system = $_GET['system'];
$planet = $_GET['planet'];
$planettype = $_GET['planettype'];
$target_mission = $_GET['target_mission'];
if (!$galaxy) {
$galaxy = $planetrow['galaxy'];
}
if (!$system) {
$system = $planetrow['system'];
}
if (!$planet) {
$planet = $planetrow['planet'];
}
if (!$planettype) {
$planettype = $planetrow['planet_type'];
}
$page = "<script language=\"JavaScript\" src=\"scripts/flotten.js\"></script>\n";
$page .= "<script language=\"JavaScript\" src=\"scripts/ocnt.js\"></script>\n";
$page .= "<br><center>";
$page .= "<table width='519' border='0' cellpadding='0' cellspacing='1'>";
$page .= "<tr height='20'>";
$page .= "<td colspan='9' class='c'>";
$page .= "<table border=\"0\" width=\"100%\">";
$page .= "<tbody><tr>";
$page .= "<td style=\"background-color: transparent;\">";
$page .= $lang['fl_title']." ".$MaxFlyingFleets." ".$lang['fl_sur']." ".$MaxFlottes;
$page .= "</td><td style=\"background-color: transparent;\" align=\"right\">";
$page .= $ExpeditionEnCours."/".$EnvoiMaxExpedition." ".$lang['fl_expttl'];
$page .= "</td>";
$page .= "</tr></tbody></table>";
$page .= "</td>";
$page .= "</tr><tr height='20'>";
$page .= "<th>".$lang['fl_id']."</th>";
$page .= "<th>".$lang['fl_mission']."</th>";
$page .= "<th>".$lang['fl_count']."</th>";
$page .= "<th>".$lang['fl_from']."</th>";
$page .= "<th>".$lang['fl_start_t']."</th>";
$page .= "<th>".$lang['fl_dest']."</th>";
$page .= "<th>".$lang['fl_dest_t']."</th>";
// $page .= "<th>".$lang['fl_back_t']."</th>";
$page .= "<th>".$lang['fl_back_in']."</th>";
$page .= "<th>".$lang['fl_order']."</th>";
$page .= "</tr>";
// Gestion des flottes du joueur actif
$fq = doquery("SELECT * FROM {{table}} WHERE fleet_owner={$user[id]}", "fleets");
$i = 0;
while ($f = $fq->fetch(PDO::FETCH_BOTH)) {
$i++;
$page .= "<tr height=20>";
// (01) Fleet ID
$page .= "<th>".$i."</th>";
// (02) Fleet Mission
$page .= "<th>";
$page .= "<a>". $missiontype[$f[fleet_mission]] ."</a>";
if (($f['fleet_start_time'] + 1) == $f['fleet_end_time']) {
$page .= "<br><a title=\"".$lang['fl_back_to_ttl']."\">".$lang['fl_back_to']."</a>";
} else {
$page .= "<br><a title=\"".$lang['fl_get_to_ttl']."\">".$lang['fl_get_to']."</a>";
}
$page .= "</th>";
// (03) Fleet Mission
$page .= "<th><a title=\"";
// Fleet details (commentaire)
$fleet = explode(";", $f['fleet_array']);
$e = 0;
foreach ($fleet as $a => $b) {
if ($b != '') {
$e++;
$a = explode(",", $b);
$page .= $lang['tech'][$a[0]]. ":". $a[1] ."\n";
if ($e > 1) {
$page .= "\t";
}
}
}
$page .= "\">". pretty_number($f[fleet_amount]) ."</a></th>";
// (04) Fleet From (Planete d'origine)
$page .= "<th>[".$f[fleet_start_galaxy].":".$f[fleet_start_system].":".$f[fleet_start_planet]."]</th>";
// (05) Fleet Start Time
$page .= "<th>". gmdate("d. M Y H:i:s", $f['fleet_start_time']) ."</th>";
// (06) Fleet Target (Planete de destination)
$page .= "<th>[".$f[fleet_end_galaxy].":".$f[fleet_end_system].":".$f[fleet_end_planet]."]</th>";
// (07) Fleet Target Time
$page .= "<th>". gmdate("d. M Y H:i:s", $f['fleet_end_time']) ."</th>";
// (08) Fleet Back Time
// $page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>". pretty_time(floor($f['fleet_end_time'] + 1 - time())) ."</font></th>";
// (09) Fleet Back In
$page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>". pretty_time(floor($f['fleet_end_time'] + 1 - time())) ."</font></th>";
// (10) Orders
$page .= "<th>";
if ($f['fleet_mess'] == 0) {
$page .= "<form action=\"fleetback.php\" method=\"post\">";
$page .= "<input name=\"fleetid\" value=\"". $f['fleet_id'] ."\" type=\"hidden\">";
$page .= "<input value=\" ".$lang['fl_back_to_ttl']." \" type=\"submit\" name=\"send\">";
$page .= "</form>";
if ($f[fleet_mission] == 1) {
$page .= "<form action=\"verband.php\" method=\"post\">";
$page .= "<input name=\"fleetid\" value=\"". $f['fleet_id'] ."\" type=\"hidden\">";
$page .= "<input value=\" ".$lang['fl_associate']." \" type=\"submit\">";
$page .= "</form>";
}
} else {
$page .= "&nbsp;-&nbsp;";
}
$page .= "</th>";
// Fin de ligne
$page .= "</tr>";
}
// Y a pas de flottes en vol ... on met des '-'
if ($i == 0) {
$page .= "<tr>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
// $page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "</tr>";
}
if ($MaxFlottes == $MaxFlyingFleets) {
$page .= "<tr height=\"20\"><th colspan=\"9\"><font color=\"red\">".$lang['fl_noslotfree']."</font></th></tr>";
}
$page .= "</table></center>";
$page .= "<center>";
// Selection d'une nouvelle mission
$page .= "<form action=\"floten1.php\" method=\"post\">";
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"4\" class=\"c\">".$lang['fl_new_miss']."</td>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th>".$lang['fl_fleet_typ']."</th>";
$page .= "<th>".$lang['fl_fleet_disp']."</th>";
$page .= "<th>-</th>";
$page .= "<th>-</th>";
$page .= "</tr>";
if (!$planetrow) {
message($lang['fl_noplanetrow'], $lang['fl_error']);
}
// Prise des coordonnées sur la ligne de commande
$galaxy = intval($_GET['galaxy']);
$system = intval($_GET['system']);
$planet = intval($_GET['planet']);
$planettype = intval($_GET['planettype']);
$target_mission = intval($_GET['target_mission']);
$ShipData = "";
foreach ($reslist['fleet'] as $n => $i) {
if ($planetrow[$resource[$i]] > 0) {
$page .= "<tr height=\"20\">";
$page .= "<th><a title=\"". $lang['fl_fleetspeed'] . $CurrentShipSpeed ."\">" . $lang['tech'][$i] . "</a></th>";
$page .= "<th>". pretty_number ($planetrow[$resource[$i]]);
$ShipData .= "<input type=\"hidden\" name=\"maxship". $i ."\" value=\"". $planetrow[$resource[$i]] ."\" />";
$ShipData .= "<input type=\"hidden\" name=\"consumption". $i ."\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
$ShipData .= "<input type=\"hidden\" name=\"speed" .$i ."\" value=\"" . GetFleetMaxSpeed ("", $i, $user) . "\" />";
$ShipData .= "<input type=\"hidden\" name=\"capacity". $i ."\" value=\"". $pricelist[$i]['capacity'] ."\" />";
$page .= "</th>";
// Satelitte Solaire (eux ne peuvent pas bouger !)
if ($i == 212) {
$page .= "<th></th><th></th>";
} else {
$page .= "<th><a href=\"javascript:maxShip('ship". $i ."'); shortInfo();\">".$lang['fl_selmax']."</a> </th>";
$page .= "<th><input name=\"ship". $i ."\" size=\"10\" value=\"0\" onfocus=\"javascript:if(this.value == '0') this.value='';\" onblur=\"javascript:if(this.value == '') this.value='0';\" alt=\"". $lang['tech'][$i] . $planetrow[$resource[$i]] ."\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" /></th>";
}
$page .= "</tr>";
}
$have_ships = true;
}
$btncontinue = "<tr height=\"20\"><th colspan=\"4\"><input type=\"submit\" value=\" ".$lang['fl_continue']." \" /></th>";
$page .= "<tr height=\"20\">";
if (!$have_ships) {
// Il n'y a pas de vaisseaux sur cette planete
$page .= "<th colspan=\"4\">". $lang['fl_noships'] ."</th>";
$page .= "</tr>";
$page .= $btncontinue;
} else {
$page .= "<th colspan=\"2\"><a href=\"javascript:noShips();shortInfo();noResources();\" >". $lang['fl_unselectall'] ."</a></th>";
$page .= "<th colspan=\"2\"><a href=\"javascript:maxShips();shortInfo();\" >". $lang['fl_selectall'] ."</a></th>";
$page .= "</tr>";
if ($MaxFlottes > $MaxFlyingFleets) {
$page .= $btncontinue;
}
}
$page .= "</tr>";
$page .= "</table>";
$page .= $ShipData;
$page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $galaxy ."\" />";
$page .= "<input type=\"hidden\" name=\"system\" value=\"". $system ."\" />";
$page .= "<input type=\"hidden\" name=\"planet\" value=\"". $planet ."\" />";
$page .= "<input type=\"hidden\" name=\"planet_type\" value=\"". $planettype ."\" />";
$page .= "<input type=\"hidden\" name=\"mission\" value=\"". $target_mission ."\" />";
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $EnvoiMaxExpedition ."\" />";
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $ExpeditionEnCours ."\" />";
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
$page .= "</form>";
$page .= "</center>";
display($page, $lang['fl_title']);
?>

73
fleetback.php Normal file
View file

@ -0,0 +1,73 @@
<?php
/*
Galacticnova : An open-source web-based game !
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
License: AGPL
Author: Vincent Debarre <vinilox@vinilox.eu>
Website: http://project.galacticnova.vinilox.eu/
Last revision: 13/07/11
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/common.php';
includeLang('fleet');
$BoxTitle = $lang['fl_error'];
$TxtColor = "red";
$BoxMessage = $lang['fl_notback'];
if ( is_numeric($_POST['fleetid']) ) {
$fleetid = intval($_POST['fleetid']);
$FleetRow = doquery("SELECT * FROM {{table}} WHERE `fleet_id` = '". $fleetid ."';", 'fleets', true);
$i = 0;
if ($FleetRow['fleet_owner'] == $user['id']) {
if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) {
if ($FleetRow['fleet_end_stay'] != 0) {
// Faut calculer le temps reel de retour
if ($FleetRow['fleet_start_time'] > time()) {
// On a pas encore entamé le stationnement
// Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte
$CurrentFlyingTime = time() - $FleetRow['start_time'];
} else {
// On est deja en stationnement
// Il faut donc directement calculer la durée d'un vol aller ou retour
$CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time'];
}
} else {
// C'est quoi le stationnement ??
// On calcule sagement la parcelle de temps ecoulée depuis le depart
$CurrentFlyingTime = time() - $FleetRow['start_time'];
}
// Allez houste au bout du compte y a la maison !! (E.T. phone home.............)
$ReturnFlyingTime = $CurrentFlyingTime + time();
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', ";
$QryUpdateFleet .= "`fleet_end_stay` = '0', ";
$QryUpdateFleet .= "`fleet_end_time` = '". ($ReturnFlyingTime + 1) ."', ";
$QryUpdateFleet .= "`fleet_target_owner` = '". $user['id'] ."', ";
$QryUpdateFleet .= "`fleet_mess` = '1' ";
$QryUpdateFleet .= "WHERE ";
$QryUpdateFleet .= "`fleet_id` = '" . $fleetid . "';";
doquery( $QryUpdateFleet, 'fleets');
$BoxTitle = $lang['fl_sback'];
$TxtColor = "lime";
$BoxMessage = $lang['fl_isback'];
} elseif ($FleetRow['fleet_mess'] == 1) {
$BoxMessage = $lang['fl_notback'];
}
} else {
$BoxMessage = $lang['fl_onlyyours'];
}
}
message ("<font color=\"".$TxtColor."\">". $BoxMessage ."</font>", $BoxTitle, "fleet.". PHPEXT, 2);
// -----------------------------------------------------------------------------------------------------------
?>

165
fleetshortcut.php Normal file
View file

@ -0,0 +1,165 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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';
$mode = $_GET['mode'];
$a = $_GET['a'];
/*
Este script es original xD
La funcion de este script es administrar una variable del $user
Permite agregar y quitar arrays...
*/
//Lets start!
if(isset($_GET['mode'])){
if($_POST){
//Pegamos el texto :P
if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";}
$r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n";
$user['fleet_shortcut'] .= $r;
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrment","fleetshortcut.php");
}
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Nom [Galaxie/Syst&egrave;me solaire/Plan&egrave;te]</td>
</tr><tr height=\"20\"><th>
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"Name\">
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"Galaxie\">
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"Sonnensystem\">
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"Planet\">
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=\"reset\" value=\"Zur&uuml;cksetzen\"> <input type=\"submit\" value=\"Enregistrer\">";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
$page .= "</th></tr>";
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
}
elseif(isset($_GET['a'])){
if($_POST){
//Armamos el array...
$scarray = explode("\r\n",$user['fleet_shortcut']);
if($_POST["delete"]){
unset($scarray[$a]);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Shortcut wurde gel&ouml;scht","Gel&ouml;scht","fleetshortcut.php");
}
else{
$r = explode(",",$scarray[$a]);
$r[0] = strip_tags($_POST['n']);
$r[1] = intval($_POST['g']);
$r[2] = intval($_POST['s']);
$r[3] = intval($_POST['p']);
$r[4] = intval($_POST['t']);
$scarray[$a] = implode(",",$r);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; &eacute;dit&eacute; !.","Editer","fleetshortcut.php");
}
}
if($user['fleet_shortcut']){
$scarray = explode("\r\n",$user['fleet_shortcut']);
$c = explode(',',$scarray[$a]);
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]</td>
</tr>";
//if($i==0){$page .= "";}
$page .= "<tr height=\"20\"><th>
<input type=hidden name=a value=$a>
<input type=text name=n value=\"{$c[0]}\" size=32 maxlength=32>
<input type=text name=g value=\"{$c[1]}\" size=3 maxlength=1>
<input type=text name=s value=\"{$c[2]}\" size=3 maxlength=3>
<input type=text name=p value=\"{$c[3]}\" size=3 maxlength=3>
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
$page .= "</th></tr>";
}else{$page .= message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrer","fleetshortcut.php");}
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
}
else{
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
<tr height="20">
<td colspan="2" class="c">Raccourcis(<a href="?mode=add">Ajout</a>)</td>
</tr>';
if($user['fleet_shortcut']){
/*
Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones
de acceso directo, el formato es el siguiente.
Nombre, Galaxia,Sistema,Planeta,Tipo
*/
$scarray = explode("\r\n",$user['fleet_shortcut']);
$i=$e=0;
foreach($scarray as $a => $b){
if($b!=""){
$c = explode(',',$b);
if($i==0){$page .= "<tr height=\"20\">";}
$page .= "<th><a href=\"?a=".$e++."\">";
$page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";}
$page .= "</a></th>";
if($i==1){$page .= "</tr>";}
if($i==1){$i=0;}else{$i=1;}
}
}
if($i==1){$page .= "<th></th></tr>";}
}else{$page .= "<th colspan=\"2\">Pas de Raccourcis</th>";}
$page .= '<tr><td colspan=2 class=c><a href=fleet.php>Retour</a></td></tr></tr></table>';
}
display($page,"Shortcutmanager");
// Created by Perberos. All rights reversed (C) 2006
?>

286
floten1.php Normal file
View file

@ -0,0 +1,286 @@
<?php
/**
* Tis file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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('fleet');
$speed = array(10 => 100,
9 => 90,
8 => 80,
7 => 70,
6 => 60,
5 => 50,
4 => 40,
3 => 30,
2 => 20,
1 => 10,
);
$g = $_POST['galaxy'];
$s = $_POST['system'];
$p = $_POST['planet'];
$t = $_POST['planet_type'];
if (!$g) {
$g = $planetrow['galaxy'];
}
if (!$s) {
$s = $planetrow['system'];
}
if (!$p) {
$p = $planetrow['planet'];
}
if (!$t) {
$t = $planetrow['planet_type'];
}
// Verifions si nous avons bien tout ce que nous voullons envoyer
$FleetHiddenBlock = "";
foreach ($reslist['fleet'] as $n => $i) {
if ($i > 200 && $i < 300 && $_POST["ship$i"] > "0") {
if ($_POST["ship$i"] > $planetrow[$resource[$i]]) {
$page .= $lang['fl_noenought'];
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
} else {
$fleet['fleetarray'][$i] = $_POST["ship$i"];
// Tableau des vaisseaux avec leur nombre
$fleet['fleetlist'] .= $i . "," . $_POST["ship$i"] . ";";
// Nombre total de vaisseaux
$fleet['amount'] += $_POST["ship$i"];
// Tableau des vitesses
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"consumption". $i ."\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"speed". $i ."\" value=\"". GetFleetMaxSpeed ( "", $i, $user ) ."\" />";
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"capacity". $i ."\" value=\"". $pricelist[$i]['capacity'] ."\" />";
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"ship". $i ."\" value=\"". $_POST["ship$i"] ."\" />";
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
}
}
}
if (!$fleet['fleetlist']) {
message($lang['fl_unselectall'], $lang['fl_error'], "fleet." . PHPEXT, 1);
} else {
$speedallsmin = min($speedalls);
}
$page .= "<script type=\"text/javascript\" src=\"scripts/flotten.js\"></script>";
$page .= "<script type=\"text/javascript\">\n";
$page .= "function getStorageFaktor() {\n";
$page .= " return 1\n";
$page .= "}\n";
$page .= "</script>\n";
$page .= "<form action=\"floten2.php\" method=\"post\">";
$page .= $FleetHiddenBlock;
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $speedallsmin ."\" />";
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". str_rot13(base64_encode(serialize($fleet['fleetarray']))) ."\" />";
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planetrow['galaxy'] ."\" />";
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planetrow['system'] ."\" />";
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planetrow['planet'] ."\" />";
$page .= "<input type=\"hidden\" name=\"galaxyend\" value=\"". intval($_POST['galaxy']) ."\" />";
$page .= "<input type=\"hidden\" name=\"systemend\" value=\"". intval($_POST['system']) ."\" />";
$page .= "<input type=\"hidden\" name=\"planetend\" value=\"". intval($_POST['planet']) ."\" />";
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". GetGameSpeedFactor () ."\" />";
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $planetrow['planet_type'] ."\" />";
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow['metal']) ."\" />";
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow['crystal']) ."\" />";
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow['deuterium']) ."\" />";
$page .= "<br><div><center>";
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_floten1_ttl'] ."</td>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th width=\"50%\">". $lang['fl_dest'] ."</th>";
$page .= "<th>";
$page .= "<input name=\"galaxy\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $g ."\" />";
$page .= "<input name=\"system\" size=\"3\" maxlength=\"3\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $s ."\" />";
$page .= "<input name=\"planet\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $p ."\" />";
$page .= "<select name=\"planettype\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
$page .= "<option value=\"1\"". (($t == 1) ? " SELECTED" : "" ) .">". $lang['fl_planet'] ." </option>";
$page .= "<option value=\"2\"". (($t == 2) ? " SELECTED" : "" ) .">". $lang['fl_ruins'] ." </option>";
$page .= "<option value=\"3\"". (($t == 3) ? " SELECTED" : "" ) .">". $lang['fl_moon'] ." </option>";
$page .= "</select>";
$page .= "</th>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th>". $lang['fl_speed'] ."</th>";
$page .= "<th>";
$page .= "<select name=\"speed\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
foreach ($speed as $a => $b) {
$page .= "<option value=\"".$a."\">".$b."</option>";
}
$page .= "</select> %";
$page .= "</th>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th>". $lang['fl_dist'] ."</th>";
$page .= "<th><div id=\"distance\">-</div></th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_fltime'] ."</th>";
$page .= "<th><div id=\"duration\">-</div></th>";
$page .= "</tr><tr height=\"20\">";
/* A faire assez rapidement (faut juste savoir comment)
$page .= "<th>". $lang['fl_time_go'] ."</th>";
$page .= "<th><font color=\"lime\"><div id=\"llegada1\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_back'] ."</th>";
$page .= "<th><font color=\"lime\"><div id=\"llegada2\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
$page .= "</tr><tr height=\"20\">";
*/
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
$page .= "<th><div id=\"consumption\">-</div></th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_speed_max'] ."</th>";
$page .= "<th><div id=\"maxspeed\">-</div></th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_max_load'] ."</th>";
$page .= "<th><div id=\"storage\">-</div></th>";
$page .= "</tr>";
// Gestion des raccourcis sur la galaxie
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_shortcut'] ." <a href=\"fleetshortcut.php\">". $lang['fl_shortlnk'] ."</a></td>";
$page .= "</tr>";
if ($user['fleet_shortcut']) {
$scarray = explode("\r\n", $user['fleet_shortcut']);
$i = 0;
foreach ($scarray as $a => $b) {
if ($b != "") {
$c = explode(',', $b);
if ($i == 0) {
$page .= "<tr height=\"20\">";
}
$page .= "<th><a href=\"javascript:setTarget(". $c[1] .",". $c[2] .",". $c[3] .",". $c[4] ."); shortInfo();\"";
$page .= ">". $c[0] ." ". $c[1] .":". $c[2] .":". $c[3] ." ";
// Signalisation du type de raccourci ...
// (P)lanete
// (D)ebris
// (L)une
if ($c[4] == 1) {
$page .= $lang['fl_shrtcup1'];
} elseif ($c[4] == 2) {
$page .= $lang['fl_shrtcup2'];
} elseif ($c[4] == 3) {
$page .= $lang['fl_shrtcup3'];
}
$page .= "</a></th>";
if ($i == 1) {
$page .= "</tr>";
}
if ($i == 1) {
$i = 0;
} else {
$i = 1;
}
}
}
if ($i == 1) {
$page .= "<th></th></tr>";
}
} else {
$page .= "<tr height=\"20\">";
$page .= "<th colspan=\"2\">". $lang['fl_noshortc'] ."</th>";
$page .= "</tr>";
}
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_myplanets'] ."</td>";
$page .= "</tr>";
// Gestion des raccourcis vers ses propres colonies ou planetes
$kolonien = SortUserPlanets ( $user );
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
if (mysql_num_rows($kolonien) > 1) {
$i = 0;
$w = 0;
$tr = true;
while ($row = $kolonien->fetch(PDO::FETCH_BOTH)) {
if ($w == 0 && $tr) {
$page .= "<tr height=\"20\">";
$tr = false;
}
if ($w == 2) {
$page .= "</tr>";
$w = 0;
$tr = true;
}
if ($row['planet_type'] == 3) {
$row['name'] .= " ". $lang['fl_shrtcup3'];
}
if ($currentplanet['galaxy'] == $row['galaxy'] &&
$currentplanet['system'] == $row['system'] &&
$currentplanet['planet'] == $row['planet'] &&
$currentplanet['planet_type'] == $row['planet_type'] ) {
// $page .= '<th><a href="javascript:setTarget('.$row['galaxy'].','.$row['system'].','.$row['planet'].','.$row['planet_type'].'); shortInfo();">'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'</a></th>';
} else {
$page .= "<th><a href=\"javascript:setTarget(". $row['galaxy'] .",". $row['system'] .",". $row['planet'] .",". $row['planet_type'] ."); shortInfo();\">". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ."</a></th>";
$w++;
$i++;
}
}
if ($i % 2 != 0) {
$page .= "<th>&nbsp;</th></tr>";
} elseif ($w == 2) {
$page .= "</tr>";
}
} else {
$page .= "<th colspan=\"2\">". $lang['fl_nocolonies'] ."</th>";
}
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_grattack'] ."</td>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th colspan=\"2\">-</th>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th colspan=\"2\"><input type=\"submit\" value=\"". $lang['fl_continue'] ."\" /></th>";
$page .= "</tr>";
$page .= "</table>";
$page .= "</div></center>";
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $_POST['maxepedition'] ."\" />";
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $_POST['curepedition'] ."\" />";
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
$page .= "</form>";
$page .= "<script>javascript:shortInfo(); </script>";
display($page, $lang['fl_title']);
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
// Created by Perberos. All rights reversed (C) 2006
?>

281
floten2.php Normal file
View file

@ -0,0 +1,281 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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('fleet');
$galaxy = intval($_POST['galaxy']);
$system = intval($_POST['system']);
$planet = intval($_POST['planet']);
$planettype = intval($_POST['planettype']);
// Test d'existance et de proprieté de la planete
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}}", "planets");
while ($row = $select->fetch(PDO::FETCH_BOTH)) {
if ($galaxy == $row['galaxy'] &&
$system == $row['system'] &&
$planet == $row['planet'] &&
$planettype == $row['planet_type']) {
if ($row['id_owner'] == $user['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} else {
$UsedPlanet = true;
}
break;
}
}
// Determinons les type de missions possibles par rapport a la planete cible
if ($_POST['planettype'] == "2") {
if ($_POST['ship209'] >= 1) {
$missiontype = array(8 => $lang['type_mission'][8]);
} else {
$missiontype = array();
}
} elseif ($_POST['planettype'] == "1" || $_POST['planettype'] == "3") {
if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
$missiontype = array(7 => $lang['type_mission'][7]);
} elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
$missiontype = array(6 => $lang['type_mission'][6]);
}
if ($_POST['ship202'] >= 1 ||
$_POST['ship203'] >= 1 ||
$_POST['ship204'] >= 1 ||
$_POST['ship205'] >= 1 ||
$_POST['ship206'] >= 1 ||
$_POST['ship207'] >= 1 ||
$_POST['ship210'] >= 1 ||
$_POST['ship211'] >= 1 ||
$_POST['ship213'] >= 1 ||
$_POST['ship214'] >= 1 ||
$_POST['ship215'] >= 1 ||
$_POST['ship216'] >= 1) {
if (!$YourPlanet) {
$missiontype[1] = $lang['type_mission'][1];
$missiontype[5] = $lang['type_mission'][5];
}
$missiontype[3] = $lang['type_mission'][3];
}
} elseif ($_POST['ship209'] >= 1 || $_POST['ship208'] >= 1) {
$missiontype[3] = $lang['type_mission'][3];
}
if ($YourPlanet)
$missiontype[4] = $lang['type_mission'][4];
if ( $_POST['planettype'] == 3 &&
($_POST['ship214'] ||
$_POST['ship213']) &&
!$YourPlanet &&
$UsedPlanet) {
$missiontype[2] = $lang['type_mission'][2];
}
if ( $_POST['planettype'] == 3 &&
($_POST['ship214'] >= 1 || $_POST['ship216'] >= 1) &&
!$YourPlanet &&
$UsedPlanet) {
$missiontype[9] = $lang['type_mission'][9];
}
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
$mission = $_POST['target_mission'];
$SpeedFactor = $_POST['speedfactor'];
$AllFleetSpeed = GetFleetMaxSpeed ($fleetarray, 0, $user);
$GenFleetSpeed = $_POST['speed'];
$MaxFleetSpeed = min($AllFleetSpeed);
$distance = GetTargetDistance ( $_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet'] );
$duration = GetMissionDuration ( $GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor );
$consumption = GetFleetConsumption ( $fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
$MissionSelector = "";
if (count($missiontype) > 0) {
if ($planet == 16) {
$MissionSelector .= "<tr height=\"20\">";
$MissionSelector .= "<th>";
$MissionSelector .= "<input type=\"radio\" name=\"mission\" value=\"15\" checked=\"checked\">". $lang['type_mission'][15] ."<br /><br />";
$MissionSelector .= "<font color=\"red\">". $lang['fl_expe_warning'] ."</font>";
$MissionSelector .= "</th>";
$MissionSelector .= "</tr>";
} else {
$i = 0;
foreach ($missiontype as $a => $b) {
$MissionSelector .= "<tr height=\"20\">";
$MissionSelector .= "<th>";
$MissionSelector .= "<input id=\"inpuT_".$i."\" type=\"radio\" name=\"mission\" value=\"".$a."\"". ($mission == $a ? " checked=\"checked\"":"") .">";
$MissionSelector .= "<label for=\"inpuT_".$i."\">".$b."</label><br>";
$MissionSelector .= "</th>";
$MissionSelector .= "</tr>";
$i++;
}
}
} else {
$MissionSelector .= "<tr height=\"20\">";
$MissionSelector .= "<th>";
$MissionSelector .= "<font color=\"red\">". $lang['fl_bad_mission'] ."</font>";
$MissionSelector .= "</th>";
$MissionSelector .= "</tr>";
}
if ($_POST['thisplanettype'] == 1) {
$TableTitle = "". $_POST['thisgalaxy'] .":". $_POST['thissystem'] .":". $_POST['thisplanet'] ." - ". $lang['fl_planet'] ."";
} elseif ($_POST['thisplanettype'] == 3) {
$TableTitle = "". $_POST['thisgalaxy'] .":". $_POST['thissystem'] .":". $_POST['thisplanet'] ." - ". $lang['fl_moon'] ."";
}
$page = "<script type=\"text/javascript\" src=\"scripts/flotten.js\">\n</script>";
$page .= "<script type=\"text/javascript\">\n";
$page .= "function getStorageFaktor() {\n";
$page .= " return 1;\n";
$page .= "}\n";
$page .= "</script>\n";
$page .= "<br><center>";
$page .= "<form action=\"floten3.php\" method=\"post\">\n";
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow["metal"]) ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow["crystal"]) ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow["deuterium"]) ."\" />\n";
$page .= "<input type=\"hidden\" name=\"consumption\" value=\"". $consumption ."\" />\n";
$page .= "<input type=\"hidden\" name=\"dist\" value=\"". $distance ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $_POST['speedfactor'] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $_POST["thisgalaxy"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $_POST["thissystem"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $_POST["thisplanet"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $_POST["galaxy"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"system\" value=\"". $_POST["system"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"planet\" value=\"". $_POST["planet"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $_POST["thisplanettype"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"planettype\" value=\"". $_POST["planettype"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $_POST["speedallsmin"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speed\" value=\"". $_POST['speed'] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $_POST["speedfactor"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". $_POST["usedfleet"] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $_POST['maxepedition'] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $_POST['curepedition'] ."\" />\n";
foreach ($fleetarray as $Ship => $Count) {
$page .= "<input type=\"hidden\" name=\"ship". $Ship ."\" value=\"". $Count ."\" />\n";
$page .= "<input type=\"hidden\" name=\"capacity". $Ship ."\" value=\"". $pricelist[$Ship]['capacity'] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"consumption". $Ship ."\" value=\"". GetShipConsumption ( $Ship, $user ) ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speed". $Ship ."\" value=\"". GetFleetMaxSpeed ( "", $Ship, $user ) ."\" />\n";
}
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">\n";
$page .= "<tbody>\n";
$page .= "<tr align=\"left\" height=\"20\">\n";
$page .= "<td class=\"c\" colspan=\"2\">". $TableTitle ."</td>\n";
$page .= "</tr>\n";
$page .= "<tr align=\"left\" valign=\"top\">\n";
$page .= "<th width=\"50%\">\n";
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"259\">\n";
$page .= "<tbody>\n";
$page .= "<tr height=\"20\">\n";
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_mission'] ."</td>\n";
$page .= "</tr>\n";
$page .= $MissionSelector;
$page .= "</tbody>\n";
$page .= "</table>\n";
$page .= "</th>\n";
$page .= "<th>\n";
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"259\">\n";
$page .= "<tbody>\n";
$page .= "<tr height=\"20\">\n";
$page .= "<td colspan=\"3\" class=\"c\">". $lang['fl_ressources'] ."</td>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Metal'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('1');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource1\" alt=\"". $lang['Metal'] ." ". floor($planetrow["metal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Crystal'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('2');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource2\" alt=\"". $lang['Crystal'] ." ". floor($planetrow["crystal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Deuterium'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('3');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource3\" alt=\"". $lang['Deuterium'] ." ". floor($planetrow["deuterium"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['fl_space_left'] ."</th>\n";
$page .= "<th colspan=\"2\"><div id=\"remainingresources\">-</div></th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th colspan=\"3\"><a href=\"javascript:maxResources()\">". $lang['fl_allressources'] ."</a></th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th colspan=\"3\">&nbsp;</th>\n";
$page .= "</tr>\n";
if ($planet == 16) {
$page .= "<tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th colspan=\"3\">";
$page .= "<select name=\"expeditiontime\" >";
$page .= "<option value=\"1\">1</option>";
$page .= "<option value=\"2\">2</option>";
$page .= "</select>";
$page .= $lang['fl_expe_hours'];
$page .= "</th>";
$page .= "</tr>";
} elseif ( $missiontype[5] != '' ) {
$page .= "<tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
$page .= "</tr>";
$page .= "<tr height=\"20\">";
$page .= "<th colspan=\"3\">";
$page .= "<select name=\"holdingtime\" >";
$page .= "<option value=\"0\">0</option>";
$page .= "<option value=\"1\">1</option>";
$page .= "<option value=\"2\">2</option>";
$page .= "<option value=\"4\">4</option>";
$page .= "<option value=\"8\">8</option>";
$page .= "<option value=\"16\">16</option>";
$page .= "<option value=\"32\">32</option>";
$page .= "</select>";
$page .= $lang['fl_expe_hours'];
$page .= "</th>";
$page .= "</tr>";
}
$page .= "</tbody>\n";
$page .= "</table>\n";
$page .= "</th>\n";
$page .= "</tr><tr height=\"20\">\n";
$page .= "<th colspan=\"2\"><input accesskey=\"z\" value=\"". $lang['fl_continue'] ."\" type=\"submit\"></th>\n";
$page .= "</tr>\n";
$page .= "</tbody>\n";
$page .= "</table>\n";
$page .= "</form></center>\n";
display($page, $lang['fl_title']);
?>

539
floten3.php Normal file
View file

@ -0,0 +1,539 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
includeLang('fleet');
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."'", 'planets', true);
$TargetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '". $_POST['galaxy'] ."' AND `system` = '". $_POST['system'] ."' AND `planet` = '". $_POST['planet'] ."' AND `planet_type` = '". $_POST['planettype'] ."';", 'planets', true);
$MyDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['id']."';", 'users', true);
$protection = $gameConfig['noobprotection'];
$protectiontime = $gameConfig['noobprotectiontime'];
$protectionmulti = $gameConfig['noobprotectionmulti'];
if ($protectiontime < 1) {
$protectiontime = 9999999999999999;
}
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
if (!is_array($fleetarray)) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
// On verifie s'il y a assez de vaisseaux sur la planete !
foreach ($fleetarray as $Ship => $Count) {
if ($Count > $CurrentPlanet[$resource[$Ship]]) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
$error = 0;
$galaxy = intval($_POST['galaxy']);
$system = intval($_POST['system']);
$planet = intval($_POST['planet']);
$planettype = intval($_POST['planettype']);
$fleetmission = $_POST['mission'];
if ($planettype != 1 && $planettype != 2 && $planettype != 3) {
message ("<font color=\"red\"><b>". $lang['fl_fleet_err_pl'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($fleetmission == 8) {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."'", "planets");
} else {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."' AND planet_type = '". $planettype ."'", "planets");
}
if ($CurrentPlanet['galaxy'] == $galaxy &&
$CurrentPlanet['system'] == $system &&
$CurrentPlanet['planet'] == $planet &&
$CurrentPlanet['planet_type'] == $planettype) {
message ("<font color=\"red\"><b>". $lang['fl_ownpl_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
// Test d'existance de l'enregistrement dans la gaalxie !
if ($_POST['mission'] != 15) {
if (mysql_num_rows($select) < 1 && $fleetmission != 7) {
message ("<font color=\"red\"><b>". $lang['fl_unknow_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
} elseif ($fleetmission == 9 && mysql_num_rows($select) < 1) {
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
} else {
$EnvoiMaxExpedition = $_POST['maxepedition'];
$Expedition = $_POST['curepedition'];
if ($EnvoiMaxExpedition == 0 ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_notech'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
} elseif ($Expedition >= $EnvoiMaxExpedition ) {
message ("<font color=\"red\"><b>". $lang['fl_expe_max'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
$select = mysql_fetch_array($select);
if ($select['id_owner'] == $user['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} elseif (!empty($select['id_owner'])) {
$YourPlanet = false;
$UsedPlanet = true;
} else {
$YourPlanet = false;
$UsedPlanet = false;
}
// Determinons les type de missions possibles par rapport a la planete cible
if ($fleetmission == 15) {
// Gestion des Exp<78>ditions
$missiontype = array(15 => $lang['type_mission'][15]);
} else {
if ($_POST['planettype'] == "2") {
if ($_POST['ship209'] >= 1) {
$missiontype = array(8 => $lang['type_mission'][8]);
} else {
$missiontype = array();
}
} elseif ($_POST['planettype'] == "1" || $_POST['planettype'] == "3") {
if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
$missiontype = array(7 => $lang['type_mission'][7]);
} elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
$missiontype = array(6 => $lang['type_mission'][6]);
}
if ($_POST['ship202'] >= 1 ||
$_POST['ship203'] >= 1 ||
$_POST['ship204'] >= 1 ||
$_POST['ship205'] >= 1 ||
$_POST['ship206'] >= 1 ||
$_POST['ship207'] >= 1 ||
$_POST['ship210'] >= 1 ||
$_POST['ship211'] >= 1 ||
$_POST['ship213'] >= 1 ||
$_POST['ship214'] >= 1 ||
$_POST['ship215'] >= 1 ||
$_POST['ship216'] >= 1) {
if (!$YourPlanet) {
$missiontype[1] = $lang['type_mission'][1];
$missiontype[5] = $lang['type_mission'][5];
}
$missiontype[3] = $lang['type_mission'][3];
}
} elseif ($_POST['ship209'] >= 1 || $_POST['ship208'] >= 1) {
$missiontype[3] = $lang['type_mission'][3];
}
if ($YourPlanet)
$missiontype[4] = $lang['type_mission'][4];
if ( $_POST['planettype'] == 3 &&
($_POST['ship214'] ||
$_POST['ship213']) &&
!$YourPlanet &&
$UsedPlanet) {
$missiontype[2] = $lang['type_mission'][2];
}
if ($_POST['planettype'] == 3 &&
($_POST['ship214'] >= 1 || $_POST['ship216'] >= 1) &&
!$YourPlanet && $UsedPlanet) {
$missiontype[9] = $lang['type_mission'][9];
}
}
if (empty($missiontype[$fleetmission])) {
message ("<font color=\"red\"><b>". $lang['fl_bad_mission'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
CheckPlanetUsedFields($CurrentPlanet);
if ($TargetPlanet['id_owner'] == '') {
$HeDBRec = $MyDBRec;
} elseif ($TargetPlanet['id_owner'] != '') {
$HeDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetPlanet['id_owner'] ."';", 'users', true);
}
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $MyDBRec['id'] ."';", 'statpoints', true);
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $HeDBRec['id'] ."';", 'statpoints', true);
$MyGameLevel = $UserPoints['total_points'];
$HeGameLevel = $User2Points['total_points'];
$VacationMode = $HeDBRec['urlaubs_modus'];
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 1 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 5 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 6 AND
$protection == 1 AND
$HeGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 1 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 5 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
$TargetPlanet['id_owner'] != '' AND
$_POST['mission'] == 6 AND
$protection == 1 AND
$MyGameLevel < ($protectiontime * 1000)) {
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
}
if ($VacationMode AND $_POST['mission'] != 8) {
message("<font color=\"lime\"><b>".$lang['fl_vacation_pla']."</b></font>", $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2);
}
$FlyingFleets = mysql_fetch_assoc(doquery("SELECT COUNT(fleet_id) as Number FROM {{table}} WHERE `fleet_owner`='{$user['id']}'", 'fleets'));
$ActualFleets = $FlyingFleets["Number"];
if (($user[$resource[108]] + 1) <= $ActualFleets) {
message("Pas de slot disponible", "Erreur", "fleet." . PHPEXT, 1);
}
if ($_POST['resource1'] + $_POST['resource2'] + $_POST['resource3'] < 1 AND $_POST['mission'] == 3) {
message("<font color=\"lime\"><b>".$lang['fl_noenoughtgoods']."</b></font>", $lang['type_mission'][3], "fleet." . PHPEXT, 1);
}
if ($_POST['mission'] != 15) {
if ($TargetPlanet['id_owner'] == '' AND $_POST['mission'] < 7) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet01'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($TargetPlanet['id_owner'] != '' AND $_POST['mission'] == 7) {
message ("<font color=\"red\"><b>". $lang['fl_bad_planet02'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($HeDBRec['ally_id'] != $MyDBRec['ally_id'] AND $_POST['mission'] == 4) {
message ("<font color=\"red\"><b>". $lang['fl_dont_stay_here'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($TargetPlanet['ally_deposit'] < 1 AND $HeDBRec != $MyDBRec AND $_POST['mission'] == 5) {
message ("<font color=\"red\"><b>". $lang['fl_no_allydeposit'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 1)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_attack'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 6)) {
message ("<font color=\"red\"><b>". $lang['fl_no_self_spy'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (($TargetPlanet["id_owner"] != $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 4)) {
message ("<font color=\"red\"><b>". $lang['fl_only_stay_at_home'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
}
$missiontype = array(
1 => $lang['type_mission'][1],
2 => $lang['type_mission'][2],
3 => $lang['type_mission'][3],
4 => $lang['type_mission'][4],
5 => $lang['type_mission'][5],
6 => $lang['type_mission'][6],
7 => $lang['type_mission'][7],
8 => $lang['type_mission'][8],
9 => $lang['type_mission'][9],
15 => $lang['type_mission'][15],
);
$speed_possible = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
$AllFleetSpeed = GetFleetMaxSpeed ($fleetarray, 0, $user);
$GenFleetSpeed = $_POST['speed'];
$SpeedFactor = $_POST['speedfactor'];
$MaxFleetSpeed = min($AllFleetSpeed);
if (!in_array($GenFleetSpeed, $speed_possible)) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '".$user['current_planet']."';", 'planets', true);
if ($MaxFleetSpeed != $_POST['speedallsmin']) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (!$_POST['planettype']) {
message ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
// Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu
$error = 0;
$errorlist = "";
if (!$_POST['galaxy'] || !is_numeric($_POST['galaxy']) || $_POST['galaxy'] > MAX_GALAXY_IN_WORLD || $_POST['galaxy'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_galaxy'];
}
if (!$_POST['system'] || !is_numeric($_POST['system']) || $_POST['system'] > MAX_SYSTEM_IN_GALAXY || $_POST['system'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_system'];
}
if (!$_POST['planet'] || !is_numeric($_POST['planet']) || $_POST['planet'] > MAX_PLANET_IN_SYSTEM+1 || $_POST['planet'] < 1) {
$error++;
$errorlist .= $lang['fl_limit_planet'];
}
if ($error > 0) {
message ("<font color=\"red\"><ul>" . $errorlist . "</ul></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
// La flotte part bien de la planete courrante ??
if ($_POST['thisgalaxy'] != $CurrentPlanet['galaxy'] |
$_POST['thissystem'] != $CurrentPlanet['system'] |
$_POST['thisplanet'] != $CurrentPlanet['planet'] |
$_POST['thisplanettype'] != $CurrentPlanet['planet_type']) {
message ("<font color=\"red\"><b>". $lang['fl_cheat_origine'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if (!isset($fleetarray)) {
message ("<font color=\"red\"><b>". $lang['fl_no_fleetarray'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
$distance = GetTargetDistance ( $_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet'] );
$duration = GetMissionDuration ( $GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor );
$consumption = GetFleetConsumption ( $fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
$fleet['start_time'] = $duration + time();
if ($_POST['mission'] == 15) {
$StayDuration = $_POST['expeditiontime'] * 3600;
$StayTime = $fleet['start_time'] + $_POST['expeditiontime'] * 3600;
} elseif ($_POST['mission'] == 5) {
$StayDuration = $_POST['holdingtime'] * 3600;
$StayTime = $fleet['start_time'] + $_POST['holdingtime'] * 3600;
} else {
$StayDuration = 0;
$StayTime = 0;
}
$fleet['end_time'] = $StayDuration + (2 * $duration) + time();
$FleetStorage = 0;
$FleetShipCount = 0;
$fleet_array = "";
$FleetSubQRY = "";
foreach ($fleetarray as $Ship => $Count) {
$FleetStorage += $pricelist[$Ship]["capacity"] * $Count;
$FleetShipCount += $Count;
$fleet_array .= $Ship .",". $Count .";";
$FleetSubQRY .= "`".$resource[$Ship] . "` = `" . $resource[$Ship] . "` - " . $Count . " , ";
}
$FleetStorage -= $consumption;
$StorageNeeded = 0;
if ($_POST['resource1'] < 1) {
$TransMetal = 0;
} else {
$TransMetal = $_POST['resource1'];
$StorageNeeded += $TransMetal;
}
if ($_POST['resource2'] < 1) {
$TransCrystal = 0;
} else {
$TransCrystal = $_POST['resource2'];
$StorageNeeded += $TransCrystal;
}
if ($_POST['resource3'] < 1) {
$TransDeuterium = 0;
} else {
$TransDeuterium = $_POST['resource3'];
$StorageNeeded += $TransDeuterium;
}
$StockMetal = $CurrentPlanet['metal'];
$StockCrystal = $CurrentPlanet['crystal'];
$StockDeuterium = $CurrentPlanet['deuterium'];
$StockDeuterium -= $consumption;
$StockOk = false;
if ($StockMetal >= $TransMetal) {
if ($StockCrystal >= $TransCrystal) {
if ($StockDeuterium >= $TransDeuterium) {
$StockOk = true;
}
}
}
if ( !$StockOk ) {
message ("<font color=\"red\"><b>". $lang['fl_noressources'] . pretty_number($consumption) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ( $StorageNeeded > $FleetStorage) {
message ("<font color=\"red\"><b>". $lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
}
if ($TargetPlanet['id_level'] > $user['authlevel']) {
$Allowed = true;
switch ($_POST['mission']){
case 1:
case 2:
case 6:
case 9:
$Allowed = false;
break;
case 3:
case 4:
case 5:
case 7:
case 8:
case 15:
break;
default:
}
if ($Allowed == false) {
message ("<font color=\"red\"><b>". $lang['fl_adm_attak'] ."</b></font>", $lang['fl_warning'], "fleet." . PHPEXT, 2);
}
}
// ecriture de l'enregistrement de flotte (a partir de l<>, y a quelque chose qui vole et c'est toujours sur la planete d'origine)
$QryInsertFleet = "INSERT INTO {{table}} SET ";
$QryInsertFleet .= "`fleet_owner` = '". $user['id'] ."', ";
$QryInsertFleet .= "`fleet_mission` = '". $_POST['mission'] ."', ";
$QryInsertFleet .= "`fleet_amount` = '". $FleetShipCount ."', ";
$QryInsertFleet .= "`fleet_array` = '". $fleet_array ."', ";
$QryInsertFleet .= "`fleet_start_time` = '". $fleet['start_time'] ."', ";
$QryInsertFleet .= "`fleet_start_galaxy` = '". intval($_POST['thisgalaxy']) ."', ";
$QryInsertFleet .= "`fleet_start_system` = '". intval($_POST['thissystem']) ."', ";
$QryInsertFleet .= "`fleet_start_planet` = '". intval($_POST['thisplanet']) ."', ";
$QryInsertFleet .= "`fleet_start_type` = '". intval($_POST['thisplanettype']) ."', ";
$QryInsertFleet .= "`fleet_end_time` = '". $fleet['end_time'] ."', ";
$QryInsertFleet .= "`fleet_end_stay` = '". $StayTime ."', ";
$QryInsertFleet .= "`fleet_end_galaxy` = '". intval($_POST['galaxy']) ."', ";
$QryInsertFleet .= "`fleet_end_system` = '". intval($_POST['system']) ."', ";
$QryInsertFleet .= "`fleet_end_planet` = '". intval($_POST['planet']) ."', ";
$QryInsertFleet .= "`fleet_end_type` = '". intval($_POST['planettype']) ."', ";
$QryInsertFleet .= "`fleet_resource_metal` = '". intval($TransMetal) ."', ";
$QryInsertFleet .= "`fleet_resource_crystal` = '". intval($TransCrystal) ."', ";
$QryInsertFleet .= "`fleet_resource_deuterium` = '". intval($TransDeuterium) ."', ";
$QryInsertFleet .= "`fleet_target_owner` = '". $TargetPlanet['id_owner'] ."', ";
$QryInsertFleet .= "`start_time` = '". time() ."';";
doquery( $QryInsertFleet, 'fleets');
$CurrentPlanet["metal"] = $CurrentPlanet["metal"] - $TransMetal;
$CurrentPlanet["crystal"] = $CurrentPlanet["crystal"] - $TransCrystal;
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $TransDeuterium;
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $consumption;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= $FleetSubQRY;
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet["metal"] ."', ";
$QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet["crystal"] ."', ";
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet["deuterium"] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."'";
// Mise a jours de l'enregistrement de la planete de depart (a partir de là, y a quelque chose qui vole et ce n'est plus sur la planete de depart)
doquery("LOCK TABLE {{table}} WRITE", 'planets');
doquery ($QryUpdatePlanet, "planets");
doquery("UNLOCK TABLES", '');
// doquery("FLUSH TABLES", '');
// Un peu de blabla pour l'utilisateur, affichage d'un joli tableau de la flotte expedi<64>e
$page = "<br><div><center>";
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">";
$page .= "<tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"2\"><span class=\"success\">". $lang['fl_fleet_send'] ."</span></td>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_mission'] ."</th>";
$page .= "<th>". $missiontype[$_POST['mission']] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_dist'] ."</th>";
$page .= "<th>". pretty_number($distance) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_speed'] ."</th>";
$page .= "<th>". pretty_number($_POST['speedallsmin']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
$page .= "<th>". pretty_number($consumption) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_from'] ."</th>";
$page .= "<th>". $_POST['thisgalaxy'] .":". $_POST['thissystem']. ":". $_POST['thisplanet'] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_dest'] ."</th>";
$page .= "<th>". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_go'] ."</th>";
$page .= "<th>". date("M D d H:i:s", $fleet['start_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['fl_time_back'] ."</th>";
$page .= "<th>". date("M D d H:i:s", $fleet['end_time']) ."</th>";
$page .= "</tr><tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
foreach ($fleetarray as $Ship => $Count) {
$page .= "</tr><tr height=\"20\">";
$page .= "<th>". $lang['tech'][$Ship] ."</th>";
$page .= "<th>". pretty_number($Count) ."</th>";
}
$page .= "</tr></table></div></center>";
// Provisoire
sleep (1);
$planetrow = doquery ("SELECT * FROM {{table}} WHERE `id` = '". $CurrentPlanet['id'] ."';", 'planets', true);
display($page, $lang['fl_title']);
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
// Updated by -= MoF =- for Deutsches Ugamela Forum
// 06.12.2007 - 08:39
// Open Source
// (c) by MoF
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* This file is part of Wootook
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.org>
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
@ -24,13 +24,13 @@
* --> 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 Wootook.
* documentation for further information about customizing XNova.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
require_once dirname(__FILE__) .'/common.php';
includeLang('galaxy');
includeLang('fleet');
@ -70,9 +70,9 @@ require_once dirname(__FILE__) .'/application/bootstrap.php';
}
}
$PrNoob = Wootook::getGameConfig('game/noob-protection/active');
$PrNoobTime = Wootook::getGameConfig('game/noob-protection/points-cap');
$PrNoobMulti = Wootook::getGameConfig('game/noob-protection/multiplier');
$PrNoob = $gameConfig['noobprotection'];
$PrNoobTime = $gameConfig['noobprotectiontime'];
$PrNoobMulti = $gameConfig['noobprotectionmulti'];
// Petit Test de coherance
$galaxy = intval($_POST['galaxy']);

16
frames.php Normal file
View file

@ -0,0 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico">
<title>XNova:Legacies</title>
</head>
<frameset framespacing="0" border="0" cols="190,*" frameborder="0">
<frame name="LeftMenu" target="Mainframe" src="leftmenu.php" noresize scrolling="no" marginwidth="0" marginheight="0">
<frame name="Hauptframe" src="overview.php">
<noframes>
<body>
<p>Votre navigateur ne gère pas les frames.</p>
</body>
</noframes>
</frameset>
</html>

163
galaxy.php Normal file
View file

@ -0,0 +1,163 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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('galaxy');
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', true);
$lunarow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_luna'] ."';", 'lunas', true);
$galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '". $CurrentPlanet['id'] ."';", 'galaxy', true);
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
$fleetmax = $user['computer_tech'] + 1;
$CurrentPlID = $CurrentPlanet['id'];
$CurrentMIP = $CurrentPlanet['interplanetary_misil'];
$CurrentRC = $CurrentPlanet['recycler'];
$CurrentSP = $CurrentPlanet['spy_sonde'];
$HavePhalanx = $CurrentPlanet['phalanx'];
$CurrentSystem = $CurrentPlanet['system'];
$CurrentGalaxy = $CurrentPlanet['galaxy'];
$CanDestroy = $CurrentPlanet[$resource[213]] + $CurrentPlanet[$resource[214]];
$maxfleet = doquery("SELECT * FROM {{table}} WHERE `fleet_owner` = '". $user['id'] ."';", 'fleets');
$maxfleet_count = mysql_num_rows($maxfleet);
CheckPlanetUsedFields($CurrentPlanet);
CheckPlanetUsedFields($lunarow);
if (!isset($mode)) {
if (isset($_GET['mode'])) {
$mode = intval($_GET['mode']);
} else {
$mode = 0;
}
}
$galaxy = 1;
$system = 1;
$planet = null;
if ($mode == 0) {
$galaxy = $CurrentGalaxy;
$system = $CurrentSystem;
} elseif ($mode == 1 || $mode == 3) {
if (isset($_POST["galaxyLeft"])) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
$galaxy = 1;
} else {
$galaxy = intval($_POST["galaxy"]) - 1;
}
} elseif (isset($_POST["galaxyRight"])) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
$galaxy = MAX_GALAXY_IN_WORLD;
} else {
$galaxy = intval($_POST["galaxy"]) + 1;
}
} else if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
$galaxy = 1;
} else {
$galaxy = intval($_POST["galaxy"]);
}
if (isset($_POST["systemLeft"])) {
if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
$system = 1;
} else {
$system = intval($_POST["system"]) - 1;
}
} elseif (isset($_POST["systemRight"])) {
if (!isset($_POST["system"]) || $_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
} else {
$system = intval($_POST["system"]) + 1;
}
} else if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
$system = 1;
} else {
$system = intval($_POST["system"]);
}
} elseif ($mode == 2) {
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 0) {
$galaxy = 1;
} else if ($_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
$galaxy = MAX_GALAXY_IN_WORLD;
} else {
$galaxy = intval($_POST["galaxy"]) + 1;
}
if (!isset($_POST["system"]) || $_POST["system"] <= 0) {
$system = 1;
} else if ($_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
} else {
$system = intval($_POST["system"]) + 1;
}
if (!isset($_POST["planet"]) || $_POST["planet"] <= 0) {
$planet = 1;
} else if ($_POST["planet"] >= MAX_PLANET_IN_SYSTEM) {
$planet = MAX_PLANET_IN_SYSTEM;
} else {
$planet = intval($_POST["planet"]) + 1;
}
}
$planetcount = 0;
$lunacount = 0;
$page = InsertGalaxyScripts($CurrentPlanet);
$page .= "<body style=\"overflow: hidden;\" onUnload=\"\"><br><br>";
$page .= ShowGalaxySelector ( $galaxy, $system );
if ($mode == 2) {
$page .= ShowGalaxyMISelector($galaxy, $system, $planet, $CurrentPlanet['id'], $CurrentMIP);
}
$page .= "<table width=569><tbody>";
$page .= ShowGalaxyTitles($galaxy, $system);
$page .= ShowGalaxyRows($galaxy, $system);
$page .= ShowGalaxyFooter($galaxy, $system, $CurrentMIP, $CurrentRC, $CurrentSP);
$page .= "</tbody></table></div>";
display ($page, $lang[''], false, '', false);
// -----------------------------------------------------------------------------------------------------------
// History version
// 1.0 - Created by Perberos
// 1.1 - Modified by -MoF- (UGamela germany)
// 1.2 - 1er Nettoyage Chlorel ...
// 1.3 - 2eme Nettoyage Chlorel ... Mise en fonction et debuging complet
?>

View file

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 842 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 769 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 139 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more