Compare commits

..
Author SHA1 Message Date
Grégory PLANCHAT
2fde7653cf Merge pull request #6 from Noxgame/patch-1
Update src/application/code/core/Legacies/Empire/install/mysql5/install-...
2013-02-26 00:40:39 -08:00
Grégory PLANCHAT
7dcc790e65 Merge pull request #7 from loic-talon/master
Fix different error
2013-02-26 00:39:42 -08:00
Loïc TALON
5797328adc Fix date of messages and undefined var 2013-02-24 20:45:07 +01:00
Loïc TALON
6f1e5e4467 Fix Marchand
Fix undefined value in options.php
2013-02-24 19:01:04 +01:00
Loïc TALON
8ebc4cd91f Fix undefined dpath (options.php) 2013-02-24 18:11:09 +01:00
Loïc TALON
4b92511bae Fix second parameter of function date (options.php) 2013-02-24 17:58:42 +01:00
Mandalorien
74c4f31f7f Update src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php
correction
2013-01-22 17:21:24 +01:00
Gregory PLANCHAT
50538bd332 Updated profiler default visibility
Updated comments blocks

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-06-03 22:25:54 +02:00
Gregory PLANCHAT
9e3c1e68bf Added application handler
Fixed fleet bugs
Fixed colonization bug
Updated mail handler support
Fixed galaxy bugs
Updated license block

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-05-28 23:18:54 +02:00
Gregory PLANCHAT
4b2167c133 Fixed minor bugs
Updated redesign

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-05-02 23:06:18 +02:00
Gregory PLANCHAT
fa9fa5d3a5 Started interface redesign
Minor bug fixes

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-04-29 22:36:00 +02:00
Gregory PLANCHAT
b09c4e6c62 Bug fixes
Removed some dowuery calls in deprecated code.
Updated labels
Updated requirements & types for ore miner

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-04-09 20:01:45 +02:00
Gregory PLANCHAT
422f2c1295 Fixed minor bugs
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-25 18:35:28 +02:00
Gregory PLANCHAT
a531d61639 Updated home page
Fixed buildings consruction time

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-24 15:51:26 +01:00
Gregory PLANCHAT
347952319a Fixed DML queries errors
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-23 21:50:44 +01:00
Gregory PLANCHAT
70145967d0 Updated front controller
Fixed DML queries errors (partly implemented)
Fixed minor bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-21 01:41:56 +01:00
Gregory PLANCHAT
3dde300c80 Added building/research-lab/shipyard/defenses MVC controllers
Refactored View & Model base classes
Added database adapter error messages and status utility methods
Fixed login error
Fixed HTTP 404 error on home page
Fixed minor bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-20 21:31:33 +01:00
Gregory PLANCHAT
802be5f8c3 Updated Database component
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-10 08:17:38 +01:00
Gregory PLANCHAT
7e7924e97e Updated Database component
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-08 19:11:30 +01:00
Gregory PLANCHAT
03efb85c0b Refactored Controller
Refactored Database adapters

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-03-01 18:20:05 +01:00
Gregory PLANCHAT
690a7f60f3 Updated data access layer
Renamed classes, methods & variables from "User" to "Player"
Fixed dependencies requirements in the research lab queue
Updated overview
Added MVC's controller
Added build files
Updated directory structure

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-02-28 22:43:37 +01:00
Gregory PLANCHAT
d40313279a Updated layout file format to XML
Fixed config & install inconstinstencies
Fixed form management updates

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-01-24 22:27:32 +01:00
Gregory PLANCHAT
66805034a6 Configuration & Layout architecture updates
Fixed production bug
Fixed styles
Updated Action Controller

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2012-01-13 23:36:03 +01:00
Gregory PLANCHAT
dfa3dfb086 Finished install script
Updated configuration data loading
Added Website and Game models

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-27 19:37:28 +01:00
Gregory PLANCHAT
5393be4daf Updated installer
Added Website and Game models
Updted config loading

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-15 22:10:35 +01:00
Gregory PLANCHAT
fcd1f5b740 Updated config management
Updated install

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-14 23:45:09 +01:00
Gregory PLANCHAT
4bb4693d2e Updated install script
Fixed CSS issues

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-12-05 18:52:05 +01:00
Gregory PLANCHAT
5acde87794 Updated install
Added Form manager
Added session messages display

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-11-18 08:05:42 +01:00
Gregory PLANCHAT
9636b4bb00 Updated install and fixed bugs
Added session messages display
Fixed field and validator loading.
Updated form validation
Updated root config management
Muted error reporting in file evaluation
Added menu updates
Fixed galaxy data access error
Fixed config bug
Added HTTP request method checks
Added Form manager
Fixed core bugs

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-11-08 08:56:53 +01:00
Grégory PLANCHAT
c38e53706e Merge pull request #2 from warlof/patch-1
correction des caractères spéciaux et fermeture des chaîne de caractè
2011-10-26 01:10:05 -07:00
Gregory PLANCHAT
6d61e93c47 Updated page display
Updated signature image generator
Navigation menu has been finalized
Some deprectaed templates has been removed
Fixed registration
Fixed galaxy notices messages

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
2011-10-24 19:19:04 +02:00
warlof
fc311855b4 correction des caractères spéciaux et fermeture des chaîne de caractère 60 et 65 2011-10-23 17:51:27 +03:00
1594 changed files with 35275 additions and 16541 deletions

3
.gitignore vendored
View file

@ -2,4 +2,7 @@ config.php
.buildpath .buildpath
.project .project
.settings/ .settings/
.idea/
coverage/ coverage/
src/application/cache/*
src/application/configs/local.php

View file

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

View file

@ -1,68 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.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,66 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.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'] );
}
?>

View file

@ -1,101 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.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'] );
}
?>

View file

@ -1,66 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
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,75 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.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,116 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.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 = $Last15Mins->fetch(PDO::FETCH_ASSOC) ) {
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,310 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('IN_ADMIN', true);
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.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,70 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook 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 Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.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);
?>

View file

@ -1,252 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero 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 Wootook.
*
*/
/**
*
* Enter description here ...
* @author Greg
*
*/
class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
extends Wootook_Empire_Model_BuilderAbstract
{
/**
* @var int
*/
protected $_maxLength = 0;
public function init()
{
$this->_unserializeQueue($this->_currentUser->getData('b_laboratory_id'));
}
/**
* @param int $buildingId
* @param int $level
* @param int $time
*/
protected function _initItem(Array $params)
{
if (!isset($params['technology_id']) || !isset($params['level'])) {
return null;
}
$technologyId = $params['technology_id'];
$level = $params['level'];
if (!isset($params['created_at'])) {
$createdAt = time();
} else {
$createdAt = $params['created_at'];
}
if (!isset($params['updated_at'])) {
$updatedAt = $createdAt;
} else {
$updatedAt = $params['updated_at'];
}
return new Legacies_Empire_Model_Planet_Building_ResearchLab_Item(array(
'technology_id' => $technologyId,
'level' => $level,
'created_at' => $createdAt,
'updated_at' => $updatedAt
));
}
/**
* Check if a technology type is actually buildable on the current
* planet, depending on the technology and buildings requirements.
*
* @param int $technologyId
* @return bool
*/
public function checkAvailability($technologyId)
{
$types = Wootook_Empire_Model_Game_Types::getSingleton();
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
return false;
}
parent::checkAvailability($technologyId);
return true;
}
/**
* Returns the time needed to build $level of $technologyId
*
* @param int $technologyId
* @param int $level
*/
public function getBuildingTime($technologyId, $level)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$gameConfig = Wootook_Core_Model_Config::getSingleton();
Math::setPrecision(50);
// FIXME: Resource dependency
$totalCost = Math::mul(Math::add($prices[$technologyId][Legacies_Empire::RESOURCE_METAL], $prices[$technologyId][Legacies_Empire::RESOURCE_CRISTAL]), $level);
$speedFactor = $gameConfig->getData('game_speed');
// FIXME: Building & Technology dependency
$extraLaboratoriesLevels = 0;
$researchNetworkLevel = $this->_currentUser->getElement(Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK);
if ($researchNetworkLevel > 0) {
$laboratoriesLevels = array();
foreach ($this->_currentUser->getPlanetCollection() as $planet) {
if ($this->_currentPlanet->getId() == $planet->getId()) {
continue;
}
$level = $planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB);
if ($level > 0) {
$laboratoriesLevels[] = (int) $level;
}
}
sort($laboratoriesLevels, SORT_NUMERIC);
$extraLaboratoriesLevels = array_sum(array_slice(array_reverse($laboratoriesLevels), 0, $researchNetworkLevel));
}
$laboratorySpeedup = Math::div($totalCost, ($this->_currentPlanet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB) + 1 + $extraLaboratoriesLevels));
Math::setPrecision();
$baseTime = ($totalCost / $speedFactor) * $laboratorySpeedup;
return (int) Math::floor($baseTime * 3600);
}
/**
* (non-PHPdoc)
* @see Legacies_Empire_Model_BuilderAbstract::getResourcesNeeded()
*/
public function getResourcesNeeded($technologyId, $level)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
$resources = Wootook_Empire_Model_Game_Resources::getSingleton();
if (!isset($prices[$technologyId])) {
return array();
}
$resourcesNeeded = array();
foreach ($resources as $resourceId => $resourceConfig) {
if (!isset($prices[$technologyId][$resourceId])) {
continue;
}
if (Math::isPositive($prices[$technologyId][$resourceId])) {
$firstLevelCost = $prices[$technologyId][$resourceId];
$partialLevelCost = Math::mul($firstLevelCost, Math::pow($prices[$technologyId][Legacies_Empire::RESOURCE_MULTIPLIER], $level));
$resourcesNeeded[$resourceId] = Math::sub($partialLevelCost, $firstLevelCost);
}
}
return $resourcesNeeded;
}
/**
* Update the contruction queue.
*
* @return Legacies_Empire_Model_Planet_Building_ResearchLab
*/
public function updateQueue($time)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
$elapsedTime = $time - $this->_currentUser->getData('b_laboratory');
foreach ($this->getQueue() as $element) {
$technologyId = $element->getData('research_id');
$level = $element->getData('level');
$buildTime = $this->getBuildingTime($technologyId, $level);
if ($elapsedTime >= $buildTime) {
$this->_currentUser[$fields[$technologyId]] = Math::add($this->_currentUser[$fields[$technologyId]], $level);
$elapsedTime -= $buildTime;
$this->dequeue($element);
continue;
}
$timeRatio = $elapsedTime / $buildTime;
$itemsBuilt = Math::mul($timeRatio, $level);
$element->setData('updated_at', $time);
$element->setData('level', Math::sub($level, $itemsBuilt));
$this->_currentUser->setData($fields[$technologyId], Math::add($this->_currentUser->getData($fields[$technologyId]), $itemsBuilt));
break;
}
$this->_currentUser->setData('b_laboratory_id', $this->serialize());
$this->_currentUser->setData('b_laboratory', $time);
return $this;
}
/**
* Append items to build to the construction list
*
* @param int $technologyId
* @param int|string $level
* @return Legacies_Empire_Model_Planet_Building_ResearchLab
*/
public function appendQueue($technologyId, $level, $time)
{
if ($this->_maxLength > 0 && $this->count() >= $this->_maxLength) {
return $this;
}
if (!Math::isPositive($level)) {
return $this;
}
$types = Wootook_Empire_Model_Game_Types::getSingleton();
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
return $this;
}
if (!$this->checkAvailability($technologyId)) {
return $this;
}
$resourcesNeeded = $this->getResourcesNeeded($technologyId, $level);
$remainingAmounts = $this->_calculateResourceRemainingAmounts($resourcesNeeded);
if ($remainingAmounts === false) {
return $this;
}
$this->enqueue($technologyId, $level, $time);
$this->_currentUser->setData('b_laboratory_id', $this->serialize());
foreach ($remainingAmounts as $resourceId => $resourceAmount) {
$this->_currentPlanet[$resourceId] = $resourceAmount;
}
return $this;
}
};

View file

@ -1,70 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero 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 Wootook.
*
*/
/**
*
* Enter description here ...
* @author Greg
*
*/
class Legacies_Officers_Model_Observer
{
public static function planetUpdateListener($eventData)
{
if (isset($eventData['planet'])) {
$planet = $eventData['planet'];
$user = $planet->getUser();
$level = floor(sqrt($user->getData('xpminier') / 500));
if ($user->getData('lvl_minier') < $level) {
$difference = $level - $user->getData('lvl_minier');
if ($difference == 1) {
Wootook::getSession(Legacies_Empire_Model_User::SESSION_KEY)
->addInfo('You gained 1 miner level.');
} else {
Wootook::getSession(Legacies_Empire_Model_User::SESSION_KEY)
->addInfo('You gained %1$d miner level.', (int) $difference);
}
}
$level = floor(sqrt($user->getData('xpraid')));
if ($user->getData('lvl_raid') < $level) {
$difference = $level - $user->getData('lvl_raid');
if ($difference == 1) {
Wootook::getSession(Legacies_Empire_Model_User::SESSION_KEY)
->addInfo('You gained 1 raider level.');
} else {
Wootook::getSession(Legacies_Empire_Model_User::SESSION_KEY)
->addInfo('You gained %1$d raider level.', (int) $difference);
}
}
}
}
}

View file

@ -1,285 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/agpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero 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 Wootook.
*
*/
/**
* Bootstrap class, used to access main and global functionalities
*
* @package Wootook
* @category core
*/
class Wootook
{
/**
* Static list of application event listeners
*
* @var array
*/
private static $_listeners = array();
/**
* Static list of all locale translators
*
* @var array
*/
private static $_translators = array();
/**
* HTTP request management object
*
* @var Legacies_Core_Controller_Request_Http
*/
protected static $_request = null;
/**
* HTTP response management object
*
* @var Legacies_Core_Controller_Response
*/
protected static $_response = null;
/**
* The current timestamp
*
* @var int
*/
protected static $_now = null;
/**
* Default locale identifier
*
* @var string
*/
protected static $_defaultLocale = 'fr_FR';
/**
*
* Enter description here ...
* @var array
*/
protected static $_config = null;
/**
* Registers an event listener to be called later in the application.
*
* @param string $event The event identifier
* @param callback $listener The event callback to be called
*/
public static function registerListener($event, $listener)
{
if (!isset(self::$_listeners[$event])) {
self::$_listeners[$event] = array();
}
self::$_listeners[$event][] = $listener;
}
/**
* Clear all event listeners
*/
public static function clearAllListeners()
{
self::$_listeners = array();
}
/**
* Clear a specific event's listeners
*
* @param unknown_type $event
*/
public static function clearEventListeners($event)
{
if (isset(self::$_listeners[$event])) {
self::$_listeners[$event] = array();
}
}
/**
* Dispatches an event, calls all callbacks that were previously registered
*
* @param string $event The event identifier
* @param array $params The event params
*/
public static function dispatchEvent($event, $params)
{
$eventObject = new Wootook_Core_Event($params);
if (!isset(self::$_listeners[$event])) {
return $eventObject;
}
foreach (self::$_listeners[$event] as $listener) {
call_user_func($listener, $eventObject);
}
return $eventObject;
}
/**
*
* Enter description here ...
* @param unknown_type $namespace
* @return Legacies_Core_Model_Session
*/
public static function getSession($namespace)
{
return Wootook_Core_Model_Session::factory($namespace);
}
public static function getTranslator($locale = null)
{
if ($locale === null) {
$locale = self::getDefaultLocale();
}
if (!isset($translator[$locale])) {
$path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'locale';
$translator[$locale] = new Wootook_Core_Model_Translator($path, $locale);
}
return $translator[$locale];
}
public static function translate($locale, $message, Array $args)
{
return self::getTranslator($locale)->translateArgs($message, $args);
}
public static function __($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return self::getTranslator(self::getDefaultLocale())->translateArgs($message, $args);
}
public static function setDefaultLocale($locale)
{
$oldLocale = self::$_defaultLocale;
self::$_defaultLocale = $locale;
return $oldLocale;
}
public static function getDefaultLocale()
{
return self::$_defaultLocale;
}
public static function now()
{
if (self::$_now === null) {
self::$_now = time();
}
return self::$_now;
}
public static function getRequest()
{
if (self::$_request === null) {
self::$_request = new Wootook_Core_Controller_Request_Http();
}
return self::$_request;
}
public static function setRequest($request)
{
self::$_request = $request;
}
public static function getResponse()
{
if (self::$_response === null) {
self::$_response = new Wootook_Core_Controller_Response_Http();
}
return self::$_response;
}
public static function setResponse($response)
{
self::$_response = $response;
}
public static function getConfig($path = null)
{
if (self::$_config === null) {
self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
}
if ($path === null || !is_string($path)) {
return self::$_config;
}
$config = self::$_config;
foreach (explode('/', $path) as $chunk) {
if (!isset($config[$chunk])) {
return null;
}
$config = $config[$chunk];
}
return $config;
}
public static function getBaseUrl()
{
return self::getConfig('global/web/base_url');
}
public static function getSkinUrl($package, $theme, $uri, Array $params = array())
{
return self::getUrl("skin/{$package}/{$theme}/{$uri}", $params);
}
public static function getUrl($uri, Array $params = array())
{
$baseUrl = self::getBaseUrl();
$serializedParams = array();
foreach ($params as $paramKey => $paramValue) {
if ($paramValue) {
$serializedParams[] = "{$paramKey}={$paramValue}";
}
}
if (count($serializedParams) > 0) {
return $baseUrl . $uri . '?' . implode('&', $serializedParams);
}
return $baseUrl . $uri;
}
public static function fileExists($path)
{
if ($path === null || empty($path)) {
return false;
}
if (($fp = @fopen($path, 'r', true)) === false) {
return false;
}
fclose($fp);
return true;
}
}

