Updated themes

Updated buildings
Updated shipyard page (ships & defense)
Added Buildings building queue display & cancel build action.
Added research lab
Added navigation block structure
Removed old code
Updated registration
Added files to .gitignore

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2011-09-13 12:54:03 +02:00
commit 8f0f7a4d46
147 changed files with 3488 additions and 2468 deletions

View file

@ -28,9 +28,8 @@
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
define('LOGIN' , true);
define('INSIDE', true);
define('INSTALL', false);
define('DISABLE_IDENTITY_CHECK', true);
require_once dirname(__FILE__) . '/common.php';
@ -40,7 +39,7 @@ if (!empty($_POST) && isset($_POST['username']) && isset($_POST['password'])) {
$user = Legacies_Empire_Model_User::login($_POST['username'], $_POST['password'], isset($_POST['rememberme']) && !empty($_POST['rememberme']));
$session = Legacies::getSession(Legacies_Empire_Model_User::SESSION_KEY);
if ($user !== null) {
if ($user !== null && $user->getId()) {
header("Location: frames.php");
} else {
header("Location: login.php");
@ -48,18 +47,36 @@ if (!empty($_POST) && isset($_POST['username']) && isset($_POST['password'])) {
Legacies_Core_ErrorProfiler::unregister(true);
exit(0);
}
$parse = $lang;
$Count = doquery('SELECT COUNT(DISTINCT users.id) AS `players` FROM {{table}} AS users WHERE users.authlevel < 3', 'users', true);
$LastPlayer = doquery('SELECT users.`username` FROM {{table}} AS users ORDER BY `register_time` DESC LIMIT 1', 'users', true);
$parse['last_user'] = $LastPlayer['username'];
$PlayersOnline = doquery("SELECT COUNT(DISTINCT id) AS `onlinenow` FROM {{table}} AS users WHERE `onlinetime` > (UNIX_TIMESTAMP()-900) AND users.authlevel < 3", 'users', true);
$parse['online_users'] = $PlayersOnline['onlinenow'];
$parse['users_amount'] = $Count['players'];
$parse['servername'] = $gameConfig['game_name'];
$parse['forum_url'] = $gameConfig['forum_url'];
$parse['PasswordLost'] = $lang['PasswordLost'];
$page = parsetemplate(gettemplate('login_body'), $parse);
$db = Legacies_Database::getSingleton();
$displayedPlayerLevels = implode(',', array(
//LEVEL_ADMIN,
LEVEL_OPERATOR,
LEVEL_MODERATOR,
LEVEL_PLAYER
));
$userCountStatement = $db->prepare("SELECT COUNT(DISTINCT user.id) AS `user_count` FROM {$db->getTable('users')} AS user WHERE user.authlevel IN({$displayedPlayerLevels})");
$userCountStatement->execute();
$userCount = $userCountStatement->fetch(Legacies_Database::FETCH_COLUMN, 0);
display($page, $lang['Login'], false);
$latestPlayerStatement = $db->prepare("SELECT user.username AS `latest_player` FROM {$db->getTable('users')} AS user WHERE user.authlevel IN({$displayedPlayerLevels}) ORDER BY user.`register_time` DESC LIMIT 1");
$latestPlayerStatement->execute();
$latestPlayer = $latestPlayerStatement->fetch(Legacies_Database::FETCH_COLUMN, 0);
$onlinePlayersStatement = $db->prepare("SELECT COUNT(DISTINCT user.id) AS `online_players` FROM {$db->getTable('users')} AS user WHERE user.authlevel IN({$displayedPlayerLevels}) AND user.`onlinetime` > (UNIX_TIMESTAMP() - 900)");
$onlinePlayersStatement->execute();
$onlinePlayers = $onlinePlayersStatement->fetch(Legacies_Database::FETCH_COLUMN, 0);
$layout = new Legacies_Core_Layout();
$layout->load('login');
$block = $layout->getBlock('login');
$block['user_count'] = $userCount;
$block['latest_player'] = $latestPlayer;
$block['online_players'] = $onlinePlayers;
$block['server_name'] = $gameConfig['game_name'];
$block['board_url'] = $gameConfig['forum_url'];
echo $layout->render();