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>
This commit is contained in:
Gregory PLANCHAT 2011-11-08 08:56:53 +01:00
commit 9636b4bb00
69 changed files with 2434 additions and 789 deletions

View file

@ -33,18 +33,18 @@ 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/fleets');
$PageTPL = gettemplate('admin/fleet_body');
include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT);
$parse = $lang;
$parse['flt_table'] = BuildFlyingFleetTable ();
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
includeLang('admin/fleets');
$PageTPL = gettemplate('admin/fleet_body');
$page = parsetemplate( $PageTPL, $parse );
display ( $page, $lang['flt_title'], false, '', true);
$parse = $lang;
$parse['flt_table'] = BuildFlyingFleetTable ();
} else {
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}
$page = parsetemplate( $PageTPL, $parse );
display ( $page, $lang['flt_title'], false, '', true);
?>
} else {
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}

View file

@ -36,13 +36,13 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
includeLang('leftmenu');
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
$parse = $lang;
$parse['mf'] = "Hauptframe";
$parse['dpath'] = $dpath;
$parse = $lang;
$parse['mf'] = "Hauptframe";
$parse['dpath'] = $dpath;
$parse['WootookRelease'] = VERSION;
$parse['servername'] = Wootook;
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
display( $Page, "", false, '', true);
$parse['servername'] = 'Wootook';
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
display($Page, "", false, '', true);
} else {
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
}

View file

@ -28,10 +28,6 @@
*
*/
defined('BCNUMBERS') || define('BCNUMBERS', true);
defined('DEPRECATION') || define('DEPRECATION', true);
defined('DEBUG') || define('DEBUG', true);
if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
define('DEBUG', true);
} else if (!defined('DEBUG') && isset($_SERVER['DEBUG']) && in_array(strtolower($_SERVER['DEBUG']), array('1', 'on', 'true'))) {
@ -62,7 +58,7 @@ defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DI
defined('PHPEXT') || define('PHPEXT', 'php');
defined('VERSION') || define('VERSION', '2011.1');
defined('VERSION') || define('VERSION', '1.5.0-beta2');
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
@ -80,7 +76,8 @@ Wootook_Core_Time::init();
Wootook_Core_ErrorProfiler::register();
Wootook_Core_Model_Config_Events::registerEvents();
if (0 === filesize(ROOT_PATH . 'config.php')) {
if (!defined('IN_INSTALL') && 0 === filesize(ROOT_PATH . 'config.php')) {
header('HTTP/1.1 307 Temporary Redirect');
header('Location: install/');
die();
}
@ -100,43 +97,46 @@ include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
$gameConfig = Wootook_Core_Model_Config::getSingleton();
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
}
$user = Wootook_Empire_Model_User::getSingleton();
if (!defined('IN_INSTALL')) {
if (!defined('DISABLE_IDENTITY_CHECK')) {
if (($user === null || !$user->getId())) {
header('Location: login.php');
exit(0);
$gameConfig = Wootook_Core_Model_Config::getSingleton();
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
}
$user = Wootook_Empire_Model_User::getSingleton();
if (!defined('DISABLE_IDENTITY_CHECK')) {
if (($user === null || !$user->getId())) {
header('Location: login.php');
exit(0);
}
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
exit(0);
}
}
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
exit(0);
includeLang('system');
includeLang('tech');
if (($user !== null && $user->getId())) {
if (isset($_GET['cp']) && !empty($_GET['cp'])) {
$user->updateCurrentPlanet((int) $_GET['cp']);
}
$planet = $user->getCurrentPlanet();
foreach ($user->getPlanetCollection() as $userPlanet) {
FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model
}
/*
* Update planet resources and constructions
*/
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet
));
$planet->save();
}
}
includeLang('system');
includeLang('tech');
if (($user !== null && $user->getId())) {
if (isset($_GET['cp']) && !empty($_GET['cp'])) {
$user->updateCurrentPlanet((int) $_GET['cp']);
}
$planet = $user->getCurrentPlanet();
foreach ($user->getPlanetCollection() as $userPlanet) {
FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model
}
/*
* Update planet resources and constructions
*/
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet
));
$planet->save();
}

View file

@ -197,7 +197,7 @@ class Wootook
return self::$_defaultLocale;
}
public function getPreferredLocale($availableLocales = array())
public static function getPreferredLocale($availableLocales = array())
{
if (empty($availableLocales)) {
return self::getDefaultLocale();
@ -255,6 +255,9 @@ class Wootook
return self::$_now;
}
/**
* @return Wootook_Core_Controller_Request_Http
*/
public static function getRequest()
{
if (self::$_request === null) {
@ -268,6 +271,9 @@ class Wootook
self::$_request = $request;
}
/**
* @return Wootook_Core_Controller_Response_Http
*/
public static function getResponse()
{
if (self::$_response === null) {
@ -281,11 +287,20 @@ class Wootook
self::$_response = $response;
}
public static function getConfig($path = null)
private static function _loadConfig()
{
if (self::$_config === null) {
self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
if (!is_array(self::$_config)) {
self::$_config = array();
}
}
}
public static function getConfig($path = null)
{
self::_loadConfig();
if ($path === null || !is_string($path)) {
return self::$_config;
@ -300,6 +315,25 @@ class Wootook
return $config;
}
public static function setConfig($path = null, $value)
{
self::_loadConfig();
if ($path === null || !is_string($path)) {
return self::$_config;
}
$config = &self::$_config;
foreach (explode('/', $path) as $chunk) {
if (!isset($config[$chunk])) {
$config[$chunk] = array();
}
$config = &$config[$chunk];
}
$config = $value;
return true;
}
public static function getBaseUrl()
{
return self::getConfig('global/web/base_url');
@ -333,10 +367,13 @@ class Wootook
return false;
}
Wootook_Core_ErrorProfiler::sleep();
if (($fp = @fopen($path, 'r', true)) === false) {
Wootook_Core_ErrorProfiler::wakeup();
return false;
}
fclose($fp);
Wootook_Core_ErrorProfiler::wakeup();
return true;
}
}

View file

@ -0,0 +1,43 @@
<?php
class Wootook_Core_Block_Messages
extends Wootook_Core_Block_Template
{
protected $_storages = array();
public function prepareMessages($namespace)
{
$this->_storages[] = $namespace;
}
public function renderGroupedHtml()
{
$messages = array();
foreach ($this->_storages as $namespace) {
$session = Wootook::getSession($namespace);
foreach ($session->getData('messages') as $messageLevel => $messageList) {
if (!isset($messages[$messageLevel])) {
$messages[$messageLevel] = $messageList;
} else {
$messages[$messageLevel] += $messageList;
}
}
}
rsort($messages, SORT_NUMERIC);
$output = '<div class="messages">';
foreach ($messages as $messageLevel => $messageList) {
$output .= "<ul class=\"{$messageLevel}\">";
foreach ($messageList as $message) {
$output .= "<li>{$message}</li>";
}
$output .= '</ul>';
}
$output .= '</div>';
return $output;
}
}

View file

@ -84,6 +84,40 @@ class Wootook_Core_Controller_Request_Http
return $_SERVER[$key];
}
public function getAllQueryData()
{
return $_GET;
}
public function getAllFilesData()
{
return $_FILES;
}
public function getAllCookieData()
{
$data = array();
foreach ($_COOKIE as $key => $value) {
$data[$key] = unserialize(stripslashes($value));
}
return $data;
}
public function getAllRawCookieData()
{
return $_COOKIE;
}
public function getAllPostData()
{
return $_POST;
}
public function getAllServerData()
{
return $_SERVER;
}
public function isPost()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') {
@ -92,6 +126,22 @@ class Wootook_Core_Controller_Request_Http
return false;
}
public function isPut()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'PUT') {
return true;
}
return false;
}
public function isHead()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'HEAD') {
return true;
}
return false;
}
public function isGet()
{
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') {

View file

@ -81,7 +81,7 @@ class Wootook_Core_Controller_Response_Http
return $this;
}
public function setRawHeader($name, $value)
public function setRawHeader($value)
{
if (!isset($this->_data['raw_headers']) || !is_array($this->_data['raw_headers'])) {
$this->clearRawHeaders();

View file

@ -0,0 +1,175 @@
<?php
class Wootook_Core_Form
{
protected $_fields = array();
protected $_request = null;
/**
*
* Field class loader
* @var Wootook_Core_Form_FieldLoader
*/
protected $_fieldLoader = null;
/**
*
* Validator class loader
* @var Wootook_Core_Form_ValidatorLoader
*/
protected $_validatorLoader = null;
/**
*
* Enter description here ...
* @var Wootook_Core_Model_Session
*/
protected $_session = null;
public function __construct(Wootook_Core_Model_Session $session, Array $fields = array())
{
$this->_session = $session;
$this->_fieldLoader = new Wootook_Core_Form_FieldLoader($this, array(
'Wootook_Core_Form_Field_' => 'Wootook/Core/Form/Field'
));
$this->_validatorLoader = new Wootook_Core_Form_ValidatorLoader($this, array(
'Wootook_Core_Form_Validator_' => 'Wootook/Core/Form/Validator'
));
$this->addField('__formkey', 'text', array('form_key' => 'formKey'));
foreach ($fields as $fieldName => $fieldConfig) {
if (is_string($fieldConfig)) {
$this->addField($fieldName, $fieldConfig);
} else if ($fieldConfig instanceof Wootook_Core_Form_FieldAbstract) {
$this->addField($fieldName, $fieldConfig);
} else {
if (isset($fieldConfig['validators'])) {
$this->addField($fieldName, $fieldConfig['type'], $fieldConfig['validators']);
} else {
$this->addField($fieldName, $fieldConfig['type']);
}
}
}
}
public function validate()
{
foreach ($this->_fields as $field) {
$field->validate();
}
}
/**
*
* Enter description here ...
* @param string $name
* @param string|Wootook_Core_Form_FieldAbstract $type
* @return Wootook_Core_Form
*/
public function addField($name, $type = 'text', Array $validators = array())
{
if ($type instanceof Wootook_Core_Form_FieldAbstract) {
$this->_fields[$name] = $name;
$this->_fields[$name]->setForm($this);
} else {
$field = $this->_fieldLoader->load($type);
if ($field === null) {
trigger_error(sprintf('Field %1$s (type: %2$s) could not be created.', $name, $type), E_USER_WARNING);
return $this;
}
$this->_fields[$name] = $field;
}
$this->_fields[$name]->setName($name);
foreach ($validators as $validatorName => $validatorType) {
if ($validatorType instanceof Wootook_Core_Form_FieldAbstract) {
$this->_fields[$name]->addValidator($validatorType, $validatorName);
} else {
$validator = $this->_validatorLoader->load($validatorType);
if ($validator === null) {
trigger_error(sprintf('Validator %1$s (type: %2$s) could not be created.', $validatorName, $validatorType), E_USER_WARNING);
return $this;
}
$this->_fields[$name]->addValidator($validator, $validatorName);
}
}
return $this;
}
/**
*
* Enter description here ...
* @param string $name
* @return Wootook_Core_Form_FieldAbstract
*/
public function getField($name)
{
if (!isset($this->_fields[$name])) {
return null;
}
return $this->_fields[$name];
}
/**
*
* Enter description here ...
* @param string $name
* @return Wootook_Core_Model_Session
*/
public function getSession()
{
return $this->_session;
}
public function setRequest(Wootook_Core_Controller_Request_Http $request)
{
$this->_request = $request;
return $this;
}
/**
*
* Enter description here ...
* @return Wootook_Core_Controller_Request_Http
*/
public function getRequest()
{
return $this->_request;
}
public function getData()
{
$request = $this->getRequest();
if ($request === null) {
return array();
}
if ($request->isPost()) {
return $request->getAllPostData();
}
return $request->getAllQueryData();
}
public function populate(Array $datas = array())
{
$request = $this->getRequest();
foreach ($this->_fields as $fieldName => $field) {
if (isset($datas[$fieldName])) {
$field->populate($datas[$fieldName]);
} else if ($request->isPost()) {
$field->populate($request->getPost($fieldName));
} else {
$field->populate($request->getQuery($fieldName));
}
}
}
}

View file

@ -0,0 +1,11 @@
<?php
class Wootook_Core_Form_Field_Text
extends Wootook_Core_Form_FieldAbstract
{
public function getType()
{
return 'text';
}
}

View file

@ -0,0 +1,104 @@
<?php
abstract class Wootook_Core_Form_FieldAbstract
{
protected $_name = null;
protected $_form = null;
protected $_value = null;
protected $_validators = array();
public function __construct(Wootook_Core_Form $form = null)
{
if ($form !== null) {
$this->setForm($form);
}
}
abstract public function getType();
public function validate()
{
$data = $this->getData();
foreach ($this->_validators as $validator) {
if (!$validator->validate($this, $data)) {
return false;
}
}
return true;
}
public function setName($name)
{
$this->_name = $name;
return $this;
}
public function getName()
{
return $this->_name;
}
public function setForm(Wootook_Core_Form $form)
{
$this->_form = $form;
return $this;
}
public function getForm()
{
return $this->_form;
}
public function getData()
{
return $this->_value;
}
public function populate($value)
{
$this->_value = $value;
return $this;
}
public function addValidator(Wootook_Core_Form_ValidatorAbstract $validator, $name = null)
{
if ($name === null) {
$this->_validators = array();
$name = 'default';
}
$this->_validators[$name] = $validator;
return $this;
}
public function getValidator($name)
{
if (!isset($this->_validators[$name])) {
return null;
}
return $this->_validators[$name];
}
public function clearValidator($name)
{
if (isset($this->_validators[$name])) {
unset($this->_validators[$name]);
}
return $this;
}
public function clearAllValidators()
{
$this->_validators = array();
return $this;
}
}

View file

@ -0,0 +1,36 @@
<?php
class Wootook_Core_Form_FieldLoader
extends Wootook_Core_Plugin_LoaderAbstract
{
protected $_form = null;
public function __construct(Wootook_Core_Form $form, Array $namespaces = array())
{
$this->_form = $form;
foreach ($namespaces as $namespace => $path) {
if (is_int($namespace)) {
$this->registerNamespace($path);
} else {
$this->registerNamespace($namespace, $path);
}
}
}
protected function _load($className, $useSingleton)
{
$reflection = new ReflectionClass($className);
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
$method = $reflection->getMethod('getSingleton');
return $method->invoke(null);
}
try {
return $reflection->newInstance($this->_form);
} catch (ReflectionException $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
return null;
}
}
}

View file

@ -0,0 +1,22 @@
<?php
class Wootook_Core_Form_Validator_Alnum
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#[^[:alnum:]]#');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if ($this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should only contain alphanumeric characters.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,22 @@
<?php
class Wootook_Core_Form_Validator_Alnum
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#[^[:alpha:]]#');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if ($this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should only contain alphabetic characters.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,21 @@
<?php
class Wootook_Core_Form_Validator_Email
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#^[[:alnum:]\._\-]@[[:alnum:]\._\-]\.[a-z]{2,}$#');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if (!$this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should contain an email.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,20 @@
<?php
class Wootook_Core_Form_Validator_FormKey
extends Wootook_Core_Form_ValidatorAbstract
{
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
$form = $field->getForm();
$session = $form->getSession();
if ($session->getFormKey(false) == $data) {
return true;
}
$this->_getSession($field)
->addError('CSRF token failure.', $field->getName());
return false;
}
}