View file

@ -1,145 +0,0 @@
<?php
class Wootook_Core_Block_Html_Head
extends Wootook_Core_Block_Template
{
const TYPE_GLOBAL_JS = 'global_js';
const TYPE_SKIN_CSS = 'skin_css';
const TYPE_SKIN_JS = 'skin_js';
const TYPE_INLINE_CSS = 'inline_css';
const TYPE_INLINE_JS = 'inline_js';
protected $_items = array();
public function addItem($type, Array $options = array())
{
if (!isset($this->_items[$type])) {
$this->_items[$type] = array();
}
$this->_items[$type][] = $options;
return $this;
}
public function addJs($script, $type = 'text/javascript', Array $options = array())
{
$options['type'] = $type;
$options['path'] = $script;
$this->addItem(self::TYPE_GLOBAL_JS, $options);
return $this;
}
public function addCss($stylesheet, $type = 'text/css', $condition = null, Array $options = array())
{
$options['type'] = $type;
$options['path'] = $stylesheet;
$options['condition'] = $condition;
$this->addItem(self::TYPE_SKIN_CSS, $options);
return $this;
}
public function addSkinJs($script, $type = 'text/javascript', Array $options = array())
{
$options['type'] = $type;
$options['path'] = $script;
$this->addItem(self::TYPE_SKIN_JS, $options);
return $this;
}
public function addInlineJs($content, $type = 'text/javascript', Array $options = array())
{
$options['type'] = $type;
$options['content'] = $content;
$this->addItem(self::TYPE_INLINE_JS, $options);
return $this;
}
public function addInlineCss($content, $type = 'text/css', Array $options = array())
{
$options['type'] = $type;
$options['path'] = $path;
$options['content'] = $content;
$this->addItem(self::TYPE_INLINE_CSS, $options);
return $this;
}
public function getCss()
{
if (isset($this->_items[self::TYPE_SKIN_CSS])) {
return $this->_items[self::TYPE_SKIN_CSS];
}
return array();
}
public function getInlineCss()
{
if (isset($this->_items[self::TYPE_INLINE_CSS])) {
return $this->_items[self::TYPE_INLINE_CSS];
}
return array();
}
public function getJs()
{
if (isset($this->_items[self::TYPE_GLOBAL_JS])) {
return $this->_items[self::TYPE_GLOBAL_JS];
}
return array();
}
public function getSkinJs()
{
if (isset($this->_items[self::TYPE_SKIN_JS])) {
return $this->_items[self::TYPE_SKIN_JS];
}
return array();
}
public function getInlineJs()
{
if (isset($this->_items[self::TYPE_INLINE_JS])) {
return $this->_items[self::TYPE_INLINE_JS];
}
return array();
}
public function renderCss()
{
$render = '';
foreach ($this->getCss() as $css) {
if (!isset($css['media'])) {
$css['media'] = 'all';
}
$render .=<<<HTML_EOF
<link rel="stylesheet" type="{$css['type']}" src="{$css['path']}" media="{$css['media']}" />
HTML_EOF;
}
return $render;
}
public function renderJs()
{
$render = '';
foreach ($this->getJs() as $js) {
if (!isset($js['type'])) {
$js['type'] = 'text/javascript';
}
$render .=<<<HTML_EOF
<script type="{$js['type']}" src="{$js['path']}"></script>
HTML_EOF;
}
return $render;
}
}

View file

@ -1,66 +0,0 @@
<?php
class Wootook_Core_Block_Html_Navigation
extends Wootook_Core_Block_Template
{
public function addLink($name, $label, $title, $uri, Array $params = array(), Array $classes = array(), $template = null)
{
$explodedPath = explode('/', $name);
$baseName = array_pop($explodedPath);
$parent = $this->_getNode($explodedPath);
$child = $this->getLayout()
->createBlock('core/html.navigation.link', $this->getNameInLayout() . '.' . $baseName, array(
'url' => array(
'uri' => $uri,
'params' => $params
),
'label' => $label,
'title' => $title,
'classes' => $classes
));
$parent->setPartial($baseName, $child);
if ($template !== null) {
$child->setTemplate($template);
}
return $this;
}
public function setNodeTitle($path, $title)
{
return $this->getNode($path)->setTitle($title);
}
public function setNodeTemplate($path, $template)
{
return $this->getNode($path)->setTemplate($template);
}
public function getNode($path)
{
return $this->_getNode(explode('/', $path));
}
protected function _getNode($explodedPath)
{
$name = array_shift($explodedPath);
if ($this->hasPartial($name)) {
$child = $this->getPartial($name)->_getNode($explodedPath);
} else {
$child = $this->getLayout()
->createBlock('core/html.navigation.node', $this->getNameInLayout() . '.' . $name);
}
if ($child instanceof Wootook_Core_Block_Html_Navigation_Link) {
throw new Wootook_Core_Exception_RuntimeException('Node is a link. Could not append a child node to a link node.');
}
if (count($explodedPath) == 0) {
return $child;
}
return $child->_getNode($explodedPath);
}
}

View file

@ -1,116 +0,0 @@
<?php
class Wootook_Core_Block_Html_Navigation_Link
extends Wootook_Core_Block_Template
{
protected $_label = '';
protected $_title = '';
protected $_uri = '';
protected $_params = array();
protected $_classes = array('link');
public function getTemplate()
{
if ($this->_template !== null) {
return $this->_template;
}
return 'page/html/navigation/link.phtml';
}
public function setLabel($label)
{
$this->_label = $label;
return $this;
}
public function getLabel()
{
return $this->_label;
}
public function setTitle($title)
{
$this->_title = $title;
return $this;
}
public function getTitle()
{
return $this->_title;
}
public function setUrl($uri, $params = array())
{
$this->_uri = $uri;
$this->_params = $params;
return $this;
}
public function getLinkUrl($moreParams = array())
{
$params = array_merge($this->_params, $moreParams);
return $this->getUrl($this->_uri, $params);
}
public function addClass($class)
{
$this->_classes[] = $class;
return $this;
}
public function clearClasses()
{
$this->_classes = array();
return $this;
}
public function renderClasses($moreClasses)
{
$classes = array_merge($this->_classes, $moreClasses);
return implode(' ', $classes);
}
public function __construct(Array $data = array())
{
if (isset($data['label'])) {
$this->setLabel($data['label']);
unset($data['label']);
}
if (isset($data['title'])) {
$this->setTitle($data['title']);
unset($data['title']);
}
if (isset($data['url'])) {
if (is_array($data['url']) && isset($data['url']['uri'])) {
if (isset($data['url']['params'])) {
$this->setUrl($data['url']['uri'], $data['url']['params']);
} else {
$this->setUrl($data['url']['uri']);
}
} else {
$this->setUrl($data['url']);
}
unset($data['url']);
}
if (isset($data['classes'])) {
$classes = (array) $data['classes'];
unset($data['classes']);
foreach ($classes as $class) {
$this->set($class);
}
}
parent::__construct($data);
return $this;
}
}

View file

@ -1,36 +0,0 @@
<?php
class Wootook_Core_Block_Template
extends Wootook_Core_View
{
protected function _getTemplatePath($file)
{
$pattern = "{$this->getScriptPath()}/%s/%s/scripts/{$file}";
if (($layout = $this->getLayout()) !== null) {
$package = $this->getLayout()->getPackage();
$theme = $this->getLayout()->getTheme();
if ($package !== Wootook_Core_Layout::DEFAULT_PACKAGE) {
if ($theme !== Wootook_Core_Layout::DEFAULT_THEME) {
$path = sprintf($pattern, $package, $theme);
if (Wootook::fileExists($path)) {
return $path;
}
}
$path = sprintf($pattern, $package, Wootook_Core_Layout::DEFAULT_THEME);
if (Wootook::fileExists($path)) {
return $path;
}
}
}
$path = sprintf($pattern, Wootook_Core_Layout::DEFAULT_PACKAGE, Wootook_Core_Layout::DEFAULT_THEME);
if (Wootook::fileExists($path)) {
return $path;
}
trigger_error("Template '{$file}' could not be found.", E_USER_ERROR);
return null;
}
}

View file

@ -1,366 +0,0 @@
<?php
class Wootook_Core_Collection
extends Wootook_Core_Model
implements Iterator, Countable
{
protected $_tableName = null;
protected $_tableAlias = null;
protected $_entityClassName = 'Wootook_Object';
protected $_columns = array();
protected $_where = array();
protected $_join = array();
protected $_order = array();
protected $_union = array();
protected $_limit = null;
protected $_offset = null;
protected $_group = array();
protected $_items = array();
public function __construct($tableName = null, $entityClassName = null)
{
if ($tableName !== null) {
$this->setTableName($tableName);
}
if ($entityClassName != null) {
$this->setEntityClassName($entityClassName);
}
}
protected function _init()
{
return $this;
}
public function setTableName($tableName)
{
if (!is_array($tableName)) {
$this->_tableName = $tableName;
} else {
$this->_tableName = current($tableName);
$this->_tableAlias = key($tableName);
}
return $this;
}
public function getTableName()
{
return $this->_tableName;
}
public function setEntityClassName($entityClassName)
{
$this->_entityClassName = $entityClassName;
return $this;
}
public function getEntityClassName()
{
return $this->_entityClassName;
}
public function quote($data)
{
static $database = null;
if ($database === null) {
$database = Wootook_Database::getSingleton();
}
return $database->quote($data);
}
public function column($column = '*', $alias = null)
{
if (is_array($column)) {
foreach ($column as $alias => $field) {
if (is_int($alias)) {
$this->_columns[] = array($field);
} else {
$this->_columns[] = array($alias => $field);
}
}
} else if ($alias === null || is_int($alias)) {
$this->_columns[] = array($column);
} else {
$this->_columns[] = array($alias => $column);
}
return $this;
}
public function where($condition)
{
$this->_where[] = $condition;
return $this;
}
public function join($table, $condition, $fields = array('*'), $mode = 'INNER')
{
static $database = null;
if ($database === null) {
$database = Wootook_Database::getSingleton();
}
if (is_array($table)) {
$alias = key($table);
$table = current($table);
foreach ($fields as $fieldAlias => $fieldName) {
$this->column("{$alias}.{$field}", $fieldAlias);
}
$this->_join[] = "{$mode} JOIN {$database->getTable($table)} AS {$alias} ON {$condition}";
} else {
foreach ($fields as $field) {
$this->column("{$field}");
}
$this->_join[] = "{$mode} JOIN {$database->getTable($table)} ON {$condition}";
}
return $this;
}
public function order($field, $direction = 'ASC')
{
$this->_order[] = "{$field} {$direction}";
return $this;
}
public function union($collection)
{
$this->_union[] = $collection;
return $this;
}
public function limit($limit, $offset = null)
{
$this->_limit = intval($limit);
$this->_offset = $offset;
return $this;
}
public function group($groupField)
{
$this->_group[] = $groupField;
return $this;
}
protected function _prepareSql()
{
if (empty($this->_union)) {
$database = Wootook_Database::getSingleton();
$fields = array();
foreach ($this->_columns as $field) {
$fieldName = current($field);
$fieldAlias = key($field);
if (is_string($fieldAlias)) {
$fields[] = "{$fieldName} AS {$fieldAlias}";
} else {
$fields[] = $fieldName;
}
}
if (!empty($fields)) {
$fields = implode(", ", $fields);
} else {
$fields = '*';
}
if (!empty($this->_where)) {
$where = 'WHERE (' . implode(") AND (", $this->_where) . ')';
} else {
$where = '';
}
$joinedTables = implode("\n ", $this->_join);
$order = '';
if (!empty($this->_order)) {
$order = 'ORDER BY ' . implode(", ", $this->_order);
}
$alias = '';
if ($this->_tableAlias !== null) {
$alias = " AS {$this->_tableAlias}";
}
$limit = '';
if ($this->_limit) {
if ($this->_offset) {
$limit = "LIMIT {$this->_limit}, {$this->_offset}";
} else {
$limit = "LIMIT {$this->_limit}";
}
}
$group = '';
if (!empty($this->_group)) {
$group = 'GROUP BY ' . implode(', ', $this->_group);
}
return <<<SQL_EOF
SELECT {$fields}
FROM {$database->getTable($this->getTableName())}{$alias}
{$joinedTables}
{$where}
{$group}
{$order}
{$limit}
SQL_EOF;
} else {
$statements = array();
foreach ($this->_union as $statement) {
$statements[] = $statement->_prepareSql();
}
$statements = '(' . implode(') UNION (', $statements) . ')';
if (!empty($where)) {
$where = 'WHERE ' . implode(" AND ", $this->_where);
} else {
$where = '';
}
$where = implode(" AND ", $this->_where);
$limit = '';
if ($this->_limit) {
if ($this->_offset) {
$limit = "LIMIT {$this->_limit}, {$this->_offset}";
} else {
$limit = "LIMIT {$this->_limit}";
}
}
return <<<SQL_EOF
$statements
{$where}
{$limit}
SQL_EOF;
}
}
public function __toString()
{
return $this->_prepareSql();
}
protected function _load()
{
$sql = $this->_prepareSql();
$database = Wootook_Database::getSingleton();
$statement = $database->prepare($sql);
$args = func_get_args();
$statement->execute(array_shift($args));
$this->_items = array();
if (func_num_args() > 1) {
$reflection = new ReflectionClass(array_shift($args));
} else {
$reflection = new ReflectionClass($this->getEntityClassName());
}
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$params = array_merge(array($row), $args);
$this->_items[] = $reflection->newInstanceArgs($params);
}
return $this;
}
protected function _save()
{
foreach ($this->_items as $child) {
$child->save();
}
return $this;
}
protected function _delete()
{
foreach ($this->_items as $child) {
$child->delete();
}
return $this;
}
public function getSize()
{
$clone = clone $this;
$clone->_fields = array();
$clone->column('1');
$sql = $clone->_prepareSql();
$database = Wootook_Database::getSingleton();
$statement = $database->prepare($sql);
$args = func_get_args();
$statement->execute(array_shift($args));
$count = $statement->rowCount();
$statement->closeCursor();
return $count;
}
public function count()
{
return count($this->_items);
}
public function current()
{
return current($this->_items);
}
public function next()
{
next($this->_items);
return $this;
}
public function rewind()
{
reset($this->_items);
return $this;
}
public function key()
{
return key($this->_items);
}
public function valid()
{
return current($this->_items) !== false;
}
public function getFirstItem()
{
if (!$this->_)
if (count($this->_items) > 0) {
return $this->_items[0];
}
return null;
}
public function getLastItem()
{
$size = count($this->_items);
if ($size > 0) {
return $this->_items[$size - 1];
}
return null;
}
}

