Skip to content

Commit

Permalink
Fixed login
Browse files Browse the repository at this point in the history
Started building page cleanup
Modified code pools
Backported layout/blocks/templates 3-step view system
Reforged Overview page
Moved graphics, added topnav template, fixed number render bug
Added BCMath optionnal usage
Updated BC Math comparison for capped resources
Fixed planet resource production updates
Various additions

Signed-off-by: Gregory PLANCHAT <[email protected]>
  • Loading branch information
gplanchat committed Jul 25, 2011
1 parent 3fd8832 commit f2d4b0f
Show file tree
Hide file tree
Showing 384 changed files with 2,727 additions and 1,364 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/config.php
2 changes: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SetEnv DEBUG On
SetEnv DEPRECATION Off
43 changes: 21 additions & 22 deletions buildings.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,32 @@
define('INSTALL' , false);
require_once dirname(__FILE__) .'/common.php';

includeLang('buildings');
includeLang('buildings');

// Mise a jour de la liste de construction si necessaire
UpdatePlanetBatimentQueueList ( $planetrow, $user );
$IsWorking = HandleTechnologieBuild ( $planetrow, $user );
$user = Legacies_Empire_Model_User::getSingleton();
$planet = $user->getCurrentPlanet();

switch ($_GET['mode']) {
case 'fleet':
// --------------------------------------------------------------------------------------------------
FleetBuildingPage ( $planetrow, $user );
break;
switch ($_GET['mode']) {
case 'fleet':
// --------------------------------------------------------------------------------------------------
FleetBuildingPage($planet, $user);
break;

case 'research':
// --------------------------------------------------------------------------------------------------
ResearchBuildingPage ( $planetrow, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] );
break;
case 'research':
// --------------------------------------------------------------------------------------------------
ResearchBuildingPage($planet, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] );
break;

case 'defense':
// --------------------------------------------------------------------------------------------------
DefensesBuildingPage ( $planetrow, $user );
break;
case 'defense':
// --------------------------------------------------------------------------------------------------
DefensesBuildingPage($planet, $user);
break;

default:
// --------------------------------------------------------------------------------------------------
BatimentBuildingPage ( $planetrow, $user );
break;
}
default:
// --------------------------------------------------------------------------------------------------
BatimentBuildingPage($planet, $user);
break;
}

// -----------------------------------------------------------------------------------------------------------
// History version
Expand Down
41 changes: 23 additions & 18 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,27 @@
*
*/

if (!defined('DEBUG') && in_array(strtolower(getenv('DEBUG')), array('1', 'on', 'true'))) {
define('DEPRECATION', true);
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'))) {
define('DEBUG', true);
}

if (!defined('DEPRECATION') && ($env = getenv('DEPRECATION')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
define('DEPRECATION', true);
} else if (!defined('DEPRECATION') && isset($_SERVER['DEPRECATION']) && in_array(strtolower($_SERVER['DEPRECATION']), array('1', 'on', 'true'))) {
define('DEPRECATION', true);
}

if (!defined('BCNUMBERS') && ($env = getenv('BCNUMBERS')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
define('BCNUMBERS', true);
} else if (!defined('BCNUMBERS') && isset($_SERVER['BCNUMBERS']) && in_array(strtolower($_SERVER['BCNUMBERS']), array('1', 'on', 'true'))) {
define('BCNUMBERS', true);
}

if (!defined('DEBUG')) {
@ini_set('display_errors', false);
} else {
Expand All @@ -47,6 +64,7 @@
defined('VERSION') || define('VERSION', '2011.1');

set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core',
Expand All @@ -57,7 +75,8 @@ function __autoload($class) {
include_once str_replace('_', '/', $class) . '.php';
}

Legacies_Core_Error::register();
Legacies_Core_Time::init();
Legacies_Core_ErrorProfiler::register();

if (0 === filesize(ROOT_PATH . 'config.php')) {
header('Location: install/');
Expand All @@ -72,7 +91,6 @@ function __autoload($class) {

$lang = array();

define('DEFAULT_SKINPATH', 'skins/xnova/');
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
define('TEMPLATE_NAME', 'OpenGame');
define('DEFAULT_LANG', 'fr');
Expand Down Expand Up @@ -110,30 +128,17 @@ function __autoload($class) {
includeLang('system');
includeLang('tech');

include(ROOT_PATH . 'rak.php');

$dpath = DEFAULT_SKINPATH;
if (($user !== null && $user->getId())) {
$dpath = $user->getSkinPath();

if (empty($dpath)) {
$dpath = DEFAULT_SKINPATH;
}

if (defined('IN_ADMIN')) {
$dpath = '../' . $dpath;
}

if (isset($_GET['cp']) && !empty($_GET['cp'])) {
$user->updateCurrentPlanet((int) $_GET['cp']);
}

$planet = $user->getCurrentPlanet();

foreach ($user->getPlanetCollection() as $planet) {
FlyingFleetHandler($planet); // TODO: implement logic into a refactored model
}

$planet = $user->getCurrentPlanet();

/*
* Update planet resources and constructions
*/
Expand Down
21 changes: 21 additions & 0 deletions config.php.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php return array(
'global' => array(
'date' => array(
'timezone' => 'Europe/Paris'
),
'database' => array(
'engine' => 'mysql',
'options' => array(
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'db_xnova'
),
'table_prefix' => 'game_',
),
'layout' => array(
'page' => 'page.php',
'empire' => 'empire.php'
)
)
);
80 changes: 16 additions & 64 deletions frames.php
Original file line number Diff line number Diff line change
@@ -1,64 +1,16 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing XNova.
*
*/

define('INSIDE' , true);
define('INSTALL' , false);

$XNova_Host = $_SERVER['HTTP_HOST'];
$XNova_Script = $_SERVER['SCRIPT_NAME'];
$Uri_Array = explode ('/', $XNova_Script);
// On vire le script
array_pop($Uri_Array);
$XNova_URI = implode ('/', $Uri_Array);

$XNovaRootURL = "http://". $XNova_Host ."/". $XNova_URI ."/";

require_once dirname(__FILE__) .'/common.php';

$page = "<html>";
$page .= "<head>";
$page .= "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=". $langInfos['ENCODING']."\">";
$page .= "<link rel=\"shortcut icon\" href=\"favicon.ico\">";
$page .= "<title>". $gameConfig['game_name'] ."</title>";
$page .= "</head>";

$page .= "<frameset framespacing=\"0\" border=\"0\" cols=\"190,*\" frameborder=\"0\">";
$page .= "<frame name=\"LeftMenu\" target=\"Mainframe\" src=\"leftmenu.php\" noresize scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\">";
$page .= "<frame name=\"Hauptframe\" src=\"overview.php\">";
$page .= "<noframes>";
$page .= "<body>";
$page .= "<p>Votre navigateur ne gère pas les frames.</p>";
$page .= "</noframes>";
$page .= "</frameset>";
$page .= "</body>";
$page .= "</html>";

echo $page;

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico">
<title>XNova:Legacies</title>
</head>
<frameset framespacing="0" border="0" cols="190,*" frameborder="0">
<frame name="LeftMenu" target="Mainframe" src="leftmenu.php" noresize scrolling="no" marginwidth="0" marginheight="0">
<frame name="Hauptframe" src="overview.php">
<noframes>
<body>
<p>Votre navigateur ne gère pas les frames.</p>
</body>
</noframes>
</frameset>
</html>
Empty file.
70 changes: 0 additions & 70 deletions includes/application/code/community/Legacies/Core/View.php

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f2d4b0f

Please sign in to comment.