View file

@ -0,0 +1,22 @@
<?php
class Wootook_Core_Form_Validator_Hex
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#(?:0x)?[^0-9a-f]#i');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if ($this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should only contain numeric characters.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,21 @@
<?php
class Wootook_Core_Form_Validator_Email
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#^[[:alnum:]\._\-]\.[a-z]{2,}$#');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if (!$this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should contain a host name.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,22 @@
<?php
class Wootook_Core_Form_Validator_Numeric
extends Wootook_Core_Form_Validator_Regex
{
public function __construct()
{
parent::__construct('#[^[:digit:]]#');
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if ($this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" should only contain numeric characters.', $field->getName());
return false;
}
return true;
}
}

View file

@ -0,0 +1,28 @@
<?php
class Wootook_Core_Form_Validator_Regex
extends Wootook_Core_Form_ValidatorAbstract
{
protected $_expression = null;
public function __construct($expression)
{
$this->_expression = $expression;
}
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
if (!$this->_validate($field, $data)) {
$this->_getSession($field)
->addError('Field "%s" does not match the validation pattern.', $field->getName());
return false;
}
return true;
}
protected function _validate(Wootook_Core_Form_FieldAbstract $field, $data)
{
return preg_match($this->_expression, $data);
}
}

View file

@ -0,0 +1,15 @@
<?php
abstract class Wootook_Core_Form_ValidatorAbstract
{
abstract public function validate(Wootook_Core_Form_FieldAbstract $field, $data);
protected function _getSession(Wootook_Core_Form_FieldAbstract $field)
{
$form = $field->getForm();
if (!$form instanceof Wootook_Core_Form) {
return null;
}
return $form->getSession();
}
}

View file

@ -0,0 +1,36 @@
<?php
class Wootook_Core_Form_ValidatorLoader
extends Wootook_Core_Plugin_LoaderAbstract
{
protected $_form = null;
public function __construct(Wootook_Core_Form $form, Array $namespaces = array())
{
$this->_form = $form;
foreach ($namespaces as $namespace => $path) {
if (is_int($namespace)) {
$this->registerNamespace($path);
} else {
$this->registerNamespace($namespace, $path);
}
}
}
protected function _load($className, $useSingleton)
{
$reflection = new ReflectionClass($className);
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
$method = $reflection->getMethod('getSingleton');
return $method->invoke(null);
}
try {
return $reflection->newInstance();
} catch (ReflectionException $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
return null;
}
}
}

View file

@ -8,6 +8,8 @@ class Wootook_Core_Layout
protected $_blocks = array();
protected $_messageBlock = null;
protected $_view = null;
protected $_eventPrefix = 'layout';
protected $_eventObject = 'layout';
@ -31,19 +33,16 @@ class Wootook_Core_Layout
}
}
$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']);
}
$fileList = Wootook::getConfig('global/layout');
if (!is_array($fileList) || empty($fileList)) {
$fileList = $this->getAllDatas();
} else {
$fileList = array_merge($fileList, $this->getAllDatas());
}
$this->_data = array();
$this->setPackage(Wootook::getConfig('global/package'));
$this->setTheme(Wootook::getConfig('global/theme'));
foreach ($fileList as $layoutFile) {
foreach (include $this->_getLayoutPath($layoutFile) as $layoutId => $layoutConfig) {
@ -57,6 +56,8 @@ class Wootook_Core_Layout
}
}
$this->_messageBlock = $this->createBlock('core/messages', 'messages');
return $this;
}
@ -86,6 +87,9 @@ class Wootook_Core_Layout
$layoutUpdates = array();
$layoutConfig = array();
foreach (array_reverse($layoutConfigs) as $config) {
if (!is_array($config)) {
continue;
}
$layoutConfig = array_merge($layoutConfig, $config);
if (isset($layoutConfig['reference'])) {
@ -374,6 +378,10 @@ class Wootook_Core_Layout
public function render()
{
if (!$this->_view instanceof Wootook_Core_View) {
throw new Wootook_Core_Exception_RuntimeException(Wootook::__('No root view declared.'));
}
$scriptPath = $this->getScriptPath();
foreach ($this->_blocks as $block) {
if ($block instanceof Wootook_Core_Block_Template) {
@ -407,8 +415,17 @@ class Wootook_Core_Layout
return $path;
}
trigger_error(Legacies::__("Layout file '%s' does not exist.", $file), E_USER_NOTICE);
trigger_error(Wootook::__("Layout file '%s' does not exist.", $file), E_USER_NOTICE);
return null;
}
/**
*
* @return Wootook_Core_Block_Messages
*/
public function getMessagesblock()
{
return $this->_messageBlock;
}
}

View file

@ -8,6 +8,13 @@ abstract class Wootook_Core_Model_Config_Abstract
{
$config = Wootook::getConfig('global/storyline');
if ($config === null || empty($config)) {
$config = array(
'universe' => 'default',
'episode' => 'default'
);
}
$path = 'gamedata' . DIRECTORY_SEPARATOR . $config['universe'] . DIRECTORY_SEPARATOR
. $config['episode'] . DIRECTORY_SEPARATOR . $filename . '.php';

View file

@ -128,7 +128,7 @@ class Wootook_Core_Model_Session
return $this->addMessage(vsprintf($message, $args), self::DEBUG);
}
public function getFormKey($reset = false)
public function getFormKey($reset = true)
{
if (!$this->getData('form_key')) {
$this->setData('form_key', uniqid());
@ -136,10 +136,32 @@ class Wootook_Core_Model_Session
}
$key = $this->getData('form_key');
if ($reset == true) {
if ($reset !== true) {
$this->setData('form_key', uniqid());
}
return $key;
}
public function setFormData(Array $data = array())
{
if (isset($data['__formkey'])) {
unset($data['__formkey']);
}
$this->setData('form_data', $data);
return $this;
}
public function getFormData($key = null, $default = null)
{
$data = $this->getData('form_data');
if ($key === null) {
return $data;
} else if (isset($data[$key])) {
return $data[$key];
}
return $default;
}
}

View file

@ -15,7 +15,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
$className = $namespace . ucfirst($pluginName);
$fileName = $path . DIRECTORY_SEPARATOR . ucfirst($pluginName) . '.php';
if (!file_exists($fileName)) {
if (!Wootook::fileExists($fileName)) {
continue;
}
@ -26,7 +26,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
return $this->_load($className, $useSingleton);
}
return $this;
return null;
}
public function registerNamespace($namespace, $path = null)
@ -48,7 +48,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
return $this;
}
abstract protected function _load($className);
abstract protected function _load($className, $useSingleton);
public function getPlugin($pluginName)
{

View file

@ -3,10 +3,14 @@
class Wootook_Core_Time
{
public static function init()
public static function init($timezone = null)
{
$config = include ROOT_PATH . 'config.php';
$timezone = $config['global']['date']['timezone'];
if ($timezone === null) {
$timezone = Wootook::getConfig('global/date/timezone');
}
if ($timezone === null) {
$timezone = 'GMT';
}
date_default_timezone_set($timezone);
}

View file

@ -142,7 +142,16 @@ class Wootook_Core_View
$theme = Wootook_Core_Layout::DEFAULT_THEME;
}
return Wootook::getSkinUrl($package, $theme, $uri, $params);
$pattern = ROOT_PATH . DIRECTORY_SEPARATOR . 'skin/%s/%s/{$uri}';
if (Wootook::fileExists(sprintf($pattern, $package, $theme))) {
return Wootook::getSkinUrl($package, $theme, $uri, $params);
}
if (Wootook::fileExists(sprintf($pattern, $package, Wootook_Core_Layout::DEFAULT_THEME))) {
return Wootook::getSkinUrl($package, Wootook_Core_Layout::DEFAULT_THEME, $uri, $params);
}
return Wootook::getSkinUrl(Wootook_Core_Layout::DEFAULT_PACKAGE, Wootook_Core_Layout::DEFAULT_THEME, $uri, $params);
}
public function setPartial($name, $content)