View file

@ -1,50 +0,0 @@
<?php
class Wootook_Core_Controller_Action
{
private $_request = null;
private $_response = null;
public function init()
{
}
public function preDispatch()
{
}
public function postDispatch()
{
}
public function getRequest()
{
return $this->_request;
}
public function getResponse()
{
return $this->_response;
}
protected function _forward($action, $controller = null, $module = null)
{
$request = $this->getRequest();
$request->setAction($action);
if ($controller !== null) {
$request->setController($controller);
if ($module != null) {
$request->setModule($module);
}
}
$request->setIsDispatched(false);
}
protected function _redirect($url)
{
$this->getResponse()->setRedirect($url);
return $this;
}
}

View file

@ -1,102 +0,0 @@
<?php
class Wootook_Core_Controller_Request_Http
extends Wootook_Object
{
public function __construct()
{
parent::__construct(array());
}
public function setParam($key, $value)
{
return $this->setData($key, $value);
}
public function getParam($key, $default = null)
{
if ($this->hasData($key)) {
return $this->getData($key);
}
if (isset($_POST[$key])) {
return $_POST[$key];
}
if (isset($_GET[$key])) {
return $_GET[$key];
}
if (isset($_FILES[$key])) {
return $_FILES[$key];
}
if (isset($_COOKIE[$key])) {
return $_COOKIE[$key];
}
if (isset($_SERVER[$key])) {
return $_SERVER[$key];
}
return $default;
}
public function getQuery($key, $default = null)
{
if (!isset($_GET[$key])) {
return $default;
}
return $_GET[$key];
}
public function getFile($key, $default = null)
{
if (!isset($_FILES[$key])) {
return $default;
}
return $_FILES[$key];
}
public function getCookie($key, $default = null)
{
if (!isset($_COOKIE[$key])) {
return $default;
}
return unserialize(stripslashes($_COOKIE[$key]));
}
public function getRawCookie($key, $default = null)
{
if (!isset($_COOKIE[$key])) {
return $default;
}
return $_COOKIE[$key];
}
public function getPost($key, $default = null)
{
if (!isset($_POST[$key])) {
return $default;
}
return $_POST[$key];
}
public function getServer($key, $default = null)
{
if (!isset($_SERVER[$key])) {
return $default;
}
return $_SERVER[$key];
}
public function isPost()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') {
return true;
}
return false;
}
public function isGet()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') {
return true;
}
return false;
}
}

View file

@ -1,32 +0,0 @@
<?php
class Wootook_Core_Email
{
protected static $_defaultHeadrs = array(
);
protected $_headers = array();
public function send($to, $from, $subject, $body, Array $headers = array())
{
$this->_prepareHeaders($headers);
}
public function setHeader($name, $value)
{
$this->_headers[$name] = $value;
}
protected function _prepareHeaders($headers)
{
foreach ($headers as $name => $value) {
$this->setHeader($name, $value);
}
$this->addHeader('X-Mailer', 'PHP/' . PHP_VERSION . ' Wootook/' . VERSION);
$this->addHeader('Content-Transfer-Encoding', '7bit');
$this->addHeader('Content-Type', 'text/plain; charset=utf-8');
return $this;
}
}

View file

@ -1,153 +0,0 @@
<?php
abstract class Wootook_Core_Entity
extends Wootook_Core_Model
implements Wootook_Core_EntityInterface
{
protected $_idFieldName = null;
protected $_tableName = null;
public function setIdFieldName($fieldName)
{
$this->_idFieldName = $fieldName;
return $this;
}
public function getIdFieldName()
{
return $this->_idFieldName;
}
public function setTableName($tableName)
{
$this->_tableName = $tableName;
return $this;
}
public function getTableName()
{
return $this->_tableName;
}
public function setId($id)
{
$this->setData($this->getIdFieldName(), $id);
return $this;
}
public function getId()
{
return $this->getData($this->getIdFieldName());
}
protected function _load()
{
$id = func_get_arg(0);
$idFieldName = self::getIdFieldName();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT * FROM {$database->getTable(self::getTableName())}
WHERE {$idFieldName}=:id
LIMIT 1
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute(array(
'id' => $id
));
$datas = $statement->fetch(PDO::FETCH_ASSOC);
if (!is_array($datas) || empty($datas)) {
throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id could not be found.');
}
unset($datas[self::getIdFieldName()]);
$this->_data = $datas;
$this->setId($id);
return $this;
}
protected function _save()
{
if ($this->getId() !== null) {
$fields = array();
$values = array();
foreach ($this->getAllDatas() as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$fields[] = "{$field}=:{$field}";
$values[$field] = $value;
}
$fieldsImploded = implode(', ', $fields);
$idFieldName = self::getIdFieldName();
$values[$idFieldName] = $this->getId();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
UPDATE {$database->getTable(self::getTableName())}
SET {$fieldsImploded}
WHERE {$idFieldName}=:{$idFieldName}
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute($values);
} else {
$datas = $this->getAllDatas();
$fieldsImploded = implode(', ', array_keys($datas));
$tokens = array();
$values = array();
foreach ($datas as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$tokens[] = ":{$field}";
$values[$field] = $value;
}
$tokensImploded = implode(', ', $tokens);
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
INSERT INTO {$database->getTable(self::getTableName())} ($fieldsImploded)
VALUES ({$tokensImploded})
SQL_EOF;
$statement = $database->prepare($sql);
$statement->execute($values);
$this->setId($database->lastInsertId());
}
return $this;
}
protected function _delete()
{
$fields = array();
foreach ($this->getAllDatas() as $field => $value) {
if ($field == self::getIdFieldName()) {
continue;
}
$fields[] = "{$field}=:{$field}";
}
$fieldsImploded = implod(', ', $fields);
$idFieldName = self::getIdFieldName();
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
DELETE {$database->getTable(self::getTableName())}
WHERE {$idFieldName}=:{$idFieldName}
SQL_EOF;
$statement->execute($this->getAllDatas());
return $this;
}
}

View file

@ -1,13 +0,0 @@
<?php
interface Wootook_Core_EntityInterface
{
public function getId();
public function setId($id);
public function getIdFieldName();
public function setIdFieldName($fieldName);
public function getTableName();
public function setTableName($tableName);
}

View file

@ -1,202 +0,0 @@
<?php
class Wootook_Core_ErrorProfiler
{
private static $_singleton = null;
protected $_errors = array();
protected $_warnings = array();
protected $_notices = array();
protected $_otherErrors = array();
protected $_exceptions = array();
private static $_isTraceRegistered = false;
private static $_listen = true;
public static function getSingleton()
{
if (self::$_singleton === null) {
self::$_singleton = new self;
}
return self::$_singleton;
}
public function errorManager($errno, $errstr, $errfile = null, $errline = null, Array $errcontext = array())
{
if (!self::$_listen) {
return;
}
switch ($errno) {
case E_USER_ERROR:
case E_ERROR:
$this->_errors[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
case E_USER_WARNING:
case E_WARNING:
$this->_warnings[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
case E_USER_NOTICE:
case E_NOTICE:
$this->_notices[] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
default:
if (!isset($this->_otherErrors[$errno])) {
$this->_otherErrors[$errno] = array();
}
$this->_otherErrors[$errno][] = array(
'time' => explode(' ', microtime()),
'code' => $errno,
'message' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext
);
break;
}
return true;
}
public function exceptionManager($exception)
{
if (!self::$_listen) {
return;
}
$this->_exceptions[] = $exception;
}
protected function _renderError($id, $error)
{
$types = array(
0x0001 => 'E_ERROR',
0x0002 => 'E_WARNING',
0x0004 => 'E_PARSE',
0x0008 => 'E_NOTICE',
0x0010 => 'E_CORE_ERROR',
0x0020 => 'E_CORE_WARNING',
0x0040 => 'E_COMPILE_ERROR',
0x0080 => 'E_COMPILE_WARNING',
0x0100 => 'E_USER_ERROR',
0x0200 => 'E_USER_WARNING',
0x0400 => 'E_USER_NOTICE',
0x0800 => 'E_STRICT',
0x1000 => 'E_RECOVERABLE_ERROR',
0x2000 => 'E_DEPRECATED',
0x4000 => 'E_USER_DEPRECATED',
);
if (isset($error['code']) && isset($types[$error['code']])) {
$code = $types[$error['code']];
} else {
$code = "Unknown ({$error['code']})";
}
$date = date('Y-m-d H:i:s', (int) $error['time'][1]);
$microsec = (int) ($error['time'][0] * 1000000);
return <<<ERROR_EOF
Message #{$id}
On: {$date} +{$microsec}µs
Type: {$code}
Message: {$error['message']}
File: {$error['file']}
Line: {$error['line']}
\n
ERROR_EOF;
}
public function shutdownManager()
{
$index = 0;
echo '<div style="background:#FFF;border:1px solid #F00;color:#000;padding:10px;margin:20px;text-align:left;">';
echo '<h1>Debug profiler</h1>';
if (count($this->_errors) <= 0 && count($this->_warnings) <= 0 &&
count($this->_notices) <= 0 && count($this->_otherErrors) <= 0 &&
count($this->_exceptions) <= 0) {
echo '<p>Profiler was empty.</p>';
} else {
echo '<pre>';
foreach ($this->_errors as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_warnings as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_notices as $error) {
echo $this->_renderError(++$index, $error);
}
foreach ($this->_otherErrors as $errorList) {
foreach ($errorList as $error) {
echo $this->_renderError(++$index, $error);
}
}
foreach ($this->_exceptions as $exception) {
$index++;
echo "Message #{$index}". PHP_EOL;
echo $exception->getMessage() . PHP_EOL;
echo $exception->getTraceAsString();
}
echo '</pre>';
}
echo '</div>';
}
public static function register()
{
set_error_handler(array(self::getSingleton(), 'errorManager'));
set_exception_handler(array(self::getSingleton(), 'exceptionManager'));
if (self::$_isTraceRegistered === false && defined('DEBUG')) {
self::$_isTraceRegistered = true;
register_shutdown_function(array(self::getSingleton(), 'shutdownManager'));
}
}
public static function unregister($force = false)
{
restore_error_handler();
restore_exception_handler();
if ((self::$_isTraceRegistered && defined('DEBUG')) || $force) {
self::$_isTraceRegistered = false;
register_shutdown_function(array(self::getSingleton(), 'shutdownManager'));
}
}
public static function sleep()
{
self::$_listen = false;
}
public static function wakeup()
{
self::$_listen = true;
}
}

View file

@ -1,6 +0,0 @@
<?php
class Wootook_Core_Event
extends Wootook_Object
{
}

View file

@ -1,3 +0,0 @@
<?php
interface Wootook_Core_Exception extends Wootook_Exception {}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Core_Exception_Exception
extends Exception
implements Wootook_Core_Exception
{
}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Core_Exception_RuntimeException
extends RuntimeException
implements Wootook_Core_Exception
{
}

View file

@ -1,399 +0,0 @@
<?php
class Wootook_Core_Layout
extends Wootook_Core_Model
{
const DEFAULT_PACKAGE = 'base';
const DEFAULT_THEME = 'default';
protected $_blocks = array();
protected $_view = null;
protected $_eventPrefix = 'layout';
protected $_eventObject = 'layout';
protected $_package = self::DEFAULT_PACKAGE;
protected $_theme = self::DEFAULT_THEME;
protected $_namespaces = array(
'core' => array(
'Wootook_Core_Block_' => 'Wootook/core/Block'
)
);
public function _init()
{
$modules = Wootook_Core_Model_Config_Modules::getSingleton();
foreach ($modules['block'] as $module => $moduleNamespaces) {
foreach ($moduleNamespaces as $namespace => $path) {
$this->registerBlockNamespace($module, $namespace, $path);
}
}
$config = include ROOT_PATH . 'config.php';
$fileList = array();
if (isset($config['global'])) {
if (isset($config['global']['layout'])) {
$fileList = $config['global']['layout'];
}
if (isset($config['global']['package'])) {
$this->setPackage($config['global']['package']);
}
if (isset($config['global']['theme'])) {
$this->setTheme($config['global']['theme']);
}
}
foreach ($fileList as $layoutFile) {
foreach (include $this->_getLayoutPath($layoutFile) as $layoutId => $layoutConfig) {
if ($this->hasData($layoutId)) {
$declared = $this->getData($layoutId);
$layoutConfig = array_merge($declared, $layoutConfig);
}
$this->setData($layoutId, $layoutConfig);
}
}
return $this;
}
protected function _load()
{
$layoutId = func_get_arg(0);
if (!$this->hasData($layoutId)) {
return $this;
}
$layoutConfigs = array($this->getData($layoutId));
if (isset($layoutConfigs[0]['update'])) {
$parent = $layoutConfigs[0]['update'];
$i = 0;
while (true) {
$layoutConfigs[++$i] = $this->getData($parent);
if (!isset($layoutConfigs[$i]['update'])) {
break;
}
$parent = $layoutConfigs[$i]['update'];
}
}
$layoutUpdates = array();
$layoutConfig = array();
foreach (array_reverse($layoutConfigs) as $config) {
$layoutConfig = array_merge($layoutConfig, $config);
if (isset($layoutConfig['reference'])) {
foreach ($layoutConfig['reference'] as $name => $update) {
if (!isset($layoutUpdates[$name])) {
$layoutUpdates[$name] = array();
}
$layoutUpdates[$name][] = $update;
}
unset($layoutConfig['reference']);
}
}
unset($layoutConfigs, $layoutConfig['update']);
if (isset($layoutConfig['type'])) {
$type = $layoutConfig['type'];
$name = isset($layoutConfig['name']) ? $layoutConfig['name'] : 'root';
$this->_view = $this->_createBlock($type, $name, $layoutConfig);
} else if (!isset($this->_view)) {
return $this;
}
foreach ($layoutUpdates as $block => $updates) {
if (!isset($this->_blocks[$block])) {
continue;
}
$parent = $this->_blocks[$block];
foreach ($updates as $update) {
if (isset($update['children'])) {
foreach ($update['children'] as $childName => $childConfig) {
$type = $childConfig['type'];
$alias = isset($childConfig['alias']) ? $childConfig['alias'] : $childName;
$parent->$alias = $this->_createBlock($type, $childName, $childConfig);
}
}
}
}
foreach ($layoutUpdates as $block => $updates) {
if (!isset($this->_blocks[$block])) {
continue;
}
foreach ($updates as $update) {
if (isset($update['actions'])) {
$this->_callActions($this->_blocks[$block], $update['actions']);
}
}
}
foreach ($this->_blocks as $block) {
$block->prepareLayout();
}
}
protected function _save()
{
}
protected function _delete()
{
}
protected function _resolveBlockClassType($type)
{
$offset = strpos($type, '/');
if ($offset === false) {
return null;
}
$module = substr($type, 0, $offset);
$block = substr($type, $offset + 1);
/*
$module = str_replace(' ', '', ucwords(str_replace('-', ' ', $module)));
$module = str_replace(' ', '_', ucwords(str_replace('.', ' ', $module)));
*/
$block = str_replace(' ', '', ucwords(str_replace('-', ' ', $block)));
$block = str_replace(' ', '_', ucwords(str_replace('.', ' ', $block)));
if (isset($this->_namespaces[$module])) {
foreach ($this->_namespaces[$module] as $namespace => $path) {
$className = $namespace . $block;
$fileName = $path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $block) . '.php';
Wootook_Core_ErrorProfiler::sleep();
if (!($fp = @fopen($fileName, 'r', true))) {
Wootook_Core_ErrorProfiler::wakeup();
continue;
}
Wootook_Core_ErrorProfiler::wakeup();
fclose($fp);
if (!class_exists($className, true)) {
continue;
}
return $className;
}
}
trigger_error(Wootook::__('Class type "%s" could not be resolved.', $type), E_USER_INFO);
return null;
}
public function registerBlockNamespace($module, $namespace, $path = null)
{
if ($path === null) {
$path = str_replace('_', DIRECTORY_SEPARATOR, $namespace);
}
if (!isset($this->_namespaces[$module])) {
$this->_namespaces[$module] = array();
}
$this->_namespaces[$module][$namespace] = $path;
return $this;
}
public function unregisterBlockNamespace($module, $namespace)
{
if (isset($this->_namespaces[$module]) && isset($this->_namespaces[$module][$namespace])) {
unset($this->_namespaces[$module][$namespace]);
}
return $this;
}
public function createBlock($type, $name, $config = array())
{
$instance = $this->_createBlock($type, $name, $config);
$instance->prepareLayout();
return $instance;
}
protected function _createBlock($type, $name, $config = array())
{
$className = $this->_resolveBlockClassType($type);
if ($className === null) {
return null;
}
$children = array();
if (isset($config['children'])) {
$children = $config['children'];
unset($config['children']);
}
$actions = array();
if (isset($config['actions'])) {
$actions = $config['actions'];
unset($config['actions']);
}
try {
$reflectionClass = new ReflectionClass($className);
$instance = $reflectionClass->newInstance($config);
$this->_blocks[$name] = $instance;
$instance->setNameInLayout($name);
$instance->setLayout($this);
foreach ($children as $name => $config) {
if (isset($config['alias'])) {
$alias = $config['alias'];
} else {
$alias = $name;
}
if (!isset($config['type'])) {
$instance->$alias = new Wootook_Core_View($config);
} else {
$instance->$alias = $this->_createBlock($config['type'], $name, $config);
}
}
} catch (ReflectionException $e) {
trigger_error($e->getMessage(), E_USER_INFO);
return null;
}
$this->_callActions($instance, $actions);
return $instance;
}
protected function _callActions($block, $actions)
{
$reflectionClass = new ReflectionClass($block);
foreach ($actions as $action) {
if (!isset($action['method'])) {
continue;
}
$method = $action['method'];
$params = array();
if (isset($action['params'])) {
$params = $action['params'];
}
try {
$reflectionMethod = $reflectionClass->getMethod($method);
$requiredParameterCount = $reflectionMethod->getNumberOfRequiredParameters();
$callParamaters = array();
foreach ($reflectionMethod->getParameters() as $parameter) {
$paramterName = $parameter->getName();
$paramterPosition = $parameter->getPosition();
if (isset($params[$paramterName])) {
$callParamaters[$paramterPosition] = $params[$paramterName];
} else if ($parameter->isDefaultValueAvailable()) {
$callParamaters[$paramterPosition] = $parameter->getDefaultValue();
//} else if (!$parameter->isOptionnal()) {
} else if ($paramterPosition <= $requiredParameterCount) {
throw new Wootook_Core_Exception_RuntimeException();
}
}
$reflectionMethod->invokeArgs($block, $callParamaters);
} catch (ReflectionException $e) {
trigger_error($e->getMessage(), E_USER_INFO);
continue;
} catch (RuntimeException $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
continue;
}
}
}
public function getPackage()
{
return $this->_package;
}
public function setPackage($package)
{
$this->_package = $package;
return $this;
}
public function getTheme()
{
return $this->_theme;
}
public function setTheme($theme)
{
$this->_theme = $theme;
return $this;
}
public function getScriptPath()
{
return APPLICATION_PATH . DIRECTORY_SEPARATOR . 'design';
}
public function getBlock($code)
{
if (isset($this->_blocks[$code])) {
return $this->_blocks[$code];
}
return null;
}
public function render()
{
$scriptPath = $this->getScriptPath();
foreach ($this->_blocks as $block) {
if ($block instanceof Wootook_Core_Block_Template) {
$block->setScriptPath($scriptPath);
}
$block->beforeToHtml();
}
unset($block);
return $this->_view->render();
}
protected function _getLayoutPath($file)
{
$package = $this->getPackage();
$theme = $this->getTheme();
$pattern = "{$this->getScriptPath()}/%s/%s/layouts/{$file}";
$path = sprintf($pattern, $package, $theme);
if (Wootook::fileExists($path)) {
return $path;
}
$path = sprintf($pattern, $package, self::DEFAULT_THEME);
if (Wootook::fileExists($path)) {
return $path;
}
$path = sprintf($pattern, self::DEFAULT_PACKAGE, self::DEFAULT_THEME);
if (Wootook::fileExists($path)) {
return $path;
}
trigger_error(Legacies::__("Layout file '%s' does not exist.", $file), E_USER_INFO);
return null;
}
}

View file

@ -1,88 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Core_Model_Config
extends Wootook_Core_Model
implements Wootook_Core_Singleton
{
private static $_singleton = null;
protected $_eventPrefix = 'core.config';
protected $_eventObject = 'config';
public static function getSingleton()
{
if (self::$_singleton === null) {
self::$_singleton = new self();
}
return self::$_singleton;
}
protected function _init()
{
$this->load();
}
protected function _load()
{
$database = Wootook_Database::getSingleton();
$sql =<<<SQL_EOF
SELECT config_name AS attribute, config_value AS value
FROM {$database->getTable('config')} AS config
SQL_EOF;
$attributeName = null;
$attributeValue = null;
$statement = $database->prepare($sql);
$statement->execute();
$statement->bindColumn('attribute', $attributeName, PDO::PARAM_STR);
$statement->bindColumn('value', $attributeValue, PDO::PARAM_STR);
while ($statement->fetch(PDO::FETCH_BOUND)) {
$this->setData($attributeName, $attributeValue);
}
return $this;
}
protected function _save()
{
$database = Wootook_Database::getSingleton();
$fields = array();
$sql =<<<SQL_EOF
UPDATE {{table}}
SET config_value=:value
WHERE config_name=:name
SQL_EOF;
$statement = $database->prepare($sql);
foreach ($this->getAllDatas() as $attributeName => $attributeValue) {
$statement->execute(array(
'name' => $attributeName,
'value' => $attributeValue
));
}
return $this;
}
protected function _delete()
{
// NOP
return $this;
}
public function isEnabled()
{
return (bool) $this->getData('game_disable');
}
}

View file

@ -1,145 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Core_Model_Session
extends Wootook_Object
{
const CRIT = 0x80;
const ERROR = 0x40;
const WARN = 0x20;
const INFO = 0x10;
const DEBUG = 0x01;
const SUCCESS = 0;
protected static $_instances = null;
protected static $_levels = null;
public static function factory($namespace)
{
$namespace = (string) $namespace;
if (!isset(self::$_instances[$namespace])) {
if (self::$_levels === null) {
$reflection = new ReflectionClass(__CLASS__);
self::$_levels = array_flip($reflection->getConstants());
}
self::$_instances[$namespace] = new self($namespace);
}
return self::$_instances[$namespace];
}
public static function destroy()
{
session_destroy();
}
public function __construct($namespace)
{
if (session_id() == '') {
session_start();
}
if (!isset($_SESSION[$namespace])) {
$_SESSION[$namespace] = array();
}
$this->_data = &$_SESSION[$namespace];
$this->_data['messages'] = array();
}
public function getMessages($clear = true)
{
$messages = $this->_data['messages'];
if ($clear == true) {
$this->_data['messages'] = array();
}
return $messages;
}
public function addMessage($message, $type = self::DEBUG)
{
if (!isset(self::$_levels[$type])) {
$type = self::DEBUG;
}
if (!isset($this->_data['messages'])) {
$this->_data['messages'] = array();
}
if (!isset($this->_data['messages'][self::$_levels[$type]])) {
$this->_data['messages'][self::$_levels[$type]] = array();
}
$this->_data['messages'][self::$_levels[$type]][] = $message;
return $this;
}
public function addCritical($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::CRIT);
}
public function addError($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::ERROR);
}
public function addWarning($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::WARN);
}
public function addSuccess($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::SUCCESS);
}
public function addInfo($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::INFO);
}
public function addDebug($message, $_ = null)
{
$args = func_get_args();
array_shift($args);
return $this->addMessage(vsprintf($message, $args), self::DEBUG);
}
public function getFormKey($reset = false)
{
if (!$this->getData('form_key')) {
$this->setData('form_key', uniqid());
return $this->getData('form_key');
}
$key = $this->getData('form_key');
if ($reset == true) {
$this->setData('form_key', uniqid());
}
return $key;
}
}

View file

@ -1,6 +0,0 @@
<?php
interface Wootook_Core_Singleton
{
public static function getSingleton();
}

View file

@ -1,13 +0,0 @@
<?php
class Wootook_Core_Time
{
public static function init()
{
$config = include ROOT_PATH . 'config.php';
$timezone = $config['global']['date']['timezone'];
date_default_timezone_set($timezone);
}
}

View file

@ -1,51 +0,0 @@
<?php
class Wootook_Database
extends PDO
{
protected static $_singleton = null;
protected static $_prefix = null;
public static $options = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
);
public static function getSingleton()
{
if (self::$_singleton === null) {
$config = include ROOT_PATH . 'config.php';
$hostname = $config['global']['database']['options']['hostname'];
$username = $config['global']['database']['options']['username'];
$password = $config['global']['database']['options']['password'];
$database = $config['global']['database']['options']['database'];
$port = 3306;
if (isset($config['global']['database']['options']['port'])) {
$port = $config['global']['database']['options']['port'];
}
$event = Wootook::dispatchEvent('database.prepare-options', array(
'options' => self::$options
));
self::$options = $event->getData('options');
self::$_singleton = new self("mysql:dbname={$database};host={$hostname};port={$port}", $username, $password, self::$options);
Wootook::dispatchEvent('database.init', array(
'handler' => self::$_singleton
));
}
return self::$_singleton;
}
public function getTable($name)
{
if (self::$_prefix === null) {
$config = include ROOT_PATH . 'config.php';
self::$_prefix = $config['global']['database']['table_prefix'];
}
return self::$_prefix . $name;
}
}

View file

@ -1,32 +0,0 @@
<?php
class Wootook_Empire_Block_Topnav
extends Wootook_Core_Block_Template
{
/**
*
* @return Wootook_Empire_Model_User
*/
public function getCurrentUser()
{
return Wootook_Empire_Model_User::getSingleton();
}
/**
*
* @return Wootook_Empire_Model_Planet
*/
public function getCurrentPlanet()
{
return $this->getCurrentUser()->getCurrentPlanet();
}
/**
*
* @return Wootook_Core_Collection
*/
public function getPlanetCollection()
{
return $this->getCurrentUser()->getPlanetCollection();
}
}

View file

@ -1,3 +0,0 @@
<?php
interface Legacies_Empire_Exception extends Legacies_Exception {}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Empire_Exception_Exception
extends Exception
implements Wootook_Empire_Exception
{
}

View file

@ -1,7 +0,0 @@
<?php
class Wootook_Empire_Exception_RuntimeException
extends RuntimeException
implements Wootook_Empire_Exception
{
}

View file

@ -1,32 +0,0 @@
<?php
class Wootook_Empire_Model_Galaxy_Position
extends Wootook_Core_Entity_SubTable
{
protected function _init()
{
$this->_tableName = 'galaxy';
$this->_idFieldNames = array('id_planet');
}
static function initPlanetListerner($eventData)
{
if (!isset($eventData['planet'])) {
return;
}
$planet = $eventData['planet'];
if (!$planet->isPlanet()) {
return;
}
$galaxy = new self();
$galaxy
->setData('galaxy', $planet->getGalaxy())
->setData('system', $planet->getSystem())
->setData('planet', $planet->getPosition())
->setData('id_planet', $planet->getId())
->save()
;
}
}

View file

@ -1,3 +0,0 @@
<?php
class Wootook_Empire_Model_Planet_Exception implements Wootook_Empire_Exception {}

View file

@ -1,29 +0,0 @@
<?php
class Wootook_Empire_Model_Planet_PluginLoader
extends Wootook_Core_Plugin_LoaderAbstract
{
protected $_currentUser = null;
protected $_currentPlanet = null;
public function __construct($currentPlanet, $currentUser)
{
$this->_currentUser = $currentUser;
$this->_currentPlanet = $currentPlanet;
}
protected function _load($className, $useSingleton)
{
$reflection = new ClassReflection($className);
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
$method = $reflection->getMethod('getSingleton');
$method->invoke();
}
try {
return $reflection->invoke($this->_currentPlanet, $this->_currentUser);
} catch (ReflectionException $e) {
return null;
}
}
}

View file

@ -1,27 +0,0 @@
<?php
abstract class Wootook_Empire_Model_Planet_ShipAbstract
implements Wootook_Empire_Model_Planet_ShipInterface
{
public function getBaseSpeed(Wootook_Empire_Model_User $user)
{
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
return $prices[Legacies_Empire::ID_SHIP_SUPERNOVA][Legacies_Empire::SHIPS_CELERITY_PRIMARY];
}
public function getSpeedMultiplier(Wootook_Empire_Model_User $user)
{
return pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE));
}
public function getActualSpeed(Wootook_Empire_Model_User $user)
{
return $this->getBaseSpeed($user) * $this->getSpeedMultiplier($user);
}
public function getActualConsumption(Wootook_Empire_Model_User $user, $speed)
{
return $this->getBaseConsumption($user) * ($speed / 100) * $this->getSpeedMultiplier($user);
}
}

View file

@ -1,11 +0,0 @@
<?php
interface Wootook_Empire_Model_Planet_ShipInterface
{
public function getBaseSpeed(Wootook_Empire_Model_User $user);
public function getSpeedMultiplier(Wootook_Empire_Model_User $user);
public function getActualSpeed(Wootook_Empire_Model_User $user);
public function getBaseConsumption(Wootook_Empire_Model_User $user);
public function getActualConsumption(Wootook_Empire_Model_User $user, $speed);
}

View file