View file

@ -26,6 +26,11 @@ class Wootook_Empire_Model_Planet
*/
protected $_moon = null;
/**
* @var Wootook_Empire_Model_Planet
*/
protected $_planet = null;
/**
* @var Wootook_Empire_Model_Planet_Builder
*/
@ -175,10 +180,14 @@ class Wootook_Empire_Model_Planet
public function getGalaxyData()
{
$entity = new Wootook_Empire_Model_Galaxy_Position();
$entity->load(array('id_planet' => $this->getId()));
if ($this->isPlanet()) {
$entity = new Wootook_Empire_Model_Galaxy_Position();
$entity->load(array('id_planet' => $this->getId()));
return $entity;
return $entity;
}
return $this->getPlanet()->getGalaxyData();
}
public function updateStorages($time = null)
@ -533,10 +542,62 @@ class Wootook_Empire_Model_Planet
));
$this->_moon = $statement->current();
if ($this->_moon !== null && $this->_moon instanceof self) {
$this->_moon->setPlanet($this);
}
}
return $this->_moon;
}
public function setMoon(Wootook_Empire_Model_Planet $moon)
{
$this->_moon = $moon;
return $this;
}
public function getPlanet()
{
static $statement = null;
if ($this->isPlanet()) {
return null;
}
if ($this->_planet === null) {
if ($statement === null) {
$statement = new Wootook_Core_Collection(array('planet' => 'planets'), get_class($this));
$statement
->where('galaxy=:galaxy')
->where('system=:system')
->where('planet=:position')
->where('planet_type=' . strval(self::TYPE_PLANET))
;
}
$statement->load(array(
'galaxy' => $this->getGalaxy(),
'system' => $this->getSystem(),
'position' => $this->getPosition()
));
$this->_planet = $statement->current();
if ($this->_planet !== null && $this->_planet instanceof self) {
$this->_planet->setMoon($this);
}
}
return $this->_planet;
}
public function setPlanet(Wootook_Empire_Model_Planet $planet)
{
$this->_planet = $planet;
return $this;
}
public function setGalaxy($galaxy)
{
$this->setData('galaxy', $galaxy);

View file

@ -555,6 +555,10 @@ class Wootook_Empire_Model_User
$layout = $eventData['layout'];
$navigation = $layout->getBlock('navigation');
$navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/index.php', array(), array('admin'));
if (!defined('IN_ADMIN')) {
$navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/overview.php', array(), array('admin'));
} else {
$navigation->addLink('tools/back', 'Go back to the game', 'Go back to the game', 'overview.php', array(), array('admin'));
}
}
}

View file

@ -0,0 +1,243 @@
<?php return array(
'admin' => array(
'update' => '1column',
'reference' => array(
'content' => array(
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml',
'actions' => array(
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'system',
'title' => 'System'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'system/overview',
'label' => 'Overview',
'title' => 'Overview',
'uri' => 'admin/overview.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'system/settings',
'label' => 'Settings',
'title' => 'Settings',
'uri' => 'admin/settings.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'system/reset-universe',
'label' => 'Reset Universe',
'title' => 'Reset Universe',
'uri' => 'admin/XNovaResetUnivers.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'players',
'title' => 'Player Accounts'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/list',
'label' => 'List',
'title' => 'List',
'uri' => 'admin/userlist.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/password-recovery',
'label' => 'Change a password',
'title' => 'Change a password',
'uri' => 'admin/md5changepass.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/search',
'label' => 'Search',
'title' => 'Search',
'uri' => 'admin/paneladmina.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/multi-account-alerts',
'label' => 'Multi account alerts',
'title' => 'Multi account alerts',
'uri' => 'admin/multi.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/declared-multi-account',
'label' => 'Declared multi accounts',
'title' => 'Declared multi accounts',
'uri' => 'admin/declare_list.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/add-resources',
'label' => 'Add Resources',
'title' => 'Add Resources',
'uri' => 'admin/add_money.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/messages',
'label' => 'Private messages management',
'title' => 'Private messages management',
'uri' => 'admin/messagelist.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/chat',
'label' => 'Manage Chat',
'title' => 'Manage Chat',
'uri' => 'chat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/ban',
'label' => 'Ban Player',
'title' => 'Ban Player',
'uri' => 'admin/banned.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'players/unban',
'label' => 'Unban Player',
'title' => 'Unban Player',
'uri' => 'admin/unbanned.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'empire',
'title' => 'Empires'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'empire/planet-list',
'label' => 'Planet List',
'title' => 'Planet List',
'uri' => 'admin/planetlist.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'empire/moon-list',
'label' => 'Moon List',
'title' => 'Moon List',
'uri' => 'admin/moonlist.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'empire/add-moon',
'label' => 'Add a moon',
'title' => 'Add a moon',
'uri' => 'admin/add_moon.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'empire/planet-activity',
'label' => 'Planet Activity',
'title' => 'Planet Activity',
'uri' => 'admin/activeplanet.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'empire/fleet-list',
'label' => 'Fleet list',
'title' => 'Fleet list',
'uri' => 'admin/ShowFlyingFleets.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'tools',
'title' => 'Tools'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/phpinfo',
'label' => 'PHP Info',
'title' => 'PHP Info',
'uri' => 'variables.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/stats',
'label' => 'Stats updater',
'title' => 'Stats updater',
'uri' => 'statbuilder.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/errors',
'label' => 'Error reporting',
'title' => 'Error reporting',
'uri' => 'errors.php'
)
),
array(
'method' => 'addExternalLink',
'params' => array(
'name' => 'tools/help',
'label' => 'Need help?',
'title' => 'Need help?',
'url' => 'http://wootook.org/board/'
)
)
)
)
)
)
)
)
);

View file