@ -1,538 +0,0 @@
<?php
/**
*
* Enter description here ...
*
* @uses Wootook_Object
* @uses Legacies_Empire
*/
class Wootook_Empire_Model_User
extends Wootook_Core_Entity
{
protected static $_instances = array();
protected static $_singleton = null;
protected $_eventPrefix = 'user';
protected $_eventObject = 'user';
public static $hashCallback = 'md5';
protected $_homePlanet = null;
protected $_currentPlanet = null;
const SESSION_KEY = 'user';
const COOKIE_NAME = 'Wootook';
const COOKIE_LIFETIME = 2592000;
const PLANET_SORT_DATE = 0;
const PLANET_SORT_POSITION = 1;
const PLANET_SORT_NAME = 2;
protected static $_cookieName = self::COOKIE_NAME;
public static function setCookieName($name)
{
self::$_cookieName = $name;
}
public static function factory($id)
{
if ($id === null) {
return new self();
}
$id = intval($id);
if (!isset(self::$_instances[$id])) {
$instance = new self();
$params = func_get_args();
call_user_func_array(array($instance, 'load'), $params);
self::$_instances[$id] = $instance;
}
return self::$_instances[$id];
}
public function getUsername()
{
return $this->getData('username');
}
public static function getSingleton()
{
if (self::$_singleton === null) {
$session = Wootook::getSession(self::SESSION_KEY);
if ($session->hasData('user_id')) {
$id = intval($session->getData('user_id'));
} else if (Wootook::getRequest() !== null && ($cookie = Wootook::getRequest()->getCookie(self::$_cookieName)) !== null) {
$cookieData = unserialize(stripslashes($cookie));
if (is_array($cookieData)) {
$collection = new Wootook_Core_Collection(array('user' => 'users'));
$cookieData = array(
'id' => (isset($cookieData['id']) ? intval($cookieData['id']) : 0),
'key' => (isset($cookieData['key']) ? $collection->quote($cookieData['key']) : null)
);
$collection
->column('id')
->where('user.id=:id')
->where(':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))')
->load($cookieData)
;
if ($collection->count() > 0) {
$session->setData(self::SESSION_KEY, $cookieData['id']);
} else {
$session->addError('Your session has expired, please login.');
return null;
}
}
} else {
$session->addError('Your session has expired, please login.');
return null;
}
try {
self::$_singleton = self::factory($id);
} catch (Wootook_Core_Exception_DataAccessException $e) {
$session->addError('Session error.');
return null;
}
self::$_singleton->_updateActivity();
}
return self::$_singleton;
}
public static function hash($password, $salt = null)
{
if ($salt === null) {
return call_user_func(self::$hashCallback, ($password));
}
return call_user_func(self::$hashCallback, ($password . $salt));
}
protected function _init()
{
$this->setIdFieldName('id');
$this->setTableName('users');
}
protected function _updateActivity()
{
$this
->setData('current_page', $_SERVER['REQUEST_URI'])
->setData('user_lastip', $_SERVER['REMOTE_ADDR'])
->setData('user_agent', $_SERVER['HTTP_USER_AGENT'])
->setData('onlinetime', time())
->save()
;
return $this;
}
public function logout()
{
Wootook::getResponse()->unsetCookie(self::$_cookieName);
Wootook_Core_Model_Session::destroy();
}
public static function login($username, $password, $remember = false)
{
$session = Wootook::getSession(self::SESSION_KEY);
try {
$collection = new Wootook_Core_Collection(array('user' => 'users'));
$passwordHash = md5($password);
$collection
->column('user.id')
->column('user.username')
->column('user.password')
->column('user.banaday')
->column('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt))) AS login_rememberme')
->column('(CASE WHEN user.password="' . $passwordHash . '" THEN 1 ELSE 0 END) AS login_success')
->where('user.username=:username')
->load(array(
'username' => $username
))
;
} catch (Wootook_Core_Exception_DataAccessException $e) {
Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e);
$session->addError('No such user.');
return null;
}
if ($collection->count() <= 0) {
$session->addError('No such user.');
return null;
}
$login = $collection->current();
if (intval($login['login_success']) == 1) {
if ($login['banaday'] != 0) {
if($login['banaday'] <= time()) {
$user->setData('banaday', 0)
->setData('bana', 0)
->setData('urlaubs_modus', 0)
->save()
;
} else {
$session->addError('You were banned, please contact admin for more information.');
return null;
}
}
if (isset($_POST["rememberme"]) && Wootook::getRequest() !== null) {
Wootook::$response->setCookie(self::$_cookieName, array('id' => $login['id'], 'key' => $login['login_rememberme']), self::COOKIE_LIFETIME);
}
self::$_singleton = self::factory($login['id']);
self::$_singleton->_updateActivity();
$session->setData('user_id', intval($login['id']));
return self::$_singleton;
}
$session->addError('Your username or credential is invalid, please check your input.');
return null;
}
public static function register($username, $email, $password)
{
try {
$request = Wootook::getRequest();
$user = new self(array(
'username' => $username,
'password' => md5($password),
'email' => $email,
'email_2' => $email,
'register_time' => Wootook::now(),
'onlinetime' => Wootook::now(),
'ip_at_reg' => $request->getServer('REMOTE_ADDR'),
'user_lastip' => $request->getServer('REMOTE_ADDR'),
'user_agent' => $request->getServer('HTTP_USER_AGENT')
));
$user->save();
Wootook::dispatchEvent('user.init', array(
'user' => $user
));
$user->save();
} catch (Wootook_Core_Exception_DataAccessException $e) {
echo $e->getTraceAsString();
$session->addError($e->getMessage());
return null;
}
return $user;
}
/**
*
* Enter description here ...
* @param int|Wootook_Empire_Model_Planet $planet
*/
public function updateCurrentPlanet($planet)
{
if (!$planet instanceof Wootook_Empire_Model_Planet) {
$planetCollection = $this->_preparePlanetCollection()->where('id=:id');
$planetCollection->load(array(
'id' => $planet,
'user' => $this->getId()
));
if ($planetCollection->count() !== 1) {
return $this;
}
$planet = $planetCollection->current();
}
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('current_planet', $planet->getId())->save();
return $this;
}
/**
*
* Enter description here ...
* @param Wootook_Empire_Model_Planet $planet
*/
public function setHomePlanet(Wootook_Empire_Model_Planet $planet)
{
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('id_planet', $planet->getId());
$this->_homePlanet = $planet;
return $this;
}
/**
*
* Enter description here ...
* @param Wootook_Empire_Model_Planet $planet
*/
public function setCurrentPlanet(Wootook_Empire_Model_Planet $planet)
{
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return $this;
}
$this->setData('current_planet', $planet->getId());
$this->_currentPlanet = $planet;
return $this;
}
/**
*
* Enter description here ...
* @return Wootook_Empire_Model_Planet
*/
public function getHomePlanet()
{
if ($this->_homePlanet === null) {
$planetId = $this->getData('id_planet');
if (!$planetId) {
return null;
}
$planet = Wootook_Empire_Model_Planet::factory($planetId);
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
return null;
}
$this->_homePlanet = $planet;
}
return $planet;
}
/**
*
* Enter description here ...
* @return Wootook_Empire_Model_Planet
*/
public function getCurrentPlanet()
{
if ($this->_currentPlanet === null) {
$planetId = $this->getData('current_planet');
if (!$planetId) {
$this->_currentPlanet = $this->getHomePlanet();
$this->setData('current_planet', $this->_currentPlanet->getId())->save();
return $this->_currentPlanet;
}
$planet = Wootook_Empire_Model_Planet::factory($planetId);
if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) {
$this->_currentPlanet = $this->getHomePlanet();
$this->setData('current_planet', $this->_currentPlanet->getId())->save();
return $this->_currentPlanet;
}
$this->_currentPlanet = $planet;
}
return $this->_currentPlanet;
}
protected function _preparePlanetCollection()
{
$planetCollection = new Wootook_Core_Collection(array('planet' => 'planets'), 'Wootook_Empire_Model_Planet');
$planetCollection->where('id_owner=:user');
$order = ($this->getData('planet_sort_order') == 1) ? 'DESC' : 'ASC';
switch ($this->getData('planet_sort')) {
case self::PLANET_SORT_POSITION:
$planetCollection
->order('planet.galaxy', $order)
->order('planet.system', $order)
->order('planet.planet', $order)
->order('planet.planet_type', $order)
;
break;
case self::PLANET_SORT_NAME:
$planetCollection->order('planet.name', $order);
break;
case self::PLANET_SORT_DATE:
default:
$planetCollection->order('planet.id', $order);
break;
}
return $planetCollection;
}
public function getPlanetCollection()
{
$planetCollection = $this->_preparePlanetCollection();
$planetCollection->load(array(
'user' => $this->getId()
));
return $planetCollection;
}
protected function _prepareFleetCollection()
{
$collection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->where('fleet_owner <= :user_id')
;
return $collection;
}
public function getFleets()
{
return $this->_prepareFleetCollection()->load(array('user_id' => $this->getId()));
}
public function getFleetCount()
{
return $this->_prepareFleetCollection()->getSize(array('user_id' => $this->getId()));
}
public function getVisibleFleets()
{
$user = Wootook_Empire_Model_User::getSingleton();
$firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$firstCollection
// ->column('*')
->column('fleet.fleet_start_galaxy', 'galaxy')
->column('fleet.fleet_start_system', 'system')
->column('fleet.fleet_start_planet', 'planet')
->column('fleet.fleet_start_type', 'planet_type')
->where('fleet_end_time <= :now')
;
$backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$backCollection
// ->column('*')
->column('fleet.fleet_end_galaxy', 'galaxy')
->column('fleet.fleet_end_system', 'system')
->column('fleet.fleet_end_planet', 'planet')
->column('fleet.fleet_end_type', 'planet_type')
->where('fleet_end_time <= :now')
;
$collection = new Wootook_Core_Collection();
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->union($firstCollection)
->union($backCollection)
->load(array('now' => time()));
return $collection;
}
public function getElement($elementId)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->getData($fields[$elementId]);
}
public function setElement($elementId, $level)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->setData($fields[$elementId], $level);
}
public function hasElement($elementId, $levelRequired = 0)
{
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
return $this->hasData($fields[$elementId]) && Math::comp($this->getElement($elementId), $levelRequired) > 0;
}
public function getSkinPath($default = null)
{
if ($path = $this->getData('dpath')) {
return $path;
}
return $default;
}
public function setSkinPath($path)
{
$this->setData('dpath', $path);
return $this;
}
public function checkPassword($password)
{
if (self::hash($password) == $this->getData('password')) {
return true;
}
return false;
}
public function getFleetCollection($time = null)
{
$firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$firstCollection
->column('*')
->where('fleet.fleet_owner = :user')
;
$backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets'));
$backCollection
->column('*')
->where('fleet.fleet_target_owner = :user')
;
$options = array(
'user' => $this->getId()
);
if ($time !== null) {
$options['now'] = $time;
$firstCollection->where('fleet_start_time <= :now');
$backCollection->where('fleet_end_time <= :now');
}
$collection = new Wootook_Core_Collection();
$collection
->setEntityClassName('Wootook_Empire_Model_Fleet')
->union($firstCollection)
->union($backCollection)
->load($options)
;
return $collection;
}
public function getNewMessagesCount()
{
$messageCollection = new Wootook_Core_Collection('messages');
$messageCollection->where('message_owner=:user');
$messageCollection->where('message_read_at<=0');
$newMessages = null;
if (($count = $messageCollection->getSize(array('user' => $this->getId()))) > 0) {
return $count;
}
return null;
}
}

View file

@ -1,3 +0,0 @@
<?php
interface Wootook_Exception {}

View file

@ -1,27 +0,0 @@
var _gaq = _gaq || [];
(function()){
var trackErrorThroughEvent = function(exception, f) {
_gaq.push(['_trackEvent',
'JS ERROR: '+ (f || 'native') + ' (nav:'+ navigator.userAgent +') Exception: '+ (exception.name || 'Error'),
exception.message || exception,
' url: '+document.location.href+' referer: '+ document.referrer
]);
};
var outLink = function(link){
var _gA = link.href.split('/');
var _gS = link.href.split('#');
var _gT = '/out-link/' + _gA[2] + '/?d=' + _gS[0];
_gaq.push(['_trackPageview',_gT]);
_gaq.push(function() {
try {
setTimeout('window.open(_gat._getTrackerByName()._getLinkerUrl(\'' + lien.href + '\',false),\'_blank\')', 100);
} catch(err) {
window.open(lien.href, '_blank'); /* préserve le fonctionnement du lien href en cas de pb */
trackErrorThroughEvent(err,'lienSortant : '+lien.href );
}
});
}
})();

View file

@ -1,300 +0,0 @@
<?php return array(
'empire' => array(
'update' => '2columns-left',
'reference' => array(
'navigation' => array(
'actions' => array(
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'development',
'title' => 'Development'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/overview',
'label' => 'Overview',
'title' => 'Overview',
'uri' => 'overview.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/buildings',
'label' => 'Buildings',
'title' => 'Buildings',
'uri' => 'overview.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/research-lab',
'label' => 'Research Lab',
'title' => 'Research Lab',
'uri' => 'overview.php',
'params' => array(
'mode' => 'research'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/shipyard',
'label' => 'Shipyard',
'title' => 'Shipyard',
'uri' => 'overview.php',
'params' => array(
'mode' => 'fleet'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/defenses',
'label' => 'Defenses',
'title' => 'Defenses',
'uri' => 'overview.php',
'params' => array(
'mode' => 'defense'
)
)
)
)
)
)
),
'overview' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'overview.forms' => array(
'type' => 'core/concat'
),
'overview' => array(
'type' => 'empire/overview',
'template' => 'empire/overview.phtml'
),
)
),
'left' => array(
)
)
),
'overview.rename-planet' => array(
'update' => 'overview',
'reference' => array(
'overview.forms' => array(
'children' => array(
'rename-planet' => array(
'type' => 'empire/overview.rename-planet',
'template' => 'empire/overview/form/rename-planet.phtml'
),
)
)
)
),
'overview.destroy-planet' => array(
'update' => 'overview',
'reference' => array(
'overview.forms' => array(
'children' => array(
'destroy-planet' => array(
'type' => 'empire/overview.destroy-planet',
'template' => 'empire/overview/form/destroy-planet.phtml'
),
)
)
)
),
'planet.buildings' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'queue' => array(
'type' => 'empire/planet.buildings.queue',
'template' => 'empire/planet/buildings/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/buildings/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'empire/planet.buildings.queue.item'
)
)
)
),
'item-list' => array(
'type' => 'empire/planet.buildings',
'template' => 'empire/planet/buildings.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/buildings/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'empire/planet.buildings.item'
)
)
)
),
)
)
)
),
'planet.shipyard' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'item-list' => array(
'type' => 'legacies_empire/planet.shipyard',
'template' => 'empire/planet/shipyard.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/shipyard/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.shipyard.item'
)
),
)
),
'queue' => array(
'type' => 'legacies_empire/planet.shipyard.queue',
'template' => 'empire/planet/shipyard/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/shipyard/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.shipyard.queue.item'
)
)
)
),
)
)
)
),
'planet.defense' => array(
'update' => 'planet.shipyard',
'reference' => array(
'item-list' => array(
'actions' => array(
array(
'method' => 'setType',
'params' => array(
'type' => Legacies_Empire::TYPE_DEFENSE
)
)
)
)
)
),
'planet.research-lab' => array(
'update' => 'empire',
'reference' => array(
'content' => array(
'children' => array(
'topnav' => array(
'type' => 'empire/topnav',
'template' => 'empire/topnav.phtml',
),
'item-list' => array(
'type' => 'legacies_empire/planet.research-lab',
'template' => 'empire/planet/research-lab.phtml',
'children' => array(
'item-list.items' => array(
'type' => 'core/concat'
),
),
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/research-lab/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.research-lab.item'
)
),
)
),
'queue' => array(
'type' => 'legacies_empire/planet.research-lab.queue',
'template' => 'empire/planet/research-lab/queue.phtml',
'actions' => array(
array(
'method' => 'setItemTemplate',
'params' => array(
'template' => 'empire/planet/research-lab/queue/item.phtml'
)
),
array(
'method' => 'setItemBlockType',
'params' => array(
'blockType' => 'legacies_empire/planet.research-lab.queue.item'
)
)
)
)
)
)
)
)
);

View file