@ -2,287 +2,293 @@
'empire' => array(
'update' => '1column',
'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' => 'buildings.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/research-lab',
'label' => 'Research Lab',
'title' => 'Research Lab',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'research'
'content' => array(
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml',
'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' => 'buildings.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/research-lab',
'label' => 'Research Lab',
'title' => 'Research Lab',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'research'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/shipyard',
'label' => 'Shipyard',
'title' => 'Shipyard',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'fleet'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/defenses',
'label' => 'Defenses',
'title' => 'Defenses',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'defense'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/officers',
'label' => 'Officers',
'title' => 'Officers',
'uri' => 'officier.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'navigation',
'title' => 'Navigation'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/alliance',
'label' => 'Alliance',
'title' => 'Alliance',
'uri' => 'alliance.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/fleet',
'label' => 'Fleet',
'title' => 'Fleet',
'uri' => 'fleet.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/galaxy',
'label' => 'Galaxy',
'title' => 'Galaxy',
'uri' => 'galaxy.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/empire',
'label' => 'Empire',
'title' => 'Empire',
'uri' => 'imperium.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/resources',
'label' => 'Resources Production',
'title' => 'Resources Production',
'uri' => 'resources.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/retailer',
'label' => 'Retailer',
'title' => 'Retailer',
'uri' => 'marchand.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/tech-tree',
'label' => 'Technology Tree',
'title' => 'Technology Tree',
'uri' => 'techtree.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'tools',
'title' => 'Tools'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/messages',
'label' => 'Messages',
'title' => 'Messages',
'uri' => 'messages.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/records',
'label' => 'Records',
'title' => 'Records',
'uri' => 'records.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/statistics',
'label' => 'Stats',
'title' => 'Stats',
'uri' => 'stat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/banned',
'label' => 'Banned Players',
'title' => 'Banned Players',
'uri' => 'banned.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/announcement',
'label' => 'Announcements',
'title' => 'Announcements',
'uri' => 'annonce.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/notes',
'label' => 'Note Pad',
'title' => 'Note Pad',
'uri' => 'notes.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/options',
'label' => 'Account Options',
'title' => 'Account Options',
'uri' => 'options.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/logout',
'label' => 'Log Out',
'title' => 'Log Out',
'uri' => 'logout.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'community',
'title' => 'Community'
)
),
array(
'method' => 'addExternalLink',
'params' => array(
'name' => 'community/board',
'label' => 'Forum board',
'title' => 'Forum board',
'url' => 'http://www.wootook.org/'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/search-player',
'label' => 'Search Player',
'title' => 'Search Player',
'uri' => 'search.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/chat',
'label' => 'Chat',
'title' => 'Chat',
'uri' => 'chat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/multi',
'label' => 'Declare Multi-account',
'title' => 'Declare Multi-account',
'uri' => 'delclare_multi.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/rules',
'label' => 'Rules',
'title' => 'Rules',
'uri' => 'rules.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/contact',
'label' => 'Contact Admin',
'title' => 'Contact Admin',
'uri' => 'contact.php'
)
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/shipyard',
'label' => 'Shipyard',
'title' => 'Shipyard',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'fleet'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/defenses',
'label' => 'Defenses',
'title' => 'Defenses',
'uri' => 'buildings.php',
'params' => array(
'mode' => 'defense'
)
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/officers',
'label' => 'Officers',
'title' => 'Officers',
'uri' => 'officers.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'navigation',
'title' => 'Navigation'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/alliance',
'label' => 'Alliance',
'title' => 'Alliance',
'uri' => 'alliance.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/fleet',
'label' => 'Fleet',
'title' => 'Fleet',
'uri' => 'fleet.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/galaxy',
'label' => 'Galaxy',
'title' => 'Galaxy',
'uri' => 'galaxy.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/empire',
'label' => 'Empire',
'title' => 'Empire',
'uri' => 'imperium.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/resources',
'label' => 'Resources Production',
'title' => 'Resources Production',
'uri' => 'resources.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'development/retailer',
'label' => 'Retailer',
'title' => 'Retailer',
'uri' => 'marchand.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'navigation/tech-tree',
'label' => 'Technology Tree',
'title' => 'Technology Tree',
'uri' => 'techtree.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'tools',
'title' => 'Tools'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/messages',
'label' => 'Messages',
'title' => 'Messages',
'uri' => 'messages.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/records',
'label' => 'Records',
'title' => 'Records',
'uri' => 'records.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/statistics',
'label' => 'Stats',
'title' => 'Stats',
'uri' => 'stat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/banned',
'label' => 'Banned Players',
'title' => 'Banned Players',
'uri' => 'banned.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/announcement',
'label' => 'Announcements',
'title' => 'Announcements',
'uri' => 'annonce.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/notes',
'label' => 'Note Pad',
'title' => 'Note Pad',
'uri' => 'notes.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/options',
'label' => 'Account Options',
'title' => 'Account Options',
'uri' => 'options.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'tools/logout',
'label' => 'Log Out',
'title' => 'Log Out',
'uri' => 'logout.php'
)
),
array(
'method' => 'setNodeTitle',
'params' => array(
'path' => 'community',
'title' => 'Community'
)
),
array(
'method' => 'addExternalLink',
'params' => array(
'name' => 'community/board',
'label' => 'Forum board',
'title' => 'Forum board',
'url' => 'http://www.wootook.org/'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/search-player',
'label' => 'Search Player',
'title' => 'Search Player',
'uri' => 'search.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/chat',
'label' => 'Chat',
'title' => 'Chat',
'uri' => 'chat.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/multi',
'label' => 'Declare Multi-account',
'title' => 'Declare Multi-account',
'uri' => 'delclare_multi.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/rules',
'label' => 'Rules',
'title' => 'Rules',
'uri' => 'rules.php'
)
),
array(
'method' => 'addLink',
'params' => array(
'name' => 'community/contact',
'label' => 'Contact Admin',
'title' => 'Contact Admin',
'uri' => 'contact.php'
)
)
)
)

View file

@ -1,16 +1,6 @@
<?php return array(
'1column' => array(
'update' => 'default',
'reference' => array(
'content' => array(
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml'
)
)
)
)
'update' => 'default'
),
'2columns-left' => array(
@ -20,13 +10,7 @@
'root' => array(
'children' => array(
'left' => array(
'type' => 'core/concat',
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml'
)
)
'type' => 'core/concat'
)
)
)

View file

@ -1,10 +1,16 @@
<form name="rename-planet" id="overview:rename-planet" method="post" action="">
<form name="rename-planet" class="form 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" />
<p>
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
<input id="overview:rename-planet:name" type="text" name="name" />
</p>
<p>
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:rename-planet:password" type="password" name="password" />
</p>
<p>
<input type="submit" />
</p>
</fieldset>
</form>

View file

@ -1,4 +1,4 @@
<form action="reg.php" method="post" class="registration">
<form action="reg.php" method="post" class="form registration">
<h1>Wootook!</h1>
<fieldset>
<legend><?php echo $this->__('User data:')?></legend>

View file

@ -0,0 +1,84 @@
<?php return array(
'install' => array(
'update' => '2columns-left',
'reference' => array(
'messages' => array(
'actions' => array(
array(
'method' => 'prepareMessages',
'params' => array(
'namespace' => 'install'
)
)
)
),
'content' => array(
'children' => array(
'navigation' => array(
'type' => 'core/html.navigation',
'template' => 'page/html/navigation.phtml',
'actions' => array()
)
)
),
'left' => array(
'children' => array(
'status' => array(
'type' => 'core/template',
'template' => 'status.phtml'
)
)
)
)
),
'install.intro' => array(
'update' => 'install',
'reference' => array(
'content' => array(
'children' => array(
'overview' => array(
'type' => 'core/template',
'template' => 'intro.phtml'
),
)
),
'status' => array(
'actions' => array(
array(
'method' => 'setData',
'params' => array(
'key' => 'step',
'value' => 'intro'
)
)
)
)
)
),
'install.step.system' => array(
'update' => 'install',
'reference' => array(
'content' => array(
'children' => array(
'overview' => array(
'type' => 'core/template',
'template' => 'step/system.phtml'
),
)
),
'status' => array(
'actions' => array(
array(
'method' => 'setData',
'params' => array(
'key' => 'step',
'value' => 'system'
)
)
)
)
)
)
);

View file

@ -0,0 +1,44 @@
<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

@ -0,0 +1,9 @@
<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

@ -0,0 +1,28 @@
<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

@ -0,0 +1,33 @@
<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

@ -0,0 +1,8 @@
<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

@ -0,0 +1,9 @@
<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

@ -0,0 +1,33 @@
<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

@ -0,0 +1,10 @@
<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

@ -0,0 +1,11 @@
<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

@ -0,0 +1,7 @@
<div class="install">
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
<p><?php echo $this->__('This page will guide you through the installation proces of Wootook! the MMO game engine platform.')?></p>
<p><?php echo $this->__('Feel free to ask for help at any time at <a href="%s">wootook.org</a>.', 'http://wootook.org/board/')?></p>
<p><button onclick="document.location.href='?mode=install&step=1'"><?php echo $this->__('Next step')?></button></p>
</div>

View file

@ -0,0 +1,13 @@
<?php $session = Wootook::getSession('install')?>
<div class="install">
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
<h2><?php echo $this->__('System Config')?></h2>
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
<form method="post" action="?mode=install&step=1">
<p>
<label for="system:url_path"><?php echo $this->__('Base URL path for the game:')?></label>
<input type="text" id="system:url_path" name="url_path" value="<?php echo $session->getFormData('url_path', Wootook::getBaseUrl())?>" />
</p>
<p><input type="submit" value="<?php echo $this->__('Next step')?>" /></p>
</form>
</div>

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1,2 @@
<?php return array(
);

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1,6 @@
<?php return array(
'block' => array(
'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'),
'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block')
)
);

View file

@ -0,0 +1,2 @@
<?php return array(
);

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1 @@
<?php return array();

View file

@ -0,0 +1,39 @@
"Your session has expired, please login.","Votre session a expiré, veuillez vous reconnecter."
"Your username or credential is invalid, please check your input.","Votre nom d'utilisateur ou votre mot de passe n'est pas valide, veuillez vérifier votre saisie."
"No such user.","Cet utilisateur n'existe pas."
"You were banned, please contact admin for more information.","Vous ont été banni, veuillez contacter l'admin pour plus d'informations."
"You have 1 unread message.","Vous avez un message non lu."
"You have 1 new message.","Vous avez un nouveau message."
"You have no new message.","Vous n'avez pas de nouveau message."
"You have %1$d new messages","Vous avez %1$d nouveaux messages"
"You have %1$d unread messages.","Vous avez %1$d messages non lus."
"You have ""%1$d"" unread messages.","Vous avez ""%1$d"" messages non lus."
"No message.","Aucun message"
"1 messages.","Un message"
"%1$d messages.","%1$d messages."
"instantaneous","instantanné"
"Attack","Attaquer"
"Transport","Transporter"
"Station","Stationner"
"Settle","Coloniser"
"Recycle","Recycler"
"Destroy","Détruire"
"Missiles Launch","Attaque de missiles"
"Expedition","Expédition"
"Unknown","Inconnu"
"Planet is already destroyed","La planète est déjà détruite"
"Password:","Mot de passe :"
"I want to destroy this planet","Je confirme vouloir détruire cette planète"
"New name","Nouveau nom"
"Idle.","Inactif."
"Cancel","Annuler"
"Work in progress","Travail en cours"
"Buildings","Bâtiments"
"Research Laboratory","Laboratoire de recherches"
"Shipyard","Chantier spatial"
"Build","Construire"
"Metal","Métal"
"Cristal","Cristal"
"Deuterium","Deutérium"
"Energy","Energie"
"Messages","Messages"
Can't render this file because it contains an unexpected character in line 13 and column 33.

View file

@ -37,10 +37,6 @@ if (0 === filesize(ROOT_PATH . 'config.php')) {
die();
}
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
foreach ($listenerList as $listener) {
Wootook::registerListener($event, $listener);
}
}
Wootook_Core_Model_Config_Events::registerEvents();
include ROOT_PATH . 'includes/constants.php';

View file

@ -62,6 +62,11 @@ case 'fleet':
$shipyard->appendQueue($shipId, $count);
}
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
}
$layout = new Wootook_Core_Layout();
@ -87,9 +92,19 @@ case 'research':
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(intval($_GET['research']), isset($_GET['destroy']));
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
$planet->dequeueItem($_GET['cancel']);
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
}
$layout = new Wootook_Core_Layout();
@ -121,6 +136,11 @@ case 'defense':
$shipyard->appendQueue($defenseId, $count);
}
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
}
$layout = new Wootook_Core_Layout();
@ -138,9 +158,19 @@ default:
$data = $planet->getAllDatas();
$planet->appendBuildingQueue(intval($_GET['building']), isset($_GET['destroy']));
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
$planet->dequeueItem($_GET['cancel']);
$planet->save();
Wootook::getResponse()
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
->sendHeaders();
exit(0);
}
$layout = new Wootook_Core_Layout();

View file

@ -22,6 +22,7 @@
),
'layout' => array(
'page' => 'page.php',
'admin' => 'admin.php',
'empire' => 'empire.php'
),
'locales' => array(

View file

@ -33,131 +33,174 @@ define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
$mode = $_GET['mode'];
$a = $_GET['a'];
/*
Este script es original xD
La funcion de este script es administrar una variable del $user
Permite agregar y quitar arrays...
*/
//Lets start!
if(isset($_GET['mode'])){
if($_POST){
//Pegamos el texto :P
if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";}
$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
$a = isset($_GET['a']) ? $_GET['a'] : null;
$r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n";
$user['fleet_shortcut'] .= $r;
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrment","fleetshortcut.php");
}
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Nom [Galaxie/Syst&egrave;me solaire/Plan&egrave;te]</td>
</tr><tr height=\"20\"><th>
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"Name\">
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"Galaxie\">
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"Sonnensystem\">
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"Planet\">
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=\"reset\" value=\"Zur&uuml;cksetzen\"> <input type=\"submit\" value=\"Enregistrer\">";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
$page .= "</th></tr>";
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
}
elseif(isset($_GET['a'])){
if($_POST){
//Armamos el array...
$scarray = explode("\r\n",$user['fleet_shortcut']);
if($_POST["delete"]){
unset($scarray[$a]);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Shortcut wurde gel&ouml;scht","Gel&ouml;scht","fleetshortcut.php");
}
else{
$r = explode(",",$scarray[$a]);
$r[0] = strip_tags($_POST['n']);
$r[1] = intval($_POST['g']);
$r[2] = intval($_POST['s']);
$r[3] = intval($_POST['p']);
$r[4] = intval($_POST['t']);
$scarray[$a] = implode(",",$r);
$user['fleet_shortcut'] = implode("\r\n",$scarray);
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
message("Le raccourcis a &eacute;t&eacute; &eacute;dit&eacute; !.","Editer","fleetshortcut.php");
}
}
if($user['fleet_shortcut']){
$user = Wootook_Empire_Model_User::getSingleton();
$scarray = explode("\r\n",$user['fleet_shortcut']);
$c = explode(',',$scarray[$a]);
if ($mode) {
if ($_POST) {
//Pegamos el texto :P
if (!isset($_POST["n"]) || empty($_POST["n"])) {
$name = Wootook::__("Unnamed");
} else {
$name = $_POST["n"];
}
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]</td>
</tr>";
//if($i==0){$page .= "";}
$page .= "<tr height=\"20\"><th>
<input type=hidden name=a value=$a>
<input type=text name=n value=\"{$c[0]}\" size=32 maxlength=32>
<input type=text name=g value=\"{$c[1]}\" size=3 maxlength=1>
<input type=text name=s value=\"{$c[2]}\" size=3 maxlength=3>
<input type=text name=p value=\"{$c[3]}\" size=3 maxlength=3>
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
$page .= "</th></tr>";
if (($offset = strpos($name, "\n")) !== false) {
$name = substr($name, 0, $offset);
}
if (($offset = strpos($name, "\r")) !== false) {
$name = substr($name, 0, $offset);
}
if (($offset = strpos($name, ",")) !== false) {
$name = substr($name, 0, $offset);
}
$planetTypes = array(
Wootook_Empire_Model_Planet::TYPE_PLANET,
Wootook_Empire_Model_Planet::TYPE_DEBRIS,
Wootook_Empire_Model_Planet::TYPE_MOON
);
}else{$page .= message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrer","fleetshortcut.php");}
$r = array();
$r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name);
$r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= MAX_GALAXY_IN_WORLD) ? intval($_POST['g']) : '1';
$r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= MAX_SYSTEM_IN_GALAXY) ? intval($_POST['s']) : '1';
$r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= MAX_PLANET_IN_SYSTEM) ? intval($_POST['p']) : '1';
$r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : '1';
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
$user['fleet_shortcut'] .= implode(",", $r);
$user->save();
message(Wootook::__("The shortcut has been saved."), Wootook::__("Success"), "fleetshortcut.php");
}
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Nom [Galaxie/Syst&egrave;me solaire/Plan&egrave;te]</td>
</tr><tr height=\"20\"><th>
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"" . Wootook::__('Name') . "\">
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"" . Wootook::__('Galaxy') . "\">
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"" . Wootook::__('System') . "\">
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"" . Wootook::__('Planet') . "\">
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">" . Wootook::__('Planet') . "</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">" . Wootook::__('Debris') . "</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">" . Wootook::__('Moon') . "</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=\"reset\" value=\"" . Wootook::__('Reset') . "\"> <input type=\"submit\" value=\"" . Wootook::__('Save') . "\">";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
$page .= "</th></tr>";
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
} else if ($a !== null) {
if ($_POST) {
//Armamos el array...
$scarray = explode("\r\n", $user['fleet_shortcut']);
if (isset($_POST["delete"])) {
unset($scarray[$a]);
$user['fleet_shortcut'] = implode("\r\n", $scarray);
doquery("UPDATE {{table}} SET fleet_shortcut={$db->quote($user['fleet_shortcut'])} WHERE id={$user['id']}", "users");
message(Wootook::__("The shortcut has been deleted"), Wootook::__("Success"), "fleetshortcut.php");
} else {
$r = explode(",", $scarray[$a]);
if (!isset($_POST["n"]) || empty($_POST["n"])) {
$name = $r[0];
} else {
$name = $_POST["n"];
}
if (($offset = strpos($name, "\n")) !== false) {
$name = substr($name, 0, $offset);
}
if (($offset = strpos($name, "\r")) !== false) {
$name = substr($name, 0, $offset);
}
if (($offset = strpos($name, ",")) !== false) {
$name = substr($name, 0, $offset);
}
$planetTypes = array(
Wootook_Empire_Model_Planet::TYPE_PLANET,
Wootook_Empire_Model_Planet::TYPE_DEBRIS,
Wootook_Empire_Model_Planet::TYPE_MOON
);
$r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name);
$r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= MAX_GALAXY_IN_WORLD) ? intval($_POST['g']) : $r[1];
$r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= MAX_SYSTEM_IN_GALAXY) ? intval($_POST['s']) : $r[2];
$r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= MAX_PLANET_IN_SYSTEM) ? intval($_POST['p']) : $r[3];
$r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : $r[4];
$scarray[$a] = implode(",", $r);
$user['fleet_shortcut'] = implode("\r\n", $scarray);
$user->save();
message(Wootook::__("The shortcut has been updated."), Wootook::__("Success"), "fleetshortcut.php");
}
}
if ($user['fleet_shortcut']) {
$scarray = explode("\r\n",$user['fleet_shortcut']);
$c = explode(',',$scarray[$a]);
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
<tr height=20>
<td colspan=2 class=c>Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]</td>
</tr>";
//if($i==0){$page .= "";}
$page .= "<tr height=\"20\"><th>
<input type=hidden name=a value=$a>
<input type=text name=n value=\"{$c[0]}\" size=32 maxlength=32>
<input type=text name=g value=\"{$c[1]}\" size=3 maxlength=1>
<input type=text name=s value=\"{$c[2]}\" size=3 maxlength=3>
<input type=text name=p value=\"{$c[3]}\" size=3 maxlength=3>
<select name=t>";
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Plan&egrave;te</option>";
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">D&eacute;bris</option>";
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
$page .= "</select>
</th></tr><tr>
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
$page .= "</th></tr>";
} else {
$page .= message("Le raccourcis a &eacute;t&eacute; enregistr&eacute; !","Enregistrer","fleetshortcut.php");
}
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
}
else{
} else {
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
<tr height="20">
<td colspan="2" class="c">Raccourcis(<a href="?mode=add">Ajout</a>)</td>
</tr>';
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
<tr height="20">
<td colspan="2" class="c">Raccourcis(<a href="?mode=add">Ajout</a>)</td>
</tr>';
if($user['fleet_shortcut']){
/*
Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones
de acceso directo, el formato es el siguiente.
Nombre, Galaxia,Sistema,Planeta,Tipo
*/
$scarray = explode("\r\n",$user['fleet_shortcut']);
$i=$e=0;
foreach($scarray as $a => $b){
if($b!=""){
$c = explode(',',$b);
if($i==0){$page .= "<tr height=\"20\">";}
$page .= "<th><a href=\"?a=".$e++."\">";
$page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";}
$page .= "</a></th>";
if($i==1){$page .= "</tr>";}
if($i==1){$i=0;}else{$i=1;}
}
if($user['fleet_shortcut']){
/*
Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones
de acceso directo, el formato es el siguiente.
Nombre, Galaxia,Sistema,Planeta,Tipo
*/
$scarray = explode("\r\n",$user['fleet_shortcut']);
$i=$e=0;
foreach($scarray as $a => $b){
if($b!=""){
$c = explode(',',$b);
if($i==0){$page .= "<tr height=\"20\">";}
$page .= "<th><a href=\"?a=".$e++."\">";
$page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}";
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";}
$page .= "</a></th>";
if($i==1){$page .= "</tr>";}
if($i==1){$i=0;}else{$i=1;}
}
}
if($i==1){$page .= "<th></th></tr>";}
}
if($i==1){$page .= "<th></th></tr>";}
}else{$page .= "<th colspan=\"2\">Pas de Raccourcis</th>";}
}else{$page .= "<th colspan=\"2\">Pas de Raccourcis</th>";}
$page .= '<tr><td colspan=2 class=c><a href=fleet.php>Retour</a></td></tr></tr></table>';
$page .= '<tr><td colspan=2 class=c><a href=fleet.php>Retour</a></td></tr></tr></table>';
}
display($page,"Shortcutmanager");