@ -1,206 +0,0 @@
<?php return array(
'1column' => array(
'update' => 'default'
),
'2columns-left' => array(
'update' => 'default',
'template' => 'page/2columns-left.phtml',
'reference' => array(
'root' => array(
'children' => array(
'left' => array(
'type' => 'core/concat',
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml'
)
)
)
)
)
)
),
'2columns-right' => array(
'update' => 'default',
'template' => 'page/2columns-right.phtml',
'reference' => array(
'root' => array(
'children' => array(
'right' => array(
'type' => 'core/concat'
),
)
)
)
),
'3columns' => array(
'update' => 'default',
'template' => 'page/3columns.phtml',
'reference' => array(
'root' => array(
'children' => array(
'left' => array(
'type' => 'core/concat'
),
'right' => array(
'type' => 'core/concat'
),
)
)
)
),
'default' => array(
'type' => 'core/html.page',
'template' => 'page/1column.phtml',
'children' => array(
'head' => array(
'type' => 'core/html.head',
'template' => 'page/html/head.phtml',
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/default.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/formate.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/legacies.css'
)
)
)
),
'header' => array(
'type' => 'core/template',
'template' => 'page/html/header.phtml',
'children' => array(
'menu' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml',
),
'planet-list' => array(
'type' => 'empire/planet-list',
'template' => 'empire/planet-list.phtml',
)
)
),
'footer' => array(
'type' => 'core/template',
'template' => 'page/html/footer.phtml'
),
'content' => array(
'type' => 'core/concat'
)
)
),
'ajax' => array(
'type' => 'core/html.page',
'template' => 'page/empty.phtml',
'children' => array(
'content' => array(
'type' => 'core/concat'
)
)
),
'empty' => array(
'type' => 'core/html.page',
'template' => 'page/empty.phtml',
'children' => array(
'head' => array(
'type' => 'core/html.head',
'template' => 'page/html/head.phtml'
),
'content' => array(
'type' => 'core/concat'
)
)
),
'message' => array(
'update' => 'default',
'reference' => array(
'content' => array(
'children' => array(
'message' => array(
'type' => 'core/template',
'template' => 'page/html/message.phtml'
),
)
)
)
),
'login' => array(
'update' => '1column',
'reference' => array(
'content' => array(
'children' => array(
'login' => array(
'type' => 'core/template',
'template' => 'user/login.phtml'
),
)
),
'head' => array(
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/styles.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/about.css'
)
)
)
)
)
),
'registration' => array(
'update' => '1column',
'reference' => array(
'content' => array(
'children' => array(
'registration' => array(
'type' => 'core/template',
'template' => 'user/registration.phtml'
),
)
),
'head' => array(
'actions' => array(
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/styles.css'
)
),
array(
'method' => 'addCss',
'params' => array(
'stylesheet' => 'css/deprecated/about.css'
)
)
)
)
)
)
);

View file

@ -1,35 +0,0 @@
<br><br>
<h2><?php echo $this->getData('adm_ov_title')?></h2>
<table width="600">
<tr>
<td class="c" colspan="2"><?php echo $this->getData('adm_ov_infos')?></td>
</tr><tr>
<td class="b" style="color:#FFFFFF"><?php echo $this->getData('adm_ov_yourv')?>: <strong><?php echo $this->getData('adm_ov_data_yourv')?></strong></td>
<td class="b" style="color:#FFFFFF"><?php echo $this->getData('adm_ov_lastv')?>: <b><a style="color:orange;" href="http://www.xnova-ng.org/"><?php echo $this->getData('adm_ov_here')?></a></b></td>
</tr>
</table>
<br>
<table width="600">
<tr>
<td class="c" colspan="13"><?php echo $this->getData('adm_ov_onlin')?></td>
</tr>
<tr>
<th><a href="?cmd=sort&type=id"><?php echo $this->getData('adm_ul_id')?></a></th>
<th><a href="?cmd=sort&type=username"><?php echo $this->getData('adm_ul_name')?></a></th>
<th><a href="?cmd=sort&type=user_lastip"><?php echo $this->getData('adm_ul_adip')?></a></th>
<th><a href="?cmd=sort&type=ally_name"><?php echo $this->getData('adm_ov_ally')?></a></th>
<th><?php echo $this->getData('adm_ov_point')?></th>
<th><a href="?cmd=sort&type=onlinetime"><?php echo $this->getData('adm_ov_activ')?></a></th>
<th><?php echo $this->getData('usr_email')?></th>
<th><?php echo $this->getData('xp_raid')?></th>
<th><?php echo $this->getData('xp_min')?></th>
<th><?php echo $this->getData('lang_vacancy')?></th>
<th><?php echo $this->getData('banned_lang')?></th>
<th><?php echo $this->getData('usr_current_planet')?></th>
<th><?php echo $this->getData('usr_current_page')?></th>
</tr>
<?php echo $this->getData('adm_ov_data_table')?>
<tr>
<th class="b" colspan="13"><?php echo $this->getData('adm_ov_count')?>: <?php echo $this->getData('adm_ov_data_count')?></th>
</tr>
</table>

View file

@ -1,70 +0,0 @@
<br>
<table width=519><tr><td class=c colspan=11><?php echo $this->getData('Configure_laws')?></td></tr>
<?php echo $this->getData('list')?>
</table>
<br>
<form action="alliance.php?mode=admin&edit=rights&add=name" method=POST>
<table width=519>
<tr>
<td class=c colspan=2><?php echo $this->getData('Range_make')?></td>
</tr>
<tr>
<th><?php echo $this->getData('Range_name')?></th>
<th><input type=text name="newrangname" size=20 maxlength=30></th>
</tr>
<tr>
<th colspan=2><input type=submit value="<?php echo $this->getData('Make')?>"></th>
</tr>
</form>
</table>
<form action="alliance.php?mode=admin&edit=rights" method=POST>
<table width=519>
<tr>
<td class=c colspan=2><?php echo $this->getData('Law_leyends')?></td>
</tr>
<tr>
<th><img src=images/r1.png></th>
<th><?php echo $this->getData('Alliance_dissolve')?></th>
</tr>
<tr>
<th><img src=images/r2.png></th>
<th><?php echo $this->getData('Expel_users')?></th>
</tr>
<tr>
<th><img src=images/r3.png></th>
<th><?php echo $this->getData('See_the_requests')?></th>
</tr>
<tr>
<th><img src=images/r4.png></th>
<th><?php echo $this->getData('See_the_list_members')?></th>
</tr>
<tr>
<th><img src=images/r5.png></th>
<th><?php echo $this->getData('Check_the_requests')?></th>
</tr>
<tr>
<th><img src=images/r6.png></th>
<th><?php echo $this->getData('Alliance_admin')?></th>
</tr>
<tr>
<th><img src=images/r7.png></th>
<th><?php echo $this->getData('See_the_online_list_member')?></th>
</tr>
<tr>
<th><img src=images/r8.png></th><th><?php echo $this->getData('Make_a_circular_message')?></th>
</tr>
<tr>
<th><img src=images/r9.png></th><th><?php echo $this->getData('Left_hand_text')?></th>
</tr>
<tr>
<td class="c" colspan="2"><a href="alliance.php?mode=admin&edit=ally"><?php echo $this->getData('Return_to_overview')?></a></td>
</tr>
</form>
</table>

View file

@ -1,15 +0,0 @@
<br>
<form action="alliance.php?mode=admin&edit=rights" method=POST>
<tr>
<th></th>
<th><?php echo $this->getData('Range_name')?></th>
<th><img src=images/r1.png></th>
<th><img src=images/r2.png></th>
<th><img src=images/r3.png></th>
<th><img src=images/r4.png></th>
<th><img src=images/r5.png></th>
<th><img src=images/r6.png></th>
<th><img src=images/r7.png></th>
<th><img src=images/r8.png></th>
<th><img src=images/r9.png></th>
</tr>

View file

@ -1,16 +0,0 @@
<br>
<tr>
<th><?php echo $this->getData('delete')?></th>
<th>&nbsp;<?php echo $this->getData('r0')?>&nbsp;</th>
<input type="hidden" name="id[]" value="<?php echo $this->getData('a')?>">
<th><?php echo $this->getData('r1')?></th>
<th><?php echo $this->getData('r2')?></th>
<th><?php echo $this->getData('r3')?></th>
<th><?php echo $this->getData('r4')?></th>
<th><?php echo $this->getData('r5')?></th>
<th><?php echo $this->getData('r6')?></th>
<th><?php echo $this->getData('r7')?></th>
<th><?php echo $this->getData('r8')?></th>
<th><?php echo $this->getData('r9')?></th>
</tr>
<tr>

View file

@ -1,15 +0,0 @@
<center>
<br />
<?php echo $this->getData('BuildListScript')?>
<table width=530>
<?php echo $this->getData('BuildList')?>
<tr>
<th ><?php echo $this->getData('bld_usedcells')?></th>
<th colspan="2" >
<font color="#00FF00"><?php echo $this->getData('planet_field_current')?></font> / <font color="#FF0000"><?php echo $this->getData('planet_field_max')?></font> <?php echo $this->getData('bld_theyare')?> <?php echo $this->getData('field_libre')?> <?php echo $this->getData('bld_cellfree')?>
</th >
</tr>
<?php echo $this->getData('BuildingsList')?>
</table>
<br />
</center>

View file

@ -1,107 +0,0 @@
<script src="scripts/cnt.js" type="text/javascript"></script>
<div id="btc" class="z"></div><script language="JavaScript">
pp = '<?php echo $this->getData('time')?>';
pk = '<?php echo $this->getData('building_id')?>';
pl = '<?php echo $this->getData('id')?>';
ps = 'buildings.php';
t();
</script>
<script type="text/javascript">
v = new Date();
p = 0;
g = <?php echo $this->getData('b_building_queue')?>;
s = 0;
hs = 0;
of = 1;
c = new Array(<?php echo $this->getData('c')?>'');
b = new Array(<?php echo $this->getData('b')?>'');
a = new Array(<?php echo $this->getData('a')?>'');
aa = '<?php echo $this->getData('completed')?>';
function t() {
if ( hs == 0 ) {
xd();
hs = 1;
}
n = new Date();
s = c[p]-g-Math.round((n.getTime()-v.getTime())/1000.);
s = Math.round(s);
m = 0;
h = 0;
if ( s < 0 ) {
a[p]--;
xd();
if ( a[p] <= 0 ) {
p++;
xd();
}
g = 0;
v = new Date();
s = 0;
}
if ( s > 59 ) {
m = Math.floor( s / 60 );
s = s - m * 60;
}
if ( m > 59 ) {
h = Math.floor( m / 60 );
m = m - h * 60;
}
if ( s < 10 ) {
s = "0" + s;
}
if ( m < 10 ) {
m = "0" + m;
}
if (p > b.length - 2) {
document.getElementById("bx").innerHTML=aa ;
} else {
document.getElementById("bx").innerHTML= b[p] + " " + h + ":" + m + ":" + s;
}
window.setTimeout("t();", 200);
}
function xd() {
while (document.Atr.auftr.length > 0) {
document.Atr.auftr.options[document.Atr.auftr.length-1] = null;
}
if ( p > b.length - 2 ) {
document.Atr.auftr.options[document.Atr.auftr.length] = new Option(aa);
}
for (iv = p; iv <= b.length - 2; iv++) {
if ( a[iv] < 2 ) {
ae = " ";
} else {
ae = " ";
}
if ( iv == p ) {
act = " (<?php echo $this->getData('in_working')?>)";
} else {
act = "";
}
document.Atr.auftr.options[document.Atr.auftr.length] = new Option( a[iv] + ae + " \"" + b[iv] + "\"" + act, iv + of );
}
}
window.onload = t;
</script>
<center>
<br>
<form name="Atr" method="get" action="buildings.php">
<input type="hidden" name="mode" value="fleet">
<table width="530">
<tr>
<td class="c" ><?php echo $this->getData('work_todo')?></td>
</tr><tr>
<th ><select name="auftr" size="10"></select></th>
</tr><tr>
<td class="c" ></td>
</tr>
</table>
</form>
<?php echo $this->getData('total_left_time')?>
<?php echo $this->getData('pretty_time_b_hangar')?>
<br>
</center>

View file

@ -1,15 +0,0 @@
<tr>
<td class="l">
<a href="infos.php?gid=<?php echo $this->getData('i')?>">
<img border="0" src="<?php echo $this->getData('dpath')?>gebaeude/<?php echo $this->getData('i')?>.gif" align="top" width="120" height="120">
</a>
</td>
<td class="l">
<a href="infos.php?gid=<?php echo $this->getData('i')?>"><?php echo $this->getData('n')?></a><?php echo $this->getData('nivel')?><br>
<?php echo $this->getData('descriptions')?><br>
<?php echo $this->getData('price')?>
<?php echo $this->getData('time')?>
<?php echo $this->getData('rest_price')?>
</td>
<td class="k"><?php echo $this->getData('click')?></td>
</tr>

View file

@ -1,8 +0,0 @@
<script src="scripts/cnt.js" type="text/javascript"></script>
<div id="btc" class="z"></div><SCRIPT language="JavaScript">
pp='<?php echo $this->getData('time')?>';
pk='<?php echo $this->getData('building_id')?>';
pl='<?php echo $this->getData('id')?>';
ps='buildings.php';
t();
</script>

View file

@ -1,19 +0,0 @@
<center>
<br />
<table align="top">
<tr>
<td>
<form action="buildings.php?mode=defense" method="post">
<table width=530>
<?php echo $this->getData('buildlist')?>
<tr>
<td class="c" colspan=2 align="center"><input type="submit" value="<?php echo $this->getData('Construire')?>"></td>
</tr>
</table>
</form>
</td>
<td valign="top"></td>
</tr>
</table>
<?php echo $this->getData('buildinglist')?>
</center>

View file

@ -1,19 +0,0 @@
<center>
<br />
<table align="top">
<tr>
<td>
<form action="buildings.php?mode=fleet" method="post">
<table width=530>
<?php echo $this->getData('buildlist')?>
<tr>
<td class="c" colspan=2 align="center"><input type="submit" value="<?php echo $this->getData('Construire')?>"></td>
</tr>
</table>
</form>
</td>
<td valign="top"></td>
</tr>
</table>
<?php echo $this->getData('buildinglist')?>
</center>

View file

@ -1,15 +0,0 @@
<center>
<font color="#ff0000"><?php echo $this->getData('noresearch')?></font>
<br />
<table align=top>
<tr>
<td>
<table width=530>
<tr>
<?php echo $this->getData('technolist')?>
</tr>
</table>
</td>
</tr>
</table>
</center>

View file

@ -1,15 +0,0 @@
<tr>
<th class="l">
<a href="infos.php?gid=<?php echo $this->getData('tech_id')?>">
<img border=0 src="<?php echo $this->getData('dpath')?>gebaeude/<?php echo $this->getData('tech_id')?>.gif" align="top" width=120 height=120></a>
</th>
<td class="l">
<a href="infos.php?gid=<?php echo $this->getData('tech_id')?>"><?php echo $this->getData('tech_name')?></a> <?php echo $this->getData('tech_level')?><br><?php echo $this->getData('tech_descr')?><br>
<?php echo $this->getData('tech_price')?>
<?php echo $this->getData('search_time')?>
<?php echo $this->getData('tech_restp')?>
</td>
<th class="l">
<?php echo $this->getData('tech_link')?>
</th>
</tr>

View file

@ -1,23 +0,0 @@
<div id="brp" class="z"></div>
<script type="text/javascript">
v = new Date();
var brp = document.getElementById('brp');
function t(){
n = new Date();
ss = <?php echo $this->getData('tech_time')?>;
s = ss - Math.round( (n.getTime() - v.getTime()) / 1000.);
m = 0;
h = 0;
if ( s < 0 ) {
brp.innerHTML = '<?php echo $this->getData('ready')?><br><a href=buildings.php?mode=research&cp=<?php echo $this->getData('tech_home')?>><?php echo $this->getData('continue')?></a>';
} else {
if ( s > 59 ) { m = Math.floor( s / 60 ); s = s - m * 60; }
if ( m > 59 ) { h = Math.floor( m / 60 ); m = m - h * 60; }
if ( s < 10 ) { s = "0" + s }
if ( m < 10 ) { m = "0" + m }
brp.innerHTML = h + ':' + m + ':' + s + '<br><a href=buildings.php?mode=research&cmd=cancel&tech=<?php echo $this->getData('tech_id')?>><?php echo $this->getData('cancel')?><br><?php echo $this->getData('tech_name')?></a>';
}
window.setTimeout("t();",999);
}
window.onload=t;
</script>

View file

@ -1,39 +0,0 @@
<div>Production Actuelle:
<select id="buildList" size="10"></select>
</div>
<script type="text/javascript">
//<![CDATA[
var date = new Date();
var data = <?php echo $this->getData('data')?>;
var select = document.getElementById('buildList');
setInterval(function(){
var now = new Date();
var datediff = (now.getTime() - date.getTime()) / 1000;
var option = null;
var index = 0;
if (data.length == 0) {
select.parentNode.style.display = 'none';
return;
}
select.length = 0;
for (i in data) {
if (datediff > 0) {
data[i]['actual_qty'] = data[i]['qty'] - Math.floor(datediff / data[i]['speed']);
} else {
data[i]['actual_qty'] = data[i]['qty'];
}
if (data[i]['actual_qty'] <= 0) {
datediff = datediff - (data[i]['speed'] * data[i]['qty']);
delete data[i];
continue;
} else {
datediff = 0;
}
option = new Option(data[i]['label'] + ' (' + data[i]['actual_qty'] + ')', data[i]['speed'], false, true);
select.options[index++] = option;
}
}, 1000);
//]]>
</script>

View file

@ -1,44 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_acc1')?><br>
<?php echo $this->getData('ins_tx_acc2')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_acc_user')?>:</td>
<td><input name="adm_user" size="20" maxlength="20" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_pass')?>:</td>
<td><input name="adm_pass" size="20" maxlength="20" type="password" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_email')?>:</td>
<td><input name="adm_email" size="20" maxlength="40" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_planet')?>:</td>
<td><input name="adm_planet" size="20" maxlength="20" type="text" onKeypress="
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
if (event.which==60 || event.which==62) return false;"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_acc_sex')?>:</td>
<td><select name="adm_sex">
<option value=""><?php echo $this->getData('ins_acc_sex0')?></option>
<option value="M"><?php echo $this->getData('ins_acc_sex1')?></option>
<option value="F"><?php echo $this->getData('ins_acc_sex2')?></option>
</select></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_creat')?>" ></th>
</tr>

View file

@ -1,9 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_done2')?><br>
<?php echo $this->getData('ins_tx_done3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
</tr>

View file

@ -1,28 +0,0 @@
<br><br>
<table width="700">
<tbody><tr>
<td width="120px" class="c" align="left"><font size="2px"><?php echo $this->getData('ins_appname')?></font></td>
<td width="580px" rowspan="2" class="c" align="right"><font size="2px"><?php echo $this->getData('ins_tx_sys')?></font><br /><?php echo $this->getData('ins_tx_state')?> <?php echo $this->getData('ins_state')?></td>
</tr><tr>
<th rowspan="4"><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="124" align="center"><a href="index.php?mode=intro" accesskey="i"><?php echo $this->getData('ins_mnu_intro')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=ins&page=1" accesskey="i"><?php echo $this->getData('ins_mnu_inst')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=goto&page=1" accesskey="b"><?php echo $this->getData('ins_mnu_goto')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=upg" accesskey="u"><?php echo $this->getData('ins_mnu_upgr')?></a></td>
</tr>
<tr>
<td align="center"><a href="index.php?mode=bye" accesskey="b"><?php echo $this->getData('ins_mnu_quit')?></a></td>
</tr>
</table></th>
</tr>
<form action="<?php echo $this->getData('dis_ins_btn')?>" method="post">
<?php echo $this->getData('ins_page')?>
</form>
</table>

View file

@ -1,33 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_inst1')?><br>
<?php echo $this->getData('ins_tx_inst2')?><br>
<?php echo $this->getData('ins_tx_inst3')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_form_server')?>:</td>
<td><input type="text" name="host" value="localhost" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_db')?>:</td>
<td><input type="text" name="db" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
<td><input type="text" name="prefix" value="game_" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_login')?>:</td>
<td><input type="text" name="user" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_pass')?>:</td>
<td><input type="password" name="passwort" value="" size="20"></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
</tr>

View file

@ -1,8 +0,0 @@
<tr>
<th colspan="2">
<br><br><?php echo $this->getData('ins_tx_done1')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,9 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_done4')?><br>
<?php echo $this->getData('ins_tx_done3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
</tr>

View file

@ -1,33 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_inst1')?><br>
<?php echo $this->getData('ins_tx_goto4')?><br>
<?php echo $this->getData('ins_tx_goto5')?><br><br>
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php echo $this->getData('ins_form_server')?>:</td>
<td><input type="text" name="host" value="localhost" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_db')?>:</td>
<td><input type="text" name="db" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
<td><input type="text" name="prefix" value="game_" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_login')?>:</td>
<td><input type="text" name="user" value="" size="20"></td>
</tr>
<tr>
<td><?php echo $this->getData('ins_form_pass')?>:</td>
<td><input type="password" name="passwort" value="" size="20"></td>
</tr>
</table>
<br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
</tr>

View file

@ -1,10 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_goto1')?><br>
<?php echo $this->getData('ins_tx_goto2')?><br>
<?php echo $this->getData('ins_tx_goto3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,11 +0,0 @@
<tr>
<th colspan="2">
<br><?php echo $this->getData('ins_tx_welco')?><br>
<?php echo $this->getData('ins_tx_intr1')?><br>
<?php echo $this->getData('ins_tx_intr2')?><br>
<?php echo $this->getData('ins_tx_intr3')?><br><br>
</th>
</tr>
<tr>
<th colspan="2"><input type="button" name="next" onclick="self.location.href='index.php?mode=ins&page=1'" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
</tr>

View file

@ -1,97 +0,0 @@
<div id='leftmenu'>
<script language="JavaScript">
function f(target_url,win_name) {
var new_win = window.open(target_url,win_name,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,width=550,height=280,top=0,left=0');
new_win.focus();
}
</script>
<body class="style" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<center>
<div id='menu'>
<br>
<table width="130" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" style="border-top: 1px #545454 solid"><div><center><?php echo $this->getData('servername')?><br>(<a href="changelog.php" target=<?php echo $this->getData('mf')?>><font color=red><?php echo $this->getData('XNovaRelease')?></font></a>)<center></div></td>
</tr><tr>
<td colspan="2" background="<?php echo $this->getData('dpath')?>img/bg1.gif"><center><?php echo $this->getData('devlp')?></center></td>
</tr><tr>
<td colspan="2"><div><a href="overview.php" accesskey="g" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Overview')?></a></div></td>
</tr><tr>
<td height="1px" colspan="2" style="background-color:#FFFFFF"></td>
</tr><tr>
<td colspan="2"><div><a href="buildings.php" accesskey="b" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Buildings')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="buildings.php?mode=research" accesskey="r" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Research')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="buildings.php?mode=fleet" accesskey="f" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Shipyard')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="buildings.php?mode=defense" accesskey="d" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Defense')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="officier.php" accesskey="o" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Officiers')?></a></div></td>
</tr><tr>
<?php echo $this->getData('marchand_link')?>
</tr><tr>
<td colspan="2" background="<?php echo $this->getData('dpath')?>img/bg1.gif"><center><?php echo $this->getData('navig')?></center></td>
</tr><tr>
<td colspan="2"><div><a href="alliance.php" accesskey="a" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Alliance')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="fleet.php" accesskey="t" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Fleet')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="messages.php" accesskey="c" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Messages')?></a></div></td>
</tr><tr>
<td colspan="2" background="<?php echo $this->getData('dpath')?>img/bg1.gif"><center><?php echo $this->getData('observ')?></center></td>
</tr><tr>
<td colspan="2"><div><a href="galaxy.php?mode=0" accesskey="s" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Galaxy')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="imperium.php" accesskey="i" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Imperium')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="resources.php" accesskey="r" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Resources')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="techtree.php" accesskey="g" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Technology')?></a></div></td>
</tr><tr>
<td height="1px" colspan="2" style="background-color:#FFFFFF"></td>
</tr><tr>
<td colspan="2"><div><a href="records.php" accesskey="3" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Records')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="stat.php?range=<?php echo $this->getData('user_rank')?>" accesskey="k" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Statistics')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="search.php" accesskey="b" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Search')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="banned.php" accesskey="3" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('blocked')?></a></div></td>
</tr><?php echo $this->getData('announce_link')?><tr>
<td colspan="2" background="<?php echo $this->getData('dpath')?>img/bg1.gif"><center><?php echo $this->getData('commun')?></center></td>
</tr><tr>
<td colspan="2"><div><a href="#" onClick="f('buddy.php', '');" accesskey="c"><?php echo $this->getData('Buddylist')?></a></div></td>
</tr></tr><?php echo $this->getData('notes_link')?><tr><tr>
<td colspan="2"><div><a href="chat.php" accesskey="a" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Chat')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="<?php echo $this->getData('forum_url')?>" accesskey="1" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Board')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="add_declare.php" accesskey="1" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('multi')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="rules.php" accesskey="c" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Rules')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="contact.php" accesskey="3" target="<?php echo $this->getData('mf')?>" ><?php echo $this->getData('Contact')?></a></div></td>
</tr><tr>
<td colspan="2"><div><a href="options.php" accesskey="o" target="<?php echo $this->getData('mf')?>"><?php echo $this->getData('Options')?></a></div></td>
</tr>
<?php echo $this->getData('ADMIN_LINK')?>
<tr>
</tr>
<?php echo $this->getData('added_link')?>
<tr>
<td colspan="2"><div><a href="javascript:top.location.href='logout.php'" accesskey="s" style="color:red"><?php echo $this->getData('Logout')?></a></div></td>
</tr><tr>
<td colspan="2" background="<?php echo $this->getData('dpath')?>img/bg1.gif"><center><?php echo $this->getData('infog')?></center></td>
</tr>
<?php echo $this->getData('server_info')?>
</table>
</div>
</center>
</body>
</div>

View file

@ -1,21 +0,0 @@
<?php $fleet = $this->getData('fleet')?>
<?php $user = $this->getData('user')?>
<tr class="<?php echo $this->getData('class')?>">
<?php echo $this->getData('fleet_javai')?>
<td>
<div class="z">-</div>
<font color="lime"><?php echo $fleet->getArrivalTime()?></font>
</td>
<td colspan="3">
<?php if (!$fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_TRANSPORT) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_DESTROY) || $fleet->isMission(Legacies_Empire::ID_MISSION_MISSILES) || $fleet->isMission(Legacies_Empire::ID_MISSION_SPY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d', $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getUser()->getUsername(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php else:?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php endif?>
</td>
<?php echo $this->getData('fleet_javas')?>
</tr>

View file

@ -1,10 +0,0 @@
<form name="rename-planet" id="overview:rename-planet" method="post" action="">
<fieldset>
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:rename-planet:password" type="password" name="password" />
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
<input id="overview:rename-planet:name" type="text" name="name" />
<input type="submit" />
</fieldset>
</form>

View file

@ -1,10 +0,0 @@
<th>
<h1><?php echo $this->escape($this['planet']->getData('name'))?></h1>
<p><a href="<?php echo $this->getUrl('overview.php', array('cp' => $this['planet']->getId()))?>" title="<?php echo $this->escape($this['planet']->getData('name'))?>">
<img src="<?php echo $this->getUrl('planeten/small/s_' . $this['planet']->getData('image') . '.jpg')?>" height="50" width="50" />
</a></p>
<?php if ($this['queue']->count() > 0):?>
<p><?php echo $this->escape($this['queue_item']->getData('building_id'))?></p>
<?php else:?>
<p><?php echo $this->__('Idle.')?></p>
<?php endif?>

View file

@ -1 +0,0 @@
<?php echo $this->planetList->render() ?>

View file

@ -1,4 +0,0 @@
<div class="buildings item-list">
<h1><?php echo $this->__('Buildings')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
</div>

View file

@ -1,27 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getLevel())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), true))?>
</div>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId()))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
</div>

View file

@ -1,8 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -1,4 +0,0 @@
<div class="shipyard item-list">
<h1><?php echo $this->__('Research Laboratory')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
</div>

View file

@ -1,27 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getLevel())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId(), 'mode' => 'research'))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
</div>

View file

@ -1,8 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -1,20 +0,0 @@
<div class="shipyard item-list">
<h1><?php echo $this->__('Shipyard')?></h1>
<form action="<?php echo $this->getUrl('buildings.php', array('mode' => 'fleets'))?>" method="post">
<dl>
<?php echo $this->getPartial('item-list.items')->render()?>
</dl>
<input type="submit" value="<?php echo $this->__('Build')?>">
</form>
<script type="text/javascript">
/*<![CDATA[*/
(function($){
$(document).ready(function(){
$('.shipyard .buy .max').click(function(){
$('#' + this.rel).val($('#' + this.rel + ':max').val());
});
});
})(jQuery);
/*]]>*/
</script>
</div>

View file

@ -1,29 +0,0 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getQty())?>)</h2>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForQty(1) as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
<div class="buy">
<p><input type="text" name="ship[<?php echo $this->getItemId()?>]" id="ship:<?php echo $this->getItemId()?>" /></p>
<input type="hidden" id="ship:<?php echo $this->getItemId()?>:max" value="<?php echo $this->escape($this->getMaximumBuildableElementsCount())?>" />
<p><a class="max" rel="ship:<?php echo $this->getItemId()?>"><?php echo $this->__('Max (%s)', $this->renderNumber($this->getMaximumBuildableElementsCount()))?></a></p>
</div>
</div>

View file