View file

@ -503,11 +503,15 @@ class Deprecated
/**
* @return Wootook_Core_Layout
*/
public static function getLayout()
public static function getLayout($adminPage = false)
{
if (self::$layout === null) {
self::$layout = new Wootook_Core_Layout();
self::$layout->load('empire');
if (defined('IN_INSTALL')) {
self::$layout->setPackage('install');
self::$layout->setTheme('default');
}
}
return self::$layout;
@ -528,7 +532,13 @@ function display($page, $title = '', $topnav = true, $metatags = '', $adminPage
defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// TODO: implement extra meta tags
$layout = Deprecated::getLayout();
$layout = Deprecated::getLayout($adminPage);
if ($adminPage === false) {
$layout->load('empire');
} else {
$layout->load('admin');
}
$content = $layout->getBlock('content');
if ($topnav) {

View file

@ -63,17 +63,17 @@ function GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy,
$Result .= " onmouseover='return overlib(\"";
$Result .= "<table width=240>";
$Result .= "<tr>";
$Result .= "<td class=c>".$lang['Alliance']." ". $allyquery['ally_name'] ." ".$lang['gl_with']." ". $members_count[0] ." ". $lang['gl_membre'] . $add ."</td>";
$Result .= "<td class=c>".htmlspecialchars($lang['Alliance'], ENT_QUOTES, 'UTF-8')." ". htmlspecialchars($allyquery['ally_name'], ENT_QUOTES, 'UTF-8') ." ".$lang['gl_with']." ". $members_count[0] ." ". $lang['gl_membre'] . $add ."</td>";
$Result .= "</tr>";
$Result .= "<th>";
$Result .= "<table>";
$Result .= "<tr>";
$Result .= "<td><a href=alliance.php?mode=ainfo&a=". $allyquery['id'] .">".$lang['gl_ally_internal']."</a></td>";
$Result .= "<td><a href=alliance.php?mode=ainfo&a=". intval($allyquery['id']) .">".$lang['gl_ally_internal']."</a></td>";
$Result .= "</tr><tr>";
$Result .= "<td><a href=stat.php?start=101&who=ally>".$lang['gl_stats']."</a></td>";
if ($allyquery["ally_web"] != "") {
$Result .= "</tr><tr>";
$Result .= "<td><a href=". $allyquery["ally_web"] ." target=_new>".$lang['gl_ally_web']."</td>";
$Result .= "<td><a href=". htmlspecialchars($allyquery["ally_web"], ENT_QUOTES, 'UTF-8') ." target=_new>".$lang['gl_ally_web']."</td>";
}
$Result .= "</tr>";
$Result .= "</table>";
@ -82,7 +82,7 @@ function GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy,
$Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
$Result .= " onmouseout='return nd();'>";
if ($user['ally_id'] == $GalaxyRowUser['ally_id']) {
$Result .= "<span class=\"allymember\">". $allyquery['ally_tag'] ."</span></a>";
$Result .= "<span class=\"allymember\">". htmlspecialchars($allyquery['ally_tag'], ENT_QUOTES, 'UTF-8') ."</span></a>";
} else {
$Result .= $allyquery['ally_tag'] ."</a>";
}

View file

@ -48,25 +48,17 @@ include(ROOT_PATH . 'includes/functions/SendSimpleMessage.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SpyTarget.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/RestoreFleetToPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/StoreGoodsToPlanet.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/CheckPlanetBuildingQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/CheckPlanetUsedFields.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/CreateOneMoonRecord.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/CreateOneMoonRecord.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/IsTechnologieAccessible.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetBuildingTime.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetBuildingTimeLevel.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GetRestPrice.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetElementPrice.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetBuildingPrice.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/IsTechnologieAccessible.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GetRestPrice.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/IsElementBuyable.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/CheckCookies.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ChekUser.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/InsertGalaxyScripts.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyCheckFunctions.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyRows.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GalaxyRowPos.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanetName.'.PHPEXT);
@ -80,30 +72,8 @@ include(ROOT_PATH . 'includes/functions/ShowGalaxyMISelector.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyTitles.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyLegendPopup.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyFooter.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetMaxConstructibleElements.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/GetElementRessources.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ElementBuildListBox.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ElementBuildListQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/FleetBuildingPage.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/DefensesBuildingPage.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ResearchBuildingPage.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/BatimentBuildingPage.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/CheckLabSettingsInQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/InsertBuildListScript.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/AddBuildingToQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ShowBuildingQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/HandleTechnologieBuild.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/BuildingSavePlanetRecord.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/BuildingSaveUserRecord.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/RemoveBuildingFromQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/CancelBuildingFromQueue.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/SetNextQueueElementOnTop.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/ShowTopNavigationBar.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/SetSelectedPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MessageForm.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SendNewPassword.'.PHPEXT);
//include(ROOT_PATH . 'includes/functions/UpdatePlanetBatimentQueueList.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/IsOfficierAccessible.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/CheckInputStrings.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MipCombatEngine.'.PHPEXT);

View file

@ -32,44 +32,158 @@ define('INSIDE' , true);
define('INSTALL', false);
define('IN_INSTALL', true);
define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
define('PHPEXT', include ROOT_PATH . 'extension.inc');
define('STEP_SYSTEM', 1);
define('STEP_DATABASE', 2);
define('STEP_PROFILE', 3);
define('STEP_UNIVERSE', 4);
define('STEP_CONFIG', 5);
define('DEFAULT_SKINPATH', '../skins/xnova/');
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
define('TEMPLATE_NAME', 'OpenGame');
define('DEFAULT_LANG', 'fr');
$dpath = DEFAULT_SKINPATH;
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
include(ROOT_PATH . 'includes/debug.class.'.PHPEXT);
$debug = new debug();
include(ROOT_PATH . 'includes/constants.' . PHPEXT);
include(ROOT_PATH . 'includes/functions.' . PHPEXT);
include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT);
include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT);
include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
include(ROOT_PATH . 'includes/db.' . PHPEXT);
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
include(ROOT_PATH . 'includes/databaseinfos.php');
include(ROOT_PATH . 'includes/migrateinfo.php');
//include(ROOT_PATH . 'includes/databaseinfos.php');
//include(ROOT_PATH . 'includes/migrateinfo.php');
$mode = isset($_GET['mode']) ? strval($_GET['mode']) : 'intro';
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$nextPage = $page + 1;
$step = isset($_GET['step']) ? intval($_GET['step']) : 1;
$prevStep = $step - 1;
$nextStep = $step + 1;
$mainTpl = gettemplate('install/ins_body');
includeLang('install/install');
$baseUrl = (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) == "on" ? 'https://' : 'http://')
. $_SERVER["SERVER_NAME"] . ($_SERVER["SERVER_PORT"] != "80" ? ":{$_SERVER["SERVER_PORT"]}" : '');
if (isset($_SERVER['REQUEST_URI'])) {
if (strrpos($_SERVER['REQUEST_URI'], '/') == (strlen($_SERVER['REQUEST_URI']) - 1)) {
$baseUrl .= dirname($_SERVER['REQUEST_URI']) . '/';
} else {
$baseUrl .= dirname(dirname($_SERVER['REQUEST_URI'])) . '/';
}
}
Wootook::setConfig('global/web/base_url', $baseUrl);
Wootook::setConfig('global/package', 'install');
Wootook::setConfig('global/theme', 'default');
Wootook::setconfig('global/layout', array(
'page' => 'page.php',
'install' => 'install.php'
));
$session = Wootook::getSession('install');
$layout = new Wootook_Core_Layout();
$request = new Wootook_Core_Controller_Request_Http();
$response = new Wootook_Core_Controller_Response_Http();
switch ($mode) {
case 'intro':
$subTpl = gettemplate('install/ins_intro');
$bloc = $lang;
$bloc['dpath'] = $dpath;
$frame = parsetemplate($subTpl, $bloc);
break;
case 'intro':
$layout->load('install.intro');
$session->setData('step', 1);
break;
case 'install':
$session->addError('Test %s', 'Hello world!');
if ($step != $session->getData('step')) {
$session->setData('step', 0);
$response->setRedirect("?mode=intro", Wootook_Core_Controller_Response_Http::REDIRECT_TEMPORARY);
$response->sendHeaders();
exit(0);
}
switch ($step) {
case STEP_SYSTEM:
if ($request->isPost()) {
$form = new Wootook_Core_Form($session, array(
'url_path' => 'text'
));
$form->addField('url_path');
$form->setRequest($request);
$form->populate();
if (!$form->validate()) {
$session->setData('step', $step);
$session->setFormData($form->getData());
var_dump($session);
$response->setRedirect("?mode=install&step={$step}");
$response->sendHeaders();
exit(0);
}
$layout->getMessagesblock()->prepareMessages('install');
$session->setBaseUrl($request->getPost('url_path'));
$session->setStep(STEP_DATABASE);
$response->setRedirect("?mode=install&step={$nextStep}");
$response->sendHeaders();
exit(0);
}
$layout->load('install.step.system');
break;
case STEP_DATABASE:
if ($request->isPost()) {
$form = new Wootook_Core_Form($session, array(
'host' => 'text',
'port' => 'text',
'user' => 'text',
'password' => 'text',
'dbname' => 'text',
'prefix' => 'text',
));
$form->setRequest($request);
$form->populate();
if (!$form->validate()) {
$session->setData('step', $step);
$session->setFormData($request->getPost());
$response->setRedirect("?mode=install&step={$step}");
$response->sendHeaders();
exit(0);
}
$layout->getMessagesblock()->prepareMessages('install');
$session->setStep(STEP_PROFILE);
$response->setRedirect("?mode=install&step={$nextStep}");
$response->sendHeaders();
exit(0);
}
$layout->load('install.database');
break;
case STEP_PROFILE:
if (empty($_POST)) {
$session->setData('step', $step);
$response->setRedirect("?mode=install&step={$nextStep}");
$response->sendHeaders();
exit(0);
}
$layout->load('install.profile');
break;
case STEP_UNIVERSE:
if (empty($_POST)) {
$session->setData('step', $step);
$response->setRedirect("?mode=install&step={$nextStep}");
$response->sendHeaders();
exit(0);
}
$layout->load('install.universe');
break;
case STEP_CONFIG:
if (empty($_POST)) {
$session->setData('step', $step);
$response->setRedirect("?mode=install&step={$nextStep}");
$response->sendHeaders();
exit(0);
}
$layout->load('install.config');
break;
}
break;
case 'ins':
if ($page == 1) {
@ -345,12 +459,4 @@ EOF;
die();
}
$parse = $lang;
$parse['ins_state'] = $page;
$parse['ins_page'] = $frame;
$parse['dis_ins_btn'] = "?mode=$mode&page=$nextPage";
$parse['dpath'] = $dpath;
$data = parsetemplate($mainTpl, $parse);
display($data, "Installeur", false, '', true);
echo $layout->render();

View file

@ -0,0 +1,98 @@
<?php
$galaxyCount = 3;
$systemCount = 100;
$sql = <<<SQL_EOF
INSERT INTO `game_galaxy` (`galaxy`, `system`, `planet`, `id_planet`, `metal`, `crystal`, `id_luna`, `luna`)
SELECT _increment.galaxy, _increment.system, 0, 0, 0, 0, 0, 0
FROM (
SELECT _galaxy.galaxy, (1 + _10e0.system + _10e1.system + _10e2.system) system
FROM (
SELECT 0 AS system
UNION ALL
SELECT 1 AS system
UNION ALL
SELECT 2 AS system
UNION ALL
SELECT 3 AS system
UNION ALL
SELECT 4 AS system
UNION ALL
SELECT 5 AS system
UNION ALL
SELECT 6 AS system
UNION ALL
SELECT 7 AS system
UNION ALL
SELECT 8 AS system
UNION ALL
SELECT 9 AS system
) _10e0
CROSS JOIN (
SELECT 0 AS system
UNION ALL
SELECT 10 AS system
UNION ALL
SELECT 20 AS system
UNION ALL
SELECT 30 AS system
UNION ALL
SELECT 40 AS system
UNION ALL
SELECT 50 AS system
UNION ALL
SELECT 60 AS system
UNION ALL
SELECT 70 AS system
UNION ALL
SELECT 80 AS system
UNION ALL
SELECT 90 AS system
) _10e1
CROSS JOIN (
SELECT 0 AS system
UNION ALL
SELECT 100 AS system
UNION ALL
SELECT 200 AS system
UNION ALL
SELECT 300 AS system
UNION ALL
SELECT 400 AS system
UNION ALL
SELECT 500 AS system
UNION ALL
SELECT 600 AS system
UNION ALL
SELECT 700 AS system
UNION ALL
SELECT 800 AS system
UNION ALL
SELECT 900 AS system
) _10e2
CROSS JOIN (
SELECT 1 AS galaxy
UNION ALL
SELECT 2 AS galaxy
UNION ALL
SELECT 3 AS galaxy
UNION ALL
SELECT 4 AS galaxy
UNION ALL
SELECT 5 AS galaxy
UNION ALL
SELECT 6 AS galaxy
UNION ALL
SELECT 7 AS galaxy
UNION ALL
SELECT 8 AS galaxy
UNION ALL
SELECT 9 AS galaxy
) _galaxy
) _increment
WHERE _increment.galaxy<={$galaxyCount}
AND _increment.system<={$systemCount}
SQL_EOF;

View file

@ -44,18 +44,10 @@ if (isset($_POST) && !empty($_POST)) {
if ($formKey == Wootook::getSession('security')->getData('form_key')) {
if ($action == 'rename' && isset($_POST['name']) && !empty($_POST['name'])) {
$planet->setData('name', $_POST['name'])->save();
header('302 Found');
header('Location: ' . basename(__FILE__));
exit(0);
} else if ($action == 'destroy' && isset($_POST['password']) && !empty($_POST['password']) && isset($_POST['confirm'])) {
if (!$user->checkPassword($_POST['password'])) {
Wootook::getSession('user')
->addError(Wootook::__('Password was not correct.'));
header('302 Found');
header('Location: ' . basename(__FILE__));
exit(0);
}
try {
@ -67,15 +59,15 @@ if (isset($_POST) && !empty($_POST)) {
Wootook::getSession('user')
->addError($e->getMessage());
}
header('302 Found');
header('Location: ' . basename(__FILE__));
exit(0);
}
} else {
Wootook::getSession('user')
->addError(Wootook::__('Invalid security key.'));
}
header('HTTP/1.1 302 Found');
header('Location: ' . Wootook::getUrl(basename(__FILE__)));
exit(0);
} else if ($action == 'rename') {
$layout = new Wootook_Core_Layout();
$layout->load('overview.rename-planet');

View file

@ -279,13 +279,4 @@ a:hover
.style
{
margin-top : 10px;
}
h2
{
font-size : 14px;
font-family : Tahoma,sans-serif;
border-bottom : 0px #344566; solid;
width : 98%;
text-align : center;
}

View file

@ -1,5 +1,19 @@
@CHARSET "UTF-8";
* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;}
h1 {font-size:2em;border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;text-align:center;color:#156;background:#EEE;}
h1:hover {color:#6AB;background:#CCC;}
h2,h3 {text-decoration:underline;font-weight:bold;}
h4,h5,h6 {font-style:italic;}
h2 {font-size:2em;}
h3 {font-size:2em;}
h4 {font-size:2em;}
h5 {font-size:2em;}
h6 {font-size:2em;}
input[type=text] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;}
input[type=submit] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;}
.global .content .navigation {margin:0pt auto;width:1000px;height:30px;display:block;padding:0 40px;position:relative;border-width:0 1px;border-style:none solid;border-color:#FFF;background-color:#933;border-radius:10px;}
.global .content .navigation .navigation-node {margin:0;height:30px;width:250px;color:#FFF;float:left;}
.global .content .navigation .navigation-node .title {margin:5px 20px;font-size:1.5em;}
@ -39,13 +53,15 @@
.global .content .item-list .item {width:780px;margin:0 10px;border:0;box-shadow:none;border-radius:0;}
.global .content .item-list .item,.global .content .item-list .item * {color:#000;}
.global .content form.registration {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
.global .content form.registration h1 {font-size:2em;}
.global .content form.registration fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;}
.global .content form.registration fieldset legend {font-size:1.2em;font-weight:bold;}
.global .content form.registration fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;}
.global .content form.registration input {width:150px;display:block;margin:10px auto;}
.global .content form.registration fieldset p input {width:100px;display:block;}
.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
.global .content form.form h1 {font-size:2em;}
.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;}
.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;}
.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;}
.global .content form.form input {width:150px;display:block;margin:10px auto;}
.global .content form.form fieldset p input {width:100px;display:block;}
.global .content .install {background:#FFF;width:600px;margin:10px auto;padding:20px;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
/**
* Galaxy user name display colors

326
stat.php
View file

@ -32,183 +32,183 @@ define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
includeLang('stat');
includeLang('stat');
$parse = $lang;
$who = (isset($_POST['who'])) ? $_POST['who'] : $_GET['who'];
if (!isset($who)) {
$who = 1;
$parse = $lang;
$who = (isset($_POST['who'])) ? $_POST['who'] : $_GET['who'];
if (!isset($who)) {
$who = 1;
}
$type = (isset($_POST['type'])) ? $_POST['type'] : $_GET['type'];
if (!isset($type)) {
$type = 1;
}
$range = (isset($_POST['range'])) ? $_POST['range'] : $_GET['range'];
if (!isset($range)) {
$range = 1;
}
$parse['who'] = "<option value=\"1\"". (($who == "1") ? " SELECTED" : "") .">". $lang['stat_player'] ."</option>";
$parse['who'] .= "<option value=\"2\"". (($who == "2") ? " SELECTED" : "") .">". $lang['stat_allys'] ."</option>";
$parse['type'] = "<option value=\"1\"". (($type == "1") ? " SELECTED" : "") .">". $lang['stat_main'] ."</option>";
$parse['type'] .= "<option value=\"2\"". (($type == "2") ? " SELECTED" : "") .">". $lang['stat_fleet'] ."</option>";
$parse['type'] .= "<option value=\"3\"". (($type == "3") ? " SELECTED" : "") .">". $lang['stat_research'] ."</option>";
$parse['type'] .= "<option value=\"4\"". (($type == "4") ? " SELECTED" : "") .">". $lang['stat_building'] ."</option>";
$parse['type'] .= "<option value=\"5\"". (($type == "5") ? " SELECTED" : "") .">". $lang['stat_defenses'] ."</option>";
if ($type == 1) {
$Order = "total_points";
$Points = "total_points";
$Counts = "total_count";
$Rank = "total_rank";
$OldRank = "total_old_rank";
} elseif ($type == 2) {
$Order = "fleet_points";
$Points = "fleet_points";
$Counts = "fleet_count";
$Rank = "fleet_rank";
$OldRank = "fleet_old_rank";
} elseif ($type == 3) {
$Order = "tech_count";
$Points = "tech_points";
$Counts = "tech_count";
$Rank = "tech_rank";
$OldRank = "tech_old_rank";
} elseif ($type == 4) {
$Order = "build_points";
$Points = "build_points";
$Counts = "build_count";
$Rank = "build_rank";
$OldRank = "build_old_rank";
} elseif ($type == 5) {
$Order = "defs_points";
$Points = "defs_points";
$Counts = "defs_count";
$Rank = "defs_rank";
$OldRank = "defs_old_rank";
}
if ($who == 2) {
$MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}}", 'alliance', true);
if ($MaxAllys['count'] > 100) {
$LastPage = floor($MaxAllys['count'] / 100);
}
$type = (isset($_POST['type'])) ? $_POST['type'] : $_GET['type'];
if (!isset($type)) {
$type = 1;
}
$range = (isset($_POST['range'])) ? $_POST['range'] : $_GET['range'];
if (!isset($range)) {
$range = 1;
$parse['range'] = "";
for ($Page = 0; $Page <= $LastPage; $Page++) {
$PageValue = ($Page * 100) + 1;
$PageRange = $PageValue + 99;
$parse['range'] .= "<option value=\"". $PageValue ."\"". (($range == $PageValue) ? " SELECTED" : "") .">". $PageValue ."-". $PageRange ."</option>";
}
$parse['who'] = "<option value=\"1\"". (($who == "1") ? " SELECTED" : "") .">". $lang['stat_player'] ."</option>";
$parse['who'] .= "<option value=\"2\"". (($who == "2") ? " SELECTED" : "") .">". $lang['stat_allys'] ."</option>";
$parse['stat_header'] = parsetemplate(gettemplate('stat_alliancetable_header'), $parse);
$parse['type'] = "<option value=\"1\"". (($type == "1") ? " SELECTED" : "") .">". $lang['stat_main'] ."</option>";
$parse['type'] .= "<option value=\"2\"". (($type == "2") ? " SELECTED" : "") .">". $lang['stat_fleet'] ."</option>";
$parse['type'] .= "<option value=\"3\"". (($type == "3") ? " SELECTED" : "") .">". $lang['stat_research'] ."</option>";
$parse['type'] .= "<option value=\"4\"". (($type == "4") ? " SELECTED" : "") .">". $lang['stat_building'] ."</option>";
$parse['type'] .= "<option value=\"5\"". (($type == "5") ? " SELECTED" : "") .">". $lang['stat_defenses'] ."</option>";
$start = floor($range / 100 % 100) * 100;
$query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints');
if ($type == 1) {
$Order = "total_points";
$Points = "total_points";
$Counts = "total_count";
$Rank = "total_rank";
$OldRank = "total_old_rank";
} elseif ($type == 2) {
$Order = "fleet_points";
$Points = "fleet_points";
$Counts = "fleet_count";
$Rank = "fleet_rank";
$OldRank = "fleet_old_rank";
} elseif ($type == 3) {
$Order = "tech_count";
$Points = "tech_points";
$Counts = "tech_count";
$Rank = "tech_rank";
$OldRank = "tech_old_rank";
} elseif ($type == 4) {
$Order = "build_points";
$Points = "build_points";
$Counts = "build_count";
$Rank = "build_rank";
$OldRank = "build_old_rank";
} elseif ($type == 5) {
$Order = "defs_points";
$Points = "defs_points";
$Counts = "defs_count";
$Rank = "defs_rank";
$OldRank = "defs_old_rank";
}
$start++;
$parse['stat_date'] = $gameConfig['stats'];
$parse['stat_values'] = "";
while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) {
$parse['ally_rank'] = $start;
if ($who == 2) {
$MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE 1;", 'alliance', true);
if ($MaxAllys['count'] > 100) {
$LastPage = floor($MaxAllys['count'] / 100);
$AllyRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'alliance',true);
$rank_old = $StatRow[ $OldRank ];
if ( $rank_old == 0) {
$rank_old = $start;
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
} else {
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
}
$parse['range'] = "";
for ($Page = 0; $Page <= $LastPage; $Page++) {
$PageValue = ($Page * 100) + 1;
$PageRange = $PageValue + 99;
$parse['range'] .= "<option value=\"". $PageValue ."\"". (($range == $PageValue) ? " SELECTED" : "") .">". $PageValue ."-". $PageRange ."</option>";
$rank_new = $start;
$ranking = $rank_old - $rank_new;
if ($ranking == "0") {
$parse['ally_rankplus'] = "<font color=\"#87CEEB\">*</font>";
}
if ($ranking < "0") {
$parse['ally_rankplus'] = "<font color=\"red\">".$ranking."</font>";
}
if ($ranking > "0") {
$parse['ally_rankplus'] = "<font color=\"green\">+".$ranking."</font>";
}
$parse['ally_tag'] = $AllyRow['ally_tag'];
$parse['ally_name'] = $AllyRow['ally_name'];
$parse['ally_mes'] = '';
$parse['ally_members'] = $AllyRow['ally_members'];
$parse['ally_points'] = pretty_number( $StatRow[ $Order ] );
$parse['ally_members_points'] = pretty_number( floor($StatRow[ $Order ] / $AllyRow['ally_members']) );
$parse['stat_header'] = parsetemplate(gettemplate('stat_alliancetable_header'), $parse);
$start = floor($range / 100 % 100) * 100;
$query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints');
$parse['stat_values'] .= parsetemplate(gettemplate('stat_alliancetable'), $parse);
$start++;
$parse['stat_date'] = $gameConfig['stats'];
$parse['stat_values'] = "";
while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) {
$parse['ally_rank'] = $start;
$AllyRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'alliance',true);
$rank_old = $StatRow[ $OldRank ];
if ( $rank_old == 0) {
$rank_old = $start;
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
} else {
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
}
$rank_new = $start;
$ranking = $rank_old - $rank_new;
if ($ranking == "0") {
$parse['ally_rankplus'] = "<font color=\"#87CEEB\">*</font>";
}
if ($ranking < "0") {
$parse['ally_rankplus'] = "<font color=\"red\">".$ranking."</font>";
}
if ($ranking > "0") {
$parse['ally_rankplus'] = "<font color=\"green\">+".$ranking."</font>";
}
$parse['ally_tag'] = $AllyRow['ally_tag'];
$parse['ally_name'] = $AllyRow['ally_name'];
$parse['ally_mes'] = '';
$parse['ally_members'] = $AllyRow['ally_members'];
$parse['ally_points'] = pretty_number( $StatRow[ $Order ] );
$parse['ally_members_points'] = pretty_number( floor($StatRow[ $Order ] / $AllyRow['ally_members']) );
$parse['stat_values'] .= parsetemplate(gettemplate('stat_alliancetable'), $parse);
$start++;
}
} else {
$MaxUsers = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE `db_deaktjava` = '0';", 'users', true);
if ($MaxUsers['count'] > 100) {
$LastPage = floor($MaxUsers['count'] / 100);
}
$parse['range'] = "";
for ($Page = 0; $Page <= $LastPage; $Page++) {
$PageValue = ($Page * 100) + 1;
$PageRange = $PageValue + 99;
$parse['range'] .= "<option value=\"". $PageValue ."\"". (($start == $PageValue) ? " SELECTED" : "") .">". $PageValue ."-". $PageRange ."</option>";
}
$parse['stat_header'] = parsetemplate(gettemplate('stat_playertable_header'), $parse);
$start = floor($range / 100 % 100) * 100;
$query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints');
$start++;
$parse['stat_date'] = $gameConfig['stats'];
$parse['stat_values'] = "";
while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) {
$parse['stat_date'] = date("d M Y - H:i:s", $StatRow['stat_date']);
$parse['player_rank'] = $start;
$UsrRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'users',true);
$QryUpdateStats .= "`stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
$rank_old = $StatRow[ $OldRank ];
if ( $rank_old == 0) {
$rank_old = $start;
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
} else {
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
}
$rank_new = $start;
$ranking = $rank_old - $rank_new;
if ($ranking == "0") {
$parse['player_rankplus'] = "<font color=\"#87CEEB\">*</font>";
}
if ($ranking < "0") {
$parse['player_rankplus'] = "<font color=\"red\">".$ranking."</font>";
}
if ($ranking > "0") {
$parse['player_rankplus'] = "<font color=\"green\">+".$ranking."</font>";
}
if ($UsrRow['id'] == $user['id']) {
$parse['player_name'] = "<font color=\"lime\">".$UsrRow['username']."</font>";
} else {
$parse['player_name'] = $UsrRow['username'];
}
$parse['player_mes'] = "<a href=\"messages.php?mode=write&id=" . $UsrRow['id'] . "\"><img src=\"" . $dpath . "img/m.gif\" border=\"0\" alt=\"". $lang['Ecrire'] ."\" /></a>";
if ($UsrRow['ally_name'] == $user['ally_name']) {
$parse['player_alliance'] = "<font color=\"#33CCFF\">".$UsrRow['ally_name']."</font>";
} else {
$parse['player_alliance'] = $UsrRow['ally_name'];
}
$parse['player_points'] = pretty_number( $StatRow[ $Order ] );
$parse['stat_values'] .= parsetemplate(gettemplate('stat_playertable'), $parse);
$start++;
}
}
} else {
$MaxUsers = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE `db_deaktjava` = '0';", 'users', true);
if ($MaxUsers['count'] > 100) {
$LastPage = floor($MaxUsers['count'] / 100);
}
$parse['range'] = "";
for ($Page = 0; $Page <= $LastPage; $Page++) {
$PageValue = ($Page * 100) + 1;
$PageRange = $PageValue + 99;
$parse['range'] .= "<option value=\"". $PageValue ."\"". (($start == $PageValue) ? " SELECTED" : "") .">". $PageValue ."-". $PageRange ."</option>";
}
$page = parsetemplate( gettemplate('stat_body'), $parse );
$parse['stat_header'] = parsetemplate(gettemplate('stat_playertable_header'), $parse);
display($page, $lang['stat_title']);
$start = floor($range / 100 % 100) * 100;
$query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints');
$start++;
$parse['stat_date'] = $gameConfig['stats'];
$parse['stat_values'] = "";
while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) {
$parse['stat_date'] = date("d M Y - H:i:s", $StatRow['stat_date']);
$parse['player_rank'] = $start;
$UsrRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'users',true);
$QryUpdateStats .= "`stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
$rank_old = $StatRow[ $OldRank ];
if ( $rank_old == 0) {
$rank_old = $start;
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
} else {
$QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints");
}
$rank_new = $start;
$ranking = $rank_old - $rank_new;
if ($ranking == "0") {
$parse['player_rankplus'] = "<font color=\"#87CEEB\">*</font>";
}
if ($ranking < "0") {
$parse['player_rankplus'] = "<font color=\"red\">".$ranking."</font>";
}
if ($ranking > "0") {
$parse['player_rankplus'] = "<font color=\"green\">+".$ranking."</font>";
}
if ($UsrRow['id'] == $user['id']) {
$parse['player_name'] = "<font color=\"lime\">".$UsrRow['username']."</font>";
} else {
$parse['player_name'] = $UsrRow['username'];
}
$parse['player_mes'] = "<a href=\"messages.php?mode=write&id=" . $UsrRow['id'] . "\"><img src=\"" . $dpath . "img/m.gif\" border=\"0\" alt=\"". $lang['Ecrire'] ."\" /></a>";
if ($UsrRow['ally_name'] == $user['ally_name']) {
$parse['player_alliance'] = "<font color=\"#33CCFF\">".$UsrRow['ally_name']."</font>";
} else {
$parse['player_alliance'] = $UsrRow['ally_name'];
}
$parse['player_points'] = pretty_number( $StatRow[ $Order ] );
$parse['stat_values'] .= parsetemplate(gettemplate('stat_playertable'), $parse);
$start++;
}
}
$page = parsetemplate( gettemplate('stat_body'), $parse );
display($page, $lang['stat_title']);
// -----------------------------------------------------------------------------------------------------------
// History version