@ -1,69 +0,0 @@
<div class="planet-carrousel">
<div class="arrow left">&#8678;</div>
<div class="items">
<?php foreach ($this->getPlanetCollection() as $planet):?>
<div class="planet item">
<?php if ($planet->getId() != $this->getCurrentPlanet()->getId()):?>
<a href="<?php echo $this->getUrl('', array('cp' => $planet->getId()))?>"><?php echo $this->escape($planet->getName())?> [<?php echo $this->escape($planet->getCoords())?>]</a>
<?php else:?>
<?php echo $this->escape($planet->getName())?> [<?php echo $this->escape($planet->getCoords())?>]
<?php endif?>
</div>
<?php endforeach?>
</div>
<div class="arrow right">&#8680;</div>
</div>
<div class="resources-display">
<div class="resource metal">
<img src="<?php echo $this->getSkinUrl('graphics/images/metall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Metal')?>" title="<?php echo $this->__('Metal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?>
<?php endif?>
</p>
</div>
<div class="resource cristal">
<img src="<?php echo $this->getSkinUrl('graphics/images/kristall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Cristal')?>" title="<?php echo $this->__('Cristal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?>
<?php endif?>
</p>
</div>
<div class="resource deuterium">
<img src="<?php echo $this->getSkinUrl('graphics/images/deuterium.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Deuterium')?>" title="<?php echo $this->__('Deuterium')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?>
<?php endif?>
</p>
</div>
<div class="resource energy">
<img src="<?php echo $this->getSkinUrl('graphics/images/energie.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Energy')?>" title="<?php echo $this->__('Energy')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?>
<span class="resource-capped"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?>
<?php endif?>
</p>
</div>
<div class="messages">
<img src="<?php echo $this->getSkinUrl('graphics/images/message.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Messages')?>" title="<?php echo $this->__('Messages')?>" />
<p>
<?php if (($count = $this->getCurrentUser()->getNewMessagesCount()) > 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have %1$d new messages.', $count)?>"><?php echo $this->__('%1$d messages.', $count)?></a>
<?php elseif ($count == 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have 1 new message.')?>"><?php echo $this->__('1 message.')?></a>
<?php else:?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have no new message.')?>"><?php echo $this->__('No message.')?></a>
<?php endif?>
</p>
</div>
</div>

View file

@ -1,5 +0,0 @@
<div class="navigation">
<?php foreach ($this->getAllPartials() as $partial):?>
<?php echo $partial->render()?>
<?php endforeach?>
</div>

View file

@ -1 +0,0 @@
<span class="<?php echo $this->escape($this->renderClasses())?>"><a href="<?php echo $this->escape($this->getLinkUrl())?>"><?php echo $this->escape($link->getLabel())?></a></span>

View file

@ -1,5 +0,0 @@
<div class="navigation-node">
<?php foreach ($this->getAllPartials() as $partial):?>
<?php echo $partial->render()?>
<?php endforeach?>
</div>

View file

@ -1,54 +0,0 @@
<div id="main">
<div id="login">
<div id="login_input">
<form name="formular" action="" method="post" onsubmit="changeAction('login');">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top;">
<td style="padding-right: 4px;">
<?php echo $this->__('Username')?> <input name="username" value="" type="text">
<?php echo $this->__('Password')?> <input name="password" value="" type="password">
</td>
</tr><tr>
<td style="padding-right: 4px;">
<?php echo $this->__('Remember me')?> <input name="rememberme" type="checkbox">
<input name="submit" value="<?php echo $this->__('Log in!')?>" type="submit">
</td>
</tr><tr>
<td style="padding-right: 4px;">
<a href="lostpassword.php"><?php echo $this->__('I have lost my password.')?></a>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div id="mainmenu" style="margin-top: 20px;">
<a href="reg.php"><?php echo $this->__('Register')?></a>
<a href="<?php echo $this->getData('board_url')?>"><?php echo $this->__('Boards')?></a>
<a href="contact.php"><?php echo $this->__('Contact')?></a>
</div>
<div id="rightmenu" class="rightmenu">
<div id="title"><?php echo $this->__('Welcome on %s!', $this->escape($this->getData('server_name')))?></div>
<div id="content">
<center>
<div id="text1">
<div style="text-align: left;"><?php echo $this->__('<strong>%1$s</strong> make you an emperor. Conquer outer space and master other players on <strong>%1$s</strong>.', $this->getData('server_name'))?></div>
</div>
<div id="register" class="bigbutton" onclick="document.location.href='reg.php';"><font color="#cc0000"><?php echo $this->__('Register now!')?></font></div>
<div id="text2">
<div id="text3">
<center>
<b>
<font color="#00cc00"><?php echo $this->__('Player count: ')?></font><font color="#c6c7c6"><?php echo $this->getData('user_count')?></font> -
<font color="#00cc00"><?php echo $this->__('Latest player: ')?></font><font color="#c6c7c6"><?php echo $this->getData('latest_player')?></font> -
<font color="#00cc00"><?php echo $this->__('Online players: ')?></font> <font color="#c6c7c6"><?php echo $this->getData('online_players')?></font>
</b>
</center>
</div>
</div>
</center>
</div>
</div>
</div>

View file

@ -1,33 +0,0 @@
<?php return array(
'login.failure' => array(),
'login.success' => array(),
'logout.success' => array(),
'register.before' => array(),
'register.failure' => array(),
'register.success' => array(
array('Wootook_Empire_Model_Planet', 'registrationListener')
),
'planet.update' => array(
array('Wootook_Empire_Model_Planet', 'planetUpdateListener'),
array('Legacies_Empire_Model_Planet_Building_Shipyard', 'planetUpdateListener')
),
'user.init' => array(
array('Wootook_Empire_Model_Planet', 'registrationListener')
),
'planet.init' => array(
array('Legacies_Empire_Model_Galaxy_Position', 'initPlanetListerner')
),
'planet.shipyard.check-availability' => array(),
'planet.shipyard.update-queue.before' => array(),
'planet.shipyard.update-queue.after' => array(),
'planet.shipyard.append-queue.before' => array(),
'planet.shipyard.append-queue.after' => array(),
'planet.building.building-time' => array(
array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'),
array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener')
),
'planet.shipyard.building-time' => array(
array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'),
array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener')
)
);

View file

@ -1,9 +0,0 @@
<?php return array(
'block' => array(
'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'),
'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block'),
'legacies_core' => array('Legacies_Core_Block_' => 'Legacies/Core/Block'),
'legacies_empire' => array('Legacies_Empire_Block_' => 'Legacies/Empire/Block'),
'legacies_officers' => array('Legacies_Officers_Block_' => 'Legacies/Officers/Block')
)
);

View file

@ -1,71 +0,0 @@
<?php return array(
//
// Buildings production
// {{{
Legacies_Empire::ID_BUILDING_METAL_MINE => array(
Legacies_Empire::RESOURCE_METAL => 40,
Legacies_Empire::RESOURCE_CRISTAL => 10,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_MetalMine'
),
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array(
Legacies_Empire::RESOURCE_METAL => 30,
Legacies_Empire::RESOURCE_CRISTAL => 15,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.6,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_CristalMine'
),
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array(
Legacies_Empire::RESOURCE_METAL => 150,
Legacies_Empire::RESOURCE_CRISTAL => 50,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser'
),
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array(
Legacies_Empire::RESOURCE_METAL => 50,
Legacies_Empire::RESOURCE_CRISTAL => 20,
Legacies_Empire::RESOURCE_DEUTERIUM => 0,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_SolarPlant'
),
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array(
Legacies_Empire::RESOURCE_METAL => 500,
Legacies_Empire::RESOURCE_CRISTAL => 200,
Legacies_Empire::RESOURCE_DEUTERIUM => 100,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 1.8,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_FusionReactor'
),
// }}}
//
// Ships production
// {{{
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array(
Legacies_Empire::RESOURCE_METAL => 0,
Legacies_Empire::RESOURCE_CRISTAL => 2000,
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite'
),
Legacies_Empire::ID_SHIP_SUPERNOVA => array(
Legacies_Empire::RESOURCE_METAL => 0,
Legacies_Empire::RESOURCE_CRISTAL => 2000,
Legacies_Empire::RESOURCE_DEUTERIUM => 500,
Legacies_Empire::RESOURCE_ENERGY => 0,
Legacies_Empire::RESOURCE_MULTIPLIER => 0.5,
Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_Supernova'
)
// }}}
);

View file

@ -1,265 +0,0 @@
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* 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.
*
*/
/**
* Main application script execution class
*
* @param string responder
* @param int messageOffset
*/
function Legacies_Client(responder, messageOffset) {
if (!document.querySelectorAll) {
alert("Your browser is not compatible with CSS selectors API.\n\nCould not continue.");
return;
}
this.responder = responder;
this.messages = [];
this.messageId = messageOffset || 1;
this.callbacks = {};
this.recurrentMessages = [];
this.send = (function() {
if (this.messages.length == 0) {
return this;
}
var request = new XMLHttpRequest();
request.open('POST', this.responder, false);
request.send(JSON.stringify(this.messages));
this.messages = [];
for (var i in this.recurrentMessages) {
this.enqueue(this.recurrentMessages[i].action, this.recurrentMessages[i].params, this.recurrentMessages[i].callback);
}
if(request.status == 404) {
alert('Request failed, responder not found.');
return this;
}
try {
var response = JSON.parse(request.responseText);
} catch (e) {
alert('Invalid response.');
return this;
}
if(request.status == 200) {
for (var i in response) {
this._callback(response[i]);
}
}
return this;
}).bind(this);
this.main = (function(interval) {
setInterval(this.send, interval || 30000);
}).bind(this);
this.enqueue = (function(action, params){
this.messages.push({'uid':this.messageId++,'action':action,'params':params});
return this;
}).bind(this);
this.enqueueRecurrent = (function(action, params, callback) {
this.recurrentMessages.push({'callback':callback,'action':action,'params':params});
this.enqueue(action, params, callback);
}).bind(this);
this._callback = (function(message){
if (message.error === undefined || message.payload === undefined) {
return this;
}
if (message.error === true) {
if (typeof(message.payload.messages) == 'string') {
alert(message.payload.messages);
} else {
var info = '';
for (var i in message.payload.messages) {
info = info + "\n[" + i + "]:\n" + message.payload.messages[i].join("\n") + "\n";
}
alert("Errors were returned:\n" + info);
}
return this;
}
if (message.callback && this.CallbackType[message.callback]) {
(this.CallbackType[message.callback]).bind(this)(message.payload);
}
return this;
}).bind(this);
this.login = (function(username, password, rememberme) {
var params = {
'username': username,
'password': password,
'rememberme': rememberme || false
};
this.enqueue('user.account.login', params).send();
return this;
}).bind(this);
this.logout = (function() {
this.enqueue('user.account.logout', {}).send();
return this;
}).bind(this);
this.form = (function(event) {
event.preventDefault();
var form = event.target;
var params = {};
for (var i = 0; i < form.length; i++) {
if (!form[i].name || !form[i].type) {
continue;
}
if (form[i].type == 'checkbox') {
if (form[i].checked) {
params[form[i].name] = true;
} else {
params[form[i].name] = false;
}
} else if (form[i].type == 'radio') {
params[form[i].name] = form[i].value;
} else if (form[i].value !== undefined) {
params[form[i].name] = form[i].value;
}
}
var action = form.action.slice(form.action.indexOf('#') + 1);
this.enqueue(action, params, this.CallbackType.updater).send();
}).bind(this);
this.CallbackType = {
redirector: function(payload) {
if (payload.redirect) {
document.location.href = payload.redirect;
}
},
updater: function(payload) {
if (payload.html && payload.selector) {
var parent = $$(payload.selector);
var handler = document.createElement("div");
handler.innerHTML = payload.html;
var fragment = document.createDocumentFragment();
for (var i = 0; i < handler.childNodes.length; i++) {
fragment.appendChild(handler.childNodes[i]);
}
for (var i = 0; i < parent.length; i++) {
parent[i].appendChild(fragment.cloneNode(true));
}
}
},
script: function(payload) {
if (payload.script) {
eval(payload.script);
}
},
error: function(payload) {
if (payload.messages) {
alert(payload.messages.join(', '));
}
},
show: function(payload) {
if (payload.selector) {
var elementList = $$(payload.selector);
for (var i = 0; i < elementList.length; i++) {
elementList[i].style.display = 'block';
}
}
},
hide: function(payload) {
if (payload.selector) {
var elementList = $$(payload.selector);
for (var i = 0; i < elementList.length; i++) {
elementList[i].style.display = 'none';
}
}
},
callback: function(payload) {
if (payload.callback) {
payload.callback.apply(this, payload.params);
}
},
enqueueRecurrent: function(payload) {
if (payload.action && payload.params && payload.callback) {
this.enqueueRecurrent(payload.action, payload.params, payload.callback);
}
}
};
}
function Legacies_Element(object) {
object.listen = (function(event, callback) {
this.addEventListener(event, callback, false);
return this;
}).bind(object);
return object;
}
function Legacies_List(object) {
object.listen = (function(event, callback) {
for (var i in this) {
Legacies_Element(Legacies_Element[i]);
this[i].listen(event, callback);
}
return this;
}).bind(object);
return object;
}
function $A(object) {
return Array.prototype.slice.call(object);
}
function $(element) {
if (typeof(element) == 'string') {
element = document.getElementById(element);
}
Legacies_Element(element);
return element;
}
function $$(selector, context) {
context = context || document;
var nodeList = context.querySelectorAll(selector);
Legacies_List(nodeList);
return nodeList;
}
function $E(element, methods) {
for (var i in methods) {
if (methods[i] === undefined) {
continue;
}
element[i] = function(){
var args = $A(arguments);
args.unshift(element);
methods[i].apply(element, args);
}
element[i].bind(element);
}
return element;
}

File diff suppressed because it is too large Load diff

View file

@ -1,163 +0,0 @@
<?php
include './bootstrap.php';
if (!extension_loaded('xdebug')) {
header('Content-Type: text/plain');
}
$user = new Legacies_Empire_Model_User(array(
'rpg_stockeur' => 0,
'b_laboratory' => 0,
'b_laboratory_id' => serialize(array()),
"spy_tech" => 12,
"computer_tech" => 8,
"military_tech" => 10,
"defence_tech" => 10,
"shield_tech" => 10,
"energy_tech" => 8,
"hyperspace_tech" => 8,
"combustion_tech" => 6,
"impulse_motor_tech" => 6,
"hyperspace_motor_tech" => 6,
"laser_tech" => 6,
"ionic_tech" => 6,
"buster_tech" => 6,
"intergalactic_tech" => 0,
"expedition_tech" => 0,
"graviton_tech" => 0,
));
$data = array(
'last_update' => 0,
'planet_type' => 1,
'b_building_id' => '',
'b_hangar_id' => serialize(array(/*array(
'ship_id' => Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT,
'qty' => 10,
'created_at' => 0,
'updated_at' => 0
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 20,
'created_at' => 600,
'updated_at' => 600
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 30,
'created_at' => 650,
'updated_at' => 650
), array(
'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT,
'qty' => 40,
'created_at' => 700,
'updated_at' => 700
)*/)),
'metal' => 500000,
'metal_perhour' => 20,
'cristal' => 500000,
'cristal_perhour' => 10,
'deuterium' => 300000,
'deuterium_perhour' => 0,
'energy_max' => 0,
'energy_used' => 0,
'metal_mine_porcent' => 10,
'cristal_mine_porcent' => 10,
'solar_plant_porcent' => 10,
'fusion_plant_porcent' => 10,
'solar_satelit_porcent' => 10,
'deuterium_sintetizer_porcent' => 10,
'metal_mine' => 20,
'cristal_mine' => 19,
'deuterium_sintetizer' => 0,
'solar_plant' => 20,
'fusion_plant' => 0,
'robot_factory' => 0,
'nano_factory' => 0,
'hangar' => 12,
'metal_store' => 10,
'cristal_store' => 10,
'deuterium_store' => 10,
'rpg_stockeur' => 0
);
$planet = new Legacies_Empire_Model_Planet($data);
$planet->setUser($user);
//var_dump(array('$planet->setUser($user)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->updateStorages(0);
//var_dump(array('$planet->updateStorages(0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->updateResourceProduction(0);
//var_dump(array('$planet->updateResourceProduction(0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0);
//var_dump(array('$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0);
//var_dump(array('$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0)', array_diff($planet->getAllDatas(), $data)));
$data = $planet->getAllDatas();
$userData = $user->getAllDatas();
$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0);
var_dump(array('$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0)', array_diff($planet->getAllDatas(), $data), array_diff($user->getAllDatas(), $userData)));
$data = $planet->getAllDatas();
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => 5400
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 20)
));
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 3600);
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 30)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 5000)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0);
$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_SOLAR_PLANT, false, 0);
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => (3600 * 10000)
));
var_dump(array_diff($planet->getAllDatas(), $data));
$data = $planet->getAllDatas();

View file

@ -1,46 +0,0 @@
<?php
//define('BCNUMBERS', true);
if (!defined('DEBUG') && in_array(strtolower(getenv('DEBUG')), array('1', 'on', 'true'))) {
define('DEBUG', true);
}
if (!defined('DEBUG')) {
@ini_set('display_errors', false);
} else {
@ini_set('display_errors', true);
@error_reporting(E_ALL | E_STRICT);
}
defined('ROOT_PATH') || define('ROOT_PATH', dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR);
defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
defined('PHPEXT') || define('PHPEXT', require ROOT_PATH . 'extension.inc');
defined('VERSION') || define('VERSION', '2009.5');
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
get_include_path()
)));
function __autoload($class) {
include_once str_replace('_', '/', $class) . '.php';
}
if (0 === filesize(ROOT_PATH . 'config.php')) {
header('Location: install/');
die();
}
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
foreach ($listenerList as $listener) {
Wootook::registerListener($event, $listener);
}
}
include ROOT_PATH . 'includes/constants.php';

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