mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-18 08:07:18 +00:00
Add Multi-Instance Server
Add Multi-Instance Server (3 servers) - must define in index.php homepage servers
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename links.tpl ##
|
||||
## Developed by: Slim, Manuel Mannhardt ##
|
||||
## Refactored by: Shadow Incremental Refactor ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## Refactor notes: ##
|
||||
## - păstrată logica originală 100% ##
|
||||
## - compatibil PHP 5.6+ / 7+ ##
|
||||
## - redus cod duplicat ##
|
||||
## - securizare output HTML ##
|
||||
## - protecție basic URL ##
|
||||
## - comentarii adăugate ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
?>
|
||||
<p class="date"><?php echo TZ_RELEASE_BY_TRAVIANZ; ?></p>
|
||||
<p><?php echo TZ_THANK_YOU_FOR_USING_OUR_VERSION; ?></p>
|
||||
<?php
|
||||
/*
|
||||
* ANOMALIE / NOTA: lista de mai jos e text static in engleza, scris direct
|
||||
* aici (nu trece prin sistemul de traduceri ca restul liniilor de mai sus,
|
||||
* care folosesc constante TZ_*). Editeaz-o direct in fisierul asta cand
|
||||
* publici alte noutati.
|
||||
*/
|
||||
?>
|
||||
<ul>
|
||||
<li>T4 Hero system implemented - recruit, train and grow your Hero.</li>
|
||||
<li>New Alliance bonuses for all alliance members.</li>
|
||||
<li>Various other improvements and features added since the T4 update.</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename menu.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## Refactored by: Shadow Incremental Refactor ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## ##
|
||||
## Incremental Refactor Notes: ##
|
||||
## - Preserved original logic and HTML structure ##
|
||||
## - Compatible with older PHP 7+ environments ##
|
||||
## - Reduced duplicated conditions and echoes ##
|
||||
## - Added safer isset() checks for legacy compatibility ##
|
||||
## - Added comments for maintainability ##
|
||||
## - No functional behavior changed ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
include_once("GameEngine/Generator.php");
|
||||
|
||||
/**
|
||||
* Start page load timer
|
||||
*/
|
||||
$start_timer = $generator->pageLoadTimeStart();
|
||||
|
||||
/**
|
||||
* Helper variables
|
||||
* Avoid repeated isset() and direct $_SESSION access
|
||||
*/
|
||||
$isLoggedIn = !empty($session->logged_in);
|
||||
$isPlus = !empty($session->plus);
|
||||
$isAdmin = (isset($session->access) && $session->access == ADMIN);
|
||||
$isMH = (isset($session->access) && $session->access == MULTIHUNTER);
|
||||
$userId = isset($session->uid) ? (int)$session->uid : 0;
|
||||
$username = isset($session->username) ? $session->username : '';
|
||||
$sessionOk = (isset($_SESSION['ok']) && $_SESSION['ok'] == 1);
|
||||
$idUser = isset($_SESSION['id_user']) ? (int)$_SESSION['id_user'] : 0;
|
||||
?>
|
||||
<?php if(!$isLoggedIn) { ?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
|
||||
<style type="text/css">
|
||||
div.c1 {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="side_navi">
|
||||
|
||||
<a id="logo" href="<?php echo defined('MI_HOMEPAGE_OVERRIDE') ? MI_HOMEPAGE_OVERRIDE : HOMEPAGE; ?>" name="logo">
|
||||
<img src="img/x.gif" alt="<?php echo TZ_TRAVIAN; ?>">
|
||||
</a>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo defined('MI_HOMEPAGE_OVERRIDE') ? MI_HOMEPAGE_OVERRIDE : HOMEPAGE; ?>">
|
||||
<?php echo HOME; ?>
|
||||
</a>
|
||||
|
||||
<a href="login.php">
|
||||
<?php echo LOGIN; ?>
|
||||
</a>
|
||||
|
||||
<a href="anmelden.php">
|
||||
<?php echo REG; ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<div id="side_navi">
|
||||
|
||||
<!-- Logo -->
|
||||
<a id="logo" href="<?php echo HOMEPAGE; ?>" name="logo">
|
||||
<img
|
||||
src="img/x.gif"
|
||||
<?php if($isPlus) { echo 'class="logo_plus"'; } ?>
|
||||
alt="<?php echo TZ_TRAVIAN; ?>"
|
||||
>
|
||||
</a>
|
||||
|
||||
<!-- Main navigation -->
|
||||
<p>
|
||||
|
||||
<a href="<?php echo HOMEPAGE; ?>">
|
||||
<?php echo HOME; ?>
|
||||
</a>
|
||||
|
||||
<a href="#" onclick="return Popup(0,0,1);">
|
||||
<?php echo $lang['index'][0][2]; ?>
|
||||
</a>
|
||||
|
||||
<a href="spieler.php?uid=<?php echo $userId; ?>">
|
||||
<?php echo PROFILE; ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Multihunter links
|
||||
*/
|
||||
if($isMH) {
|
||||
?>
|
||||
<a href="Admin/admin.php">
|
||||
<font color="Blue"><?php echo MH_PANEL; ?></font>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin links
|
||||
*/
|
||||
if($isAdmin) {
|
||||
?>
|
||||
<a href="Admin/admin.php">
|
||||
<font color="Red"><?php echo ADMIN_PANEL; ?></font>
|
||||
</a>
|
||||
|
||||
<a href="build_croppers.php">
|
||||
<?php echo TZ_BUILD_CROPPER; ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="logout.php">
|
||||
<?php echo LOGOUT; ?>
|
||||
</a>
|
||||
|
||||
</p>
|
||||
|
||||
<!-- Forum -->
|
||||
<p>
|
||||
<a href="allianz.php?s=2">
|
||||
<?php echo FORUM; ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<!-- Discord -->
|
||||
<p>
|
||||
<a href="https://discord.gg/Bg9w8w9ft" target="_blank" rel="noopener noreferrer" style="color: #d32f2f; font-weight: bold;">
|
||||
Discord
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<!-- Plus / Support / Custom links -->
|
||||
<p>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Hide support-only links from support account
|
||||
*/
|
||||
if($idUser != 1) {
|
||||
?>
|
||||
<a href="plus.php?id=3">
|
||||
<?php echo TZ_TRAVIANZ; ?>
|
||||
<b>
|
||||
<span class="plus_g">P</span>
|
||||
<span class="plus_o">l</span>
|
||||
<span class="plus_g">u</span>
|
||||
<span class="plus_o">s</span>
|
||||
</b>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Support profile link
|
||||
*/
|
||||
if($idUser != 1) {
|
||||
?>
|
||||
<a href="spieler.php?uid=1">
|
||||
<?php echo SUPPORT; ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional external/custom links
|
||||
*/
|
||||
if(defined('NEW_FUNCTIONS_DISPLAY_LINKS') && NEW_FUNCTIONS_DISPLAY_LINKS) {
|
||||
include("Templates/links.tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* Natars include
|
||||
*/
|
||||
include("Templates/natars.tpl");
|
||||
|
||||
/**
|
||||
* Maintenance status for admins
|
||||
*/
|
||||
include("Templates/maintenance_status.tpl");
|
||||
|
||||
/**
|
||||
* Debug Error Log quick toggle for admins
|
||||
*/
|
||||
include("Templates/debug_status.tpl");
|
||||
|
||||
?>
|
||||
|
||||
</p>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Account deletion countdown
|
||||
*/
|
||||
$timestamp = $database->isDeleting($userId);
|
||||
|
||||
if($timestamp) {
|
||||
|
||||
echo '<br /><td colspan="2" class="count">';
|
||||
|
||||
/**
|
||||
* Allow cancellation if more than 48h remain
|
||||
*/
|
||||
if($timestamp > (time() + 172800)) {
|
||||
|
||||
echo '<a href="spieler.php?s=3&id=' . $userId . '&a=1&e=4">
|
||||
<img
|
||||
class="del"
|
||||
src="img/x.gif"
|
||||
alt="'.CANCEL_PROCESS.'"
|
||||
title="'.CANCEL_PROCESS.'"
|
||||
/>
|
||||
</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Remaining deletion time
|
||||
*/
|
||||
$time = $generator->getTimeFormat($timestamp - time());
|
||||
|
||||
echo '<a href="spieler.php?s=3">
|
||||
The account will be deleted in
|
||||
<span id="timer' . ++$session->timer . '">
|
||||
' . $time . '
|
||||
</span>.
|
||||
</a>';
|
||||
|
||||
echo '</td><br />';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Live "local time" clock (issue #198): show a second clock next to the
|
||||
* server-time one, ticking in the player's chosen timezone. The server-time
|
||||
* block lives in each page's own footer (rendered after this menu), so we wait
|
||||
* for the DOM and target the last #tp1 (the visible one). Vanilla JS, driven by
|
||||
* Date.now() + the player's UTC offset, so it is independent of the browser
|
||||
* timezone and does not touch the unx.js tp+i counters (arrival timers).
|
||||
*
|
||||
* Skipped entirely when the player's timezone matches the server's, so no
|
||||
* redundant line is shown.
|
||||
*/
|
||||
$localOffset = (int) $generator->userTimeZoneOffset();
|
||||
$serverOffset = (int) date('Z');
|
||||
if ($localOffset !== $serverOffset):
|
||||
?>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var anchors = document.querySelectorAll('#tp1');
|
||||
if (!anchors.length) return;
|
||||
var tp = anchors[anchors.length - 1];
|
||||
var off = <?php echo $localOffset; ?> * 1000;
|
||||
var label = <?php echo json_encode(LOCAL_TIME); ?>;
|
||||
|
||||
var br = document.createElement('br');
|
||||
var lbl = document.createElement('span');
|
||||
lbl.appendChild(document.createTextNode(label + ' '));
|
||||
var val = document.createElement('span');
|
||||
val.className = 'b';
|
||||
|
||||
var parent = tp.parentNode, next = tp.nextSibling;
|
||||
parent.insertBefore(br, next);
|
||||
parent.insertBefore(lbl, next);
|
||||
parent.insertBefore(val, next);
|
||||
|
||||
// align the local-time value vertically under the server-time value
|
||||
var delta = tp.offsetLeft - val.offsetLeft;
|
||||
if (delta > 0) {
|
||||
lbl.style.display = 'inline-block';
|
||||
lbl.style.width = (lbl.offsetWidth + delta) + 'px';
|
||||
}
|
||||
|
||||
// make room for the extra line and lift the block so it stays in the frame
|
||||
var box = tp;
|
||||
while (box && box.id !== 'ltime') box = box.parentNode;
|
||||
if (box) {
|
||||
box.style.height = 'auto';
|
||||
var top = parseInt(window.getComputedStyle(box).top, 10);
|
||||
if (!isNaN(top)) box.style.top = (top - 8) + 'px';
|
||||
}
|
||||
|
||||
function p(n) { return n < 10 ? '0' + n : n; }
|
||||
function tick() {
|
||||
var d = new Date(Date.now() + off);
|
||||
val.innerHTML = p(d.getUTCHours()) + ':' + p(d.getUTCMinutes()) + ':' + p(d.getUTCSeconds());
|
||||
}
|
||||
tick();
|
||||
setInterval(tick, 1000);
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Announcement screen
|
||||
*/
|
||||
if($sessionOk) {
|
||||
?>
|
||||
|
||||
<div id="content" class="village1">
|
||||
|
||||
<h1>
|
||||
<?php echo ANNOUNCEMENT; ?>
|
||||
</h1>
|
||||
|
||||
<br />
|
||||
|
||||
<h3>
|
||||
Hi <?php echo $username; ?>,
|
||||
</h3>
|
||||
|
||||
<?php include("Templates/text.tpl"); ?>
|
||||
|
||||
<div class="c1">
|
||||
|
||||
<br />
|
||||
|
||||
<h3>
|
||||
<a href="dorf1.php?ok">
|
||||
» <?php echo GO2MY_VILLAGE; ?>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br /><br /><br /><br />
|
||||
|
||||
<div id="side_info">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Right-side widgets
|
||||
*/
|
||||
include("Templates/multivillage.tpl");
|
||||
include("Templates/quest.tpl");
|
||||
include("Templates/news.tpl");
|
||||
|
||||
/**
|
||||
* Show links in sidebar if not displayed above
|
||||
*/
|
||||
if(
|
||||
defined('NEW_FUNCTIONS_DISPLAY_LINKS')
|
||||
&& !NEW_FUNCTIONS_DISPLAY_LINKS
|
||||
) {
|
||||
echo "<br><br><br><br>";
|
||||
include("Templates/links.tpl");
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="footer-stopper"></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Footer includes
|
||||
*/
|
||||
include("Templates/footer.tpl");
|
||||
include("Templates/res.tpl");
|
||||
?>
|
||||
|
||||
<div id="stime">
|
||||
|
||||
<div id="ltime">
|
||||
|
||||
<div id="ltimeWrap">
|
||||
|
||||
<?php echo CALCULATED_IN; ?>
|
||||
|
||||
<b>
|
||||
<?php
|
||||
echo round(
|
||||
($generator->pageLoadTimeEnd() - $start_timer) * 1000
|
||||
);
|
||||
?>
|
||||
</b>
|
||||
|
||||
ms
|
||||
|
||||
<br />
|
||||
|
||||
<?php echo SERVER_TIME; ?>
|
||||
|
||||
<span id="tp1" class="b">
|
||||
<?php echo date('H:i:s'); ?>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="ce"></div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Stop execution after announcement page
|
||||
*/
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,571 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename : anmelden.php ##
|
||||
## Type : In Game Registration Page (3 step wizard) ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## URLs: : https://travianz.org ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
use App\Utils\AccessLogger;
|
||||
|
||||
if(!file_exists('var/installed') && @opendir('install')) {
|
||||
header("Location: install/");
|
||||
exit;
|
||||
}
|
||||
|
||||
include('GameEngine/Account.php');
|
||||
AccessLogger::logRequest();
|
||||
|
||||
$invited=(isset($_GET['uid'])) ? filter_var($_GET['uid'], FILTER_SANITIZE_NUMBER_INT):$form->getError('invt');
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------------
|
||||
* Registration wizard data
|
||||
* ---------------------------------------------------------------------------
|
||||
* Every label below can be overridden from the language files: if a constant
|
||||
* with the given name exists it wins, otherwise the English fallback is used.
|
||||
* No changes are required in lang/*.php for the page to work.
|
||||
*/
|
||||
if (!function_exists('regText')) {
|
||||
function regText($constant, $fallback) {
|
||||
return defined($constant) ? constant($constant) : $fallback;
|
||||
}
|
||||
}
|
||||
|
||||
/* id => tribe definition. The order of this array is the order of the cards. */
|
||||
$regTribes = array(
|
||||
3 => array( /* Gauls */
|
||||
'name' => TRIBE3,
|
||||
'flag' => true,
|
||||
'best' => true,
|
||||
'lines' => array(
|
||||
regText('TRIBE3_L1', 'Low time requirements'),
|
||||
regText('TRIBE3_L2', 'Loot protection and good defense'),
|
||||
regText('TRIBE3_L3', 'Excellent, fast cavalry'),
|
||||
regText('TRIBE3_L4', 'Well suited to new players'),
|
||||
),
|
||||
),
|
||||
1 => array( /* Romans */
|
||||
'name' => TRIBE1,
|
||||
'flag' => true,
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE1_L1', 'Moderate time requirements'),
|
||||
regText('TRIBE1_L2', 'Can develop villages the fastest'),
|
||||
regText('TRIBE1_L3', 'Very strong but expensive troops'),
|
||||
regText('TRIBE1_L4', 'Hard to play for new players'),
|
||||
),
|
||||
),
|
||||
2 => array( /* Teutons */
|
||||
'name' => TRIBE2,
|
||||
'flag' => true,
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE2_L1', 'High time requirements'),
|
||||
regText('TRIBE2_L2', 'Good at looting in early game'),
|
||||
regText('TRIBE2_L3', 'Strong, cheap infantry'),
|
||||
regText('TRIBE2_L4', 'For aggressive players'),
|
||||
),
|
||||
),
|
||||
7 => array( /* Egyptians */
|
||||
'name' => defined('TRIBE7') ? TRIBE7 : 'Egyptians',
|
||||
'flag' => (defined('NEW_FUNCTION_TRIBE_EGIPTEANS') && NEW_FUNCTION_TRIBE_EGIPTEANS),
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE7_L1', 'Low time requirements'),
|
||||
regText('TRIBE7_L2', 'More resources available'),
|
||||
regText('TRIBE7_L3', 'Excellent defensive units'),
|
||||
regText('TRIBE7_L4', 'Well suited to new players'),
|
||||
),
|
||||
),
|
||||
6 => array( /* Huns */
|
||||
'name' => defined('TRIBE6') ? TRIBE6 : 'Huns',
|
||||
'flag' => (defined('NEW_FUNCTION_TRIBE_HUNS') && NEW_FUNCTION_TRIBE_HUNS),
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE6_L1', 'High time requirements'),
|
||||
regText('TRIBE6_L2', 'Impressively strong cavalry'),
|
||||
regText('TRIBE6_L3', 'Reliant on others for protection'),
|
||||
regText('TRIBE6_L4', 'Not recommended for new players!'),
|
||||
),
|
||||
),
|
||||
8 => array( /* Spartans */
|
||||
'name' => defined('TRIBE8') ? TRIBE8 : 'Spartans',
|
||||
'flag' => (defined('NEW_FUNCTION_TRIBE_SPARTANS') && NEW_FUNCTION_TRIBE_SPARTANS),
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE8_L1', 'Moderate time requirements'),
|
||||
regText('TRIBE8_L2', 'Efficient crop consumption'),
|
||||
regText('TRIBE8_L3', 'Easier recovery from battles'),
|
||||
regText('TRIBE8_L4', 'Recommended for active new players'),
|
||||
),
|
||||
),
|
||||
9 => array( /* Vikings */
|
||||
'name' => defined('TRIBE9') ? TRIBE9 : 'Vikings',
|
||||
'flag' => (defined('NEW_FUNCTION_TRIBE_VIKINGS') && NEW_FUNCTION_TRIBE_VIKINGS),
|
||||
'best' => false,
|
||||
'lines' => array(
|
||||
regText('TRIBE9_L1', 'High time requirements'),
|
||||
regText('TRIBE9_L2', 'Fearless raiders, strong offense'),
|
||||
regText('TRIBE9_L3', 'Weak defense in the early game'),
|
||||
regText('TRIBE9_L4', 'Not recommended for new players!'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Drop every tribe that is disabled by the install feature flags. */
|
||||
foreach ($regTribes as $tribeId => $tribeData) {
|
||||
if (!$tribeData['flag']) {
|
||||
unset($regTribes[$tribeId]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Starting positions: 0 = random, 1 = NW (-|+), 2 = NE (+|+), 3 = SW (-|-), 4 = SE (+|-) */
|
||||
$regQuadrants = array(
|
||||
0 => array('name' => RANDOM, 'coords' => ''),
|
||||
1 => array('name' => NW, 'coords' => '(-|+)'),
|
||||
2 => array('name' => NE, 'coords' => '(+|+)'),
|
||||
3 => array('name' => SW, 'coords' => '(-|-)'),
|
||||
4 => array('name' => SE, 'coords' => '(+|-)'),
|
||||
);
|
||||
|
||||
/* Values coming back from a failed POST (Account::Signup redirects here). */
|
||||
$regErrors = ($form->returnErrors() > 0);
|
||||
$regTribe = (int) $form->getValue('vid');
|
||||
if (!isset($regTribes[$regTribe])) {
|
||||
reset($regTribes);
|
||||
$regTribe = (int) key($regTribes); // first card = Gauls (the recommended tribe)
|
||||
}
|
||||
$regQuad = (int) $form->getValue('kid');
|
||||
if (!isset($regQuadrants[$regQuad])) {
|
||||
$regQuad = 0;
|
||||
}
|
||||
/* When the server rejected the form we jump straight back to the recap step. */
|
||||
$regStep = $regErrors ? 3 : 1;
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo SERVER_NAME; ?> - Registration</title>
|
||||
<link rel="shortcut icon" href="favicon.ico"/>
|
||||
<meta name="content-language" content="en" />
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<script src="mt-core.js?0faab" type="text/javascript"></script>
|
||||
<script src="mt-more.js?0faab" type="text/javascript"></script>
|
||||
<script src="unx.js?f4b7h" type="text/javascript"></script>
|
||||
<script src="new.js?0faab" type="text/javascript"></script>
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE ?>travian.css?f4b7d" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE ?>lang/en/lang.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style type="text/css">
|
||||
/* ======================================================================== */
|
||||
/* Registration wizard - fits inside the original #content.signup column */
|
||||
/* ======================================================================== */
|
||||
#regwiz{position:relative;width:100%;max-width:520px;margin:0 auto 10px;text-align:left;
|
||||
font-family:Arial,Helvetica,sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}
|
||||
#regwiz *{-webkit-box-sizing:border-box;box-sizing:border-box}
|
||||
|
||||
/* --- window chrome (sliced from the original artwork) ------------------- */
|
||||
.rw-hdr{position:relative;height:72px;background:url(img/reg/hdr_c.png) repeat-x left top;padding:26px 56px 0}
|
||||
.rw-hdr:before,.rw-hdr:after{content:'';position:absolute;top:0;width:48px;height:72px}
|
||||
.rw-hdr:before{left:0;background:url(img/reg/hdr_l.png) no-repeat left top}
|
||||
.rw-hdr:after{right:0;background:url(img/reg/hdr_r.png) no-repeat left top}
|
||||
.rw-hdr span{display:block;font:bold 19px/20px "Times New Roman",Georgia,serif;color:#f3ece1;
|
||||
letter-spacing:.5px;text-shadow:1px 1px 1px rgba(60,45,25,.85)}
|
||||
.rw-body{position:relative;padding:12px 18px 6px;
|
||||
background:url(img/reg/side_l.png) repeat-y left top,
|
||||
url(img/reg/side_r.png) repeat-y right top,
|
||||
url(img/reg/silhouettes.png) no-repeat center bottom,
|
||||
#f4efe5;
|
||||
background-size:9px auto,9px auto,100% auto,auto}
|
||||
.rw-bot{position:relative;height:16px;background:url(img/reg/bot_c.png) repeat-x left top}
|
||||
.rw-bot:before,.rw-bot:after{content:'';position:absolute;top:0;width:48px;height:16px}
|
||||
.rw-bot:before{left:0;background:url(img/reg/bot_l.png) no-repeat left top}
|
||||
.rw-bot:after{right:0;background:url(img/reg/bot_r.png) no-repeat left top}
|
||||
|
||||
.rw-step{display:none}
|
||||
.rw-step.on{display:block}
|
||||
.rw-intro{margin:2px 0 12px;font:bold 12px/17px Arial,Helvetica,sans-serif;color:#6a5c4a}
|
||||
|
||||
/* --- step 1 : tribe cards ----------------------------------------------- */
|
||||
.rw-thumbs{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;
|
||||
-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:0 0 16px;padding:0;list-style:none}
|
||||
.rw-thumb{position:relative;-webkit-box-flex:1;-ms-flex:1 1 44px;flex:1 1 44px;max-width:64px;margin:0 2px;
|
||||
padding:2px;background:#f6f0e2;border:2px solid #a58e60;border-radius:3px;cursor:pointer;
|
||||
box-shadow:inset 0 0 2px rgba(0,0,0,.15)}
|
||||
.rw-thumb img{display:block;width:100%;height:auto;border:0}
|
||||
.rw-thumb:hover{border-color:#c9ad72}
|
||||
.rw-thumb.sel{border-color:#5e8c2d;box-shadow:0 0 4px rgba(94,140,45,.65)}
|
||||
.rw-thumb.sel:before,.rw-thumb.sel:after{content:'';position:absolute;left:50%;width:0;height:0}
|
||||
.rw-thumb.sel:before{bottom:-16px;margin-left:-11px;border-left:11px solid transparent;
|
||||
border-right:11px solid transparent;border-bottom:14px solid #a58e60}
|
||||
.rw-thumb.sel:after{bottom:-13px;margin-left:-8px;border-left:8px solid transparent;
|
||||
border-right:8px solid transparent;border-bottom:10px solid #6fa03a}
|
||||
|
||||
.rw-panel{position:relative;height:212px;padding:14px 16px;background:#eee4cc;border:1px solid #bfaf9c;
|
||||
border-radius:4px;box-shadow:0 2px 3px rgba(0,0,0,.16);overflow:hidden}
|
||||
.rw-info{display:none}
|
||||
.rw-info.on{display:block}
|
||||
.rw-name{margin:2px 0 12px;font:bold 26px/26px "Times New Roman",Georgia,serif;color:#7c2f22;
|
||||
text-transform:uppercase;letter-spacing:1px}
|
||||
.rw-lines{margin:0;padding:0;list-style:none;position:relative;z-index:2}
|
||||
.rw-lines li{min-height:24px;padding:3px 0 3px 30px;font:bold 12px/18px Arial,Helvetica,sans-serif;color:#5b4a36;
|
||||
background-repeat:no-repeat;background-position:0 50%;background-size:20px auto}
|
||||
.rw-portrait{position:absolute;right:0;bottom:0;height:100%;width:auto;z-index:1;border:0}
|
||||
.rw-badge{position:absolute;top:-2px;right:38%;width:150px;max-width:31%;z-index:3;border:0}
|
||||
|
||||
/* --- step 2 : starting position ----------------------------------------- */
|
||||
.rw-map{position:relative;width:340px;max-width:100%;margin:0 auto 4px}
|
||||
.rw-map img.rw-mapbg{display:block;width:100%;height:auto;border:0}
|
||||
.rw-q{position:absolute;cursor:pointer;border-radius:2px}
|
||||
.rw-q1{left:7.3%;top:7.9%;width:43.5%;height:43.6%}
|
||||
.rw-q2{left:51.1%;top:7.9%;width:44.2%;height:43.6%}
|
||||
.rw-q3{left:7.3%;top:51.8%;width:43.5%;height:42.9%}
|
||||
.rw-q4{left:51.1%;top:51.8%;width:44.2%;height:42.9%}
|
||||
.rw-q:hover{background:rgba(255,255,255,.22)}
|
||||
.rw-map.picked .rw-q{background:rgba(0,0,0,.075)}
|
||||
.rw-map.picked .rw-q:hover{background:rgba(0,0,0,.03)}
|
||||
.rw-map.picked .rw-q.sel{background:none;box-shadow:inset 0 0 0 2px rgba(95,140,45,.85)}
|
||||
.rw-rand{display:block;width:200px;margin:10px auto 0;padding:5px 0;text-align:center;cursor:pointer;
|
||||
font:bold 12px Arial,Helvetica,sans-serif;color:#5b4a36;background:#eee4cc;border:1px solid #bfaf9c;
|
||||
border-radius:3px}
|
||||
.rw-rand.sel{border-color:#5e8c2d;color:#3f5d1e;box-shadow:0 0 3px rgba(94,140,45,.5)}
|
||||
|
||||
/* --- step 3 : recap ------------------------------------------------------ */
|
||||
.rw-cards{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;
|
||||
justify-content:center;margin:4px 0 14px}
|
||||
.rw-card{position:relative;width:47%;margin:0 2.5%;padding:8px 8px 26px;background:#eee4cc;border:1px solid #bfaf9c;
|
||||
border-radius:4px;box-shadow:0 2px 3px rgba(0,0,0,.16);text-align:center}
|
||||
.rw-card h3{margin:2px 0 6px;font:bold 20px/22px "Times New Roman",Georgia,serif;color:#7c2f22;
|
||||
text-transform:uppercase;letter-spacing:1px}
|
||||
.rw-pic{height:172px;background-position:center bottom;background-repeat:no-repeat;background-size:cover;border-radius:2px}
|
||||
.rw-pic-tribe{background-size:auto 100%}
|
||||
.rw-change{position:absolute;left:0;bottom:6px;width:100%;text-align:center;cursor:pointer;
|
||||
font:bold 12px Arial,Helvetica,sans-serif;color:#5c8a1f}
|
||||
.rw-change:hover{text-decoration:underline}
|
||||
.rw-field{margin:0 0 8px}
|
||||
.rw-field label{display:block;margin:0 0 3px;font:bold 12px Arial,Helvetica,sans-serif;color:#5b4a36}
|
||||
.rw-field input.rw-text{width:100%;height:32px;padding:0 8px;border:1px solid #b9ab93;border-radius:3px;
|
||||
background:#fff;font:14px Arial,Helvetica,sans-serif;color:#3f3628}
|
||||
.rw-field .error{display:block;font:bold 11px Arial;color:#c0392b}
|
||||
.rw-note{margin:8px 0 10px;padding:9px 10px 9px 36px;background:#dfe7f5;border:1px solid #b9c9e2;border-radius:3px;
|
||||
font:12px/16px Arial,Helvetica,sans-serif;color:#3f4a5c;position:relative}
|
||||
.rw-note:before{content:'i';position:absolute;left:10px;top:50%;margin-top:-8px;width:16px;height:16px;
|
||||
border-radius:8px;background:#3f6fb5;color:#fff;font:bold 11px/16px Georgia,serif;text-align:center}
|
||||
.rw-agree{margin:0 0 4px;font:bold 12px/16px Arial,Helvetica,sans-serif;color:#5b4a36}
|
||||
.rw-agree input{vertical-align:middle;margin:0 5px 2px 0}
|
||||
ul.rw-err{margin:0 0 6px;padding:0 0 0 16px;color:#c0392b;font:bold 12px/17px Arial}
|
||||
|
||||
/* --- buttons ------------------------------------------------------------- */
|
||||
.rw-btn{display:block;width:260px;max-width:90%;height:49px;margin:14px auto 6px;padding:0;border:0;cursor:pointer;
|
||||
background:url(img/reg/btn_green.png) no-repeat center center;background-size:100% 100%;
|
||||
font:bold 17px/49px "Times New Roman",Georgia,serif;color:#fff;letter-spacing:.5px;
|
||||
text-shadow:0 1px 2px rgba(0,0,0,.55)}
|
||||
.rw-btn:hover{-webkit-filter:brightness(1.08);filter:brightness(1.08)}
|
||||
.rw-back{display:block;margin:4px 0 0;font:bold 12px Arial;color:#5c8a1f;cursor:pointer}
|
||||
.rw-back:hover{text-decoration:underline}
|
||||
.rw-foot{margin:2px 0 0;text-align:center;font:11px Arial;color:#8a7a63}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="v35 ie ie7" onload="initCounter()">
|
||||
|
||||
<div class="wrapper">
|
||||
<div id="dynamic_header">
|
||||
</div>
|
||||
<div id="header"></div>
|
||||
<div id="mid">
|
||||
<?php
|
||||
/*
|
||||
* Multi-instance server: butonul "Homepage" din meniul de mai jos trebuie
|
||||
* sa duca mereu la hub-ul central (travianz.org), indiferent pe ce
|
||||
* subdomeniu (world) ruleaza aceasta instalare - nu la HOMEPAGE local din
|
||||
* config.php al acestui world. Constanta e citita doar de Templates/menu.tpl,
|
||||
* doar in ramura "vizitator neautentificat" (exact ce se randeaza pe anmelden.php),
|
||||
* deci nu schimba nimic in meniul din joc (dupa autentificare).
|
||||
*/
|
||||
define('MI_HOMEPAGE_OVERRIDE', 'https://travianz.org/');
|
||||
include("Templates/menu.tpl");
|
||||
if(REG_OPEN == true){ ?>
|
||||
<div id="content" class="signup">
|
||||
|
||||
<h1><img src="img/x.gif" class="anmelden" alt="register for the game" /></h1>
|
||||
|
||||
<form name="snd" method="post" action="anmelden.php" id="regform">
|
||||
<input type="hidden" name="invited" value="<?php echo htmlspecialchars($invited, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||
<input type="hidden" name="ft" value="a1" />
|
||||
<input type="hidden" name="vid" id="rw_vid" value="<?php echo (int) $regTribe; ?>" />
|
||||
<input type="hidden" name="kid" id="rw_kid" value="<?php echo (int) $regQuad; ?>" />
|
||||
|
||||
<div id="regwiz" data-step="<?php echo (int) $regStep; ?>">
|
||||
<div class="rw-hdr"><span id="rw_title"> </span></div>
|
||||
<div class="rw-body">
|
||||
|
||||
<!-- =============== STEP 1 : tribe =============== -->
|
||||
<div class="rw-step" id="rw_step1">
|
||||
<p class="rw-intro"><?php echo regText('REG_TRIBE_INTRO', 'Great empires begin with important decisions! Are you an attacker who loves competition? Or is your time investment rather low? Are you a team player who enjoys building up a thriving economy to forge the anvil?'); ?></p>
|
||||
|
||||
<ul class="rw-thumbs">
|
||||
<?php foreach ($regTribes as $tribeId => $tribeData) { ?>
|
||||
<li class="rw-thumb<?php echo ($tribeId == $regTribe) ? ' sel' : ''; ?>" data-vid="<?php echo (int) $tribeId; ?>" title="<?php echo htmlspecialchars($tribeData['name'], ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<img src="img/reg/thumb_v<?php echo (int) $tribeId; ?>.png" alt="<?php echo htmlspecialchars($tribeData['name'], ENT_QUOTES, 'UTF-8'); ?>" />
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<div class="rw-panel">
|
||||
<?php foreach ($regTribes as $tribeId => $tribeData) { ?>
|
||||
<div class="rw-info<?php echo ($tribeId == $regTribe) ? ' on' : ''; ?>" id="rw_info<?php echo (int) $tribeId; ?>">
|
||||
<img class="rw-portrait" src="img/reg/portrait_v<?php echo (int) $tribeId; ?>.png" alt="" />
|
||||
<?php if ($tribeData['best']) { ?>
|
||||
<img class="rw-badge" src="img/reg/badge_new.png" alt="recommended for new players" />
|
||||
<?php } ?>
|
||||
<h2 class="rw-name"><?php echo htmlspecialchars($tribeData['name'], ENT_QUOTES, 'UTF-8'); ?></h2>
|
||||
<ul class="rw-lines">
|
||||
<?php foreach ($tribeData['lines'] as $line) { ?>
|
||||
<li style="background-image:url(img/reg/bullet_v<?php echo (int) $tribeId; ?>.png)"><?php echo htmlspecialchars($line, ENT_QUOTES, 'UTF-8'); ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<button type="button" class="rw-btn" id="rw_next1"><?php echo regText('REG_CONFIRM', 'Confirm'); ?></button>
|
||||
</div>
|
||||
|
||||
<!-- =============== STEP 2 : starting position =============== -->
|
||||
<div class="rw-step" id="rw_step2">
|
||||
<p class="rw-intro"><?php echo regText('REG_POS_INTRO', 'Where do you want to start building up your empire? Use the "recommended" area for the most ideal location. Or select the area where your friends are located and team up!'); ?></p>
|
||||
|
||||
<div class="rw-map<?php echo ($regQuad > 0) ? ' picked' : ''; ?>" id="rw_map">
|
||||
<img class="rw-mapbg" src="img/reg/map.png" alt="world map" />
|
||||
<?php for ($k = 1; $k <= 4; $k++) { ?>
|
||||
<div class="rw-q rw-q<?php echo $k; ?><?php echo ($regQuad == $k) ? ' sel' : ''; ?>" data-kid="<?php echo $k; ?>" title="<?php echo htmlspecialchars($regQuadrants[$k]['name'] . ' ' . $regQuadrants[$k]['coords'], ENT_QUOTES, 'UTF-8'); ?>"></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="rw-rand<?php echo ($regQuad == 0) ? ' sel' : ''; ?>" id="rw_rand"><?php echo RANDOM; ?></div>
|
||||
|
||||
<button type="button" class="rw-btn" id="rw_next2"><?php echo regText('REG_CONFIRM', 'Confirm'); ?></button>
|
||||
<span class="rw-back" id="rw_back2">« <?php echo regText('REG_BACK', 'Back'); ?></span>
|
||||
</div>
|
||||
|
||||
<!-- =============== STEP 3 : recap + account data =============== -->
|
||||
<div class="rw-step" id="rw_step3">
|
||||
<p class="rw-intro"><?php echo regText('REG_RECAP_INTRO', 'Confirm your choices, choose your avatar name, and start your adventure'); ?></p>
|
||||
|
||||
<div class="rw-cards">
|
||||
<div class="rw-card">
|
||||
<h3 id="rw_r_tribe"> </h3>
|
||||
<div class="rw-pic rw-pic-tribe" id="rw_r_tribepic"></div>
|
||||
<span class="rw-change" data-goto="1"><?php echo regText('REG_CHANGE', 'Change'); ?></span>
|
||||
</div>
|
||||
<div class="rw-card">
|
||||
<h3 id="rw_r_quad"> </h3>
|
||||
<div class="rw-pic" id="rw_r_quadpic"></div>
|
||||
<span class="rw-change" data-goto="2"><?php echo regText('REG_CHANGE', 'Change'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rw-field">
|
||||
<label for="rw_name"><?php echo regText('REG_AVATAR', 'Enter your avatar name:'); ?></label>
|
||||
<input class="rw-text" type="text" id="rw_name" name="name" maxlength="30" value="<?php echo htmlspecialchars($form->getValue('name'), ENT_QUOTES, 'UTF-8'); ?>" />
|
||||
<span class="error"><?php echo $form->getError('name'); ?></span>
|
||||
</div>
|
||||
|
||||
<div class="rw-note"><?php echo regText('REG_AVATAR_HINT', 'This is your avatar name in the game world.'); ?></div>
|
||||
|
||||
<div class="rw-field">
|
||||
<label for="rw_email"><?php echo EMAIL; ?></label>
|
||||
<input class="rw-text" type="text" id="rw_email" name="email" value="<?php echo htmlspecialchars(stripslashes($form->getValue('email')), ENT_QUOTES, 'UTF-8'); ?>" />
|
||||
<span class="error"><?php echo $form->getError('email'); ?></span>
|
||||
</div>
|
||||
|
||||
<div class="rw-field">
|
||||
<label for="rw_pw"><?php echo PASSWORD; ?></label>
|
||||
<input class="rw-text" type="password" id="rw_pw" name="pw" maxlength="100" value="" />
|
||||
<span class="error"><?php echo $form->getError('pw'); ?></span>
|
||||
</div>
|
||||
|
||||
<ul class="rw-err">
|
||||
<?php
|
||||
echo $form->getError('winner');
|
||||
echo $form->getError('tribe');
|
||||
echo $form->getError('agree');
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="rw-agree">
|
||||
<input class="check" type="checkbox" name="agb" value="1" <?php echo $form->getRadio('agb',1); ?>/><?php echo ACCEPT_RULES; ?>
|
||||
</p>
|
||||
|
||||
<button type="submit" class="rw-btn" value="anmelden" name="s1" id="rw_submit"><?php echo regText('REG_PLAY', "Let's play"); ?></button>
|
||||
<span class="rw-back" id="rw_back3">« <?php echo regText('REG_BACK', 'Back'); ?></span>
|
||||
</div>
|
||||
|
||||
<p class="rw-foot"><?php echo ONE_PER_SERVER; ?></p>
|
||||
</div>
|
||||
<div class="rw-bot"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Registration wizard - 3 steps, one single POST at the end */
|
||||
/* ------------------------------------------------------------------ */
|
||||
(function () {
|
||||
var TRIBES = <?php
|
||||
$jsTribes = array();
|
||||
foreach ($regTribes as $tribeId => $tribeData) {
|
||||
$jsTribes[$tribeId] = $tribeData['name'];
|
||||
}
|
||||
echo json_encode($jsTribes);
|
||||
?>;
|
||||
var QUADS = <?php
|
||||
$jsQuads = array();
|
||||
foreach ($regQuadrants as $quadId => $quadData) {
|
||||
$jsQuads[$quadId] = $quadData['name'];
|
||||
}
|
||||
echo json_encode($jsQuads);
|
||||
?>;
|
||||
var TITLES = <?php echo json_encode(array(
|
||||
1 => regText('REG_STEP1_TITLE', 'Select your tribe'),
|
||||
2 => regText('REG_STEP2_TITLE', 'Select Starting Position'),
|
||||
3 => regText('REG_STEP3_TITLE', 'Confirm your selection'),
|
||||
)); ?>;
|
||||
|
||||
var wiz = document.getElementById('regwiz');
|
||||
if (!wiz) { return; }
|
||||
|
||||
var fVid = document.getElementById('rw_vid'),
|
||||
fKid = document.getElementById('rw_kid'),
|
||||
title = document.getElementById('rw_title'),
|
||||
map = document.getElementById('rw_map'),
|
||||
rand = document.getElementById('rw_rand'),
|
||||
rTribe = document.getElementById('rw_r_tribe'),
|
||||
rQuad = document.getElementById('rw_r_quad'),
|
||||
pTribe = document.getElementById('rw_r_tribepic'),
|
||||
pQuad = document.getElementById('rw_r_quadpic'),
|
||||
step = parseInt(wiz.getAttribute('data-step'), 10) || 1;
|
||||
|
||||
function showStep(n) {
|
||||
step = n;
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
var el = document.getElementById('rw_step' + i);
|
||||
if (el) { el.className = 'rw-step' + (i === n ? ' on' : ''); }
|
||||
}
|
||||
title.innerHTML = TITLES[n];
|
||||
if (n === 3) { refreshRecap(); }
|
||||
if (window.scrollTo) { window.scrollTo(0, 0); }
|
||||
}
|
||||
|
||||
function refreshRecap() {
|
||||
var v = fVid.value, k = fKid.value;
|
||||
rTribe.innerHTML = TRIBES[v] || '';
|
||||
rQuad.innerHTML = QUADS[k] || '';
|
||||
pTribe.style.backgroundImage = 'url(img/reg/portrait_v' + v + '.png)';
|
||||
pQuad.style.backgroundImage = 'url(img/reg/quad_' + k + '.png)';
|
||||
}
|
||||
|
||||
/* ---- step 1 : tribe cards ---- */
|
||||
var thumbs = wiz.getElementsByClassName('rw-thumb');
|
||||
for (var t = 0; t < thumbs.length; t++) {
|
||||
thumbs[t].onclick = (function (node) {
|
||||
return function () {
|
||||
var vid = node.getAttribute('data-vid'), i;
|
||||
fVid.value = vid;
|
||||
for (i = 0; i < thumbs.length; i++) {
|
||||
thumbs[i].className = 'rw-thumb' + (thumbs[i] === node ? ' sel' : '');
|
||||
}
|
||||
var infos = wiz.getElementsByClassName('rw-info');
|
||||
for (i = 0; i < infos.length; i++) {
|
||||
infos[i].className = 'rw-info' + (infos[i].id === 'rw_info' + vid ? ' on' : '');
|
||||
}
|
||||
};
|
||||
})(thumbs[t]);
|
||||
}
|
||||
|
||||
/* ---- step 2 : quadrants ---- */
|
||||
var quads = wiz.getElementsByClassName('rw-q');
|
||||
function markQuad(kid) {
|
||||
fKid.value = kid;
|
||||
for (var i = 0; i < quads.length; i++) {
|
||||
var on = (quads[i].getAttribute('data-kid') === String(kid));
|
||||
quads[i].className = 'rw-q rw-q' + quads[i].getAttribute('data-kid') + (on ? ' sel' : '');
|
||||
}
|
||||
map.className = 'rw-map' + (kid > 0 ? ' picked' : '');
|
||||
rand.className = 'rw-rand' + (kid > 0 ? '' : ' sel');
|
||||
}
|
||||
for (var q = 0; q < quads.length; q++) {
|
||||
quads[q].onclick = (function (node) {
|
||||
return function () { markQuad(parseInt(node.getAttribute('data-kid'), 10)); };
|
||||
})(quads[q]);
|
||||
}
|
||||
rand.onclick = function () { markQuad(0); };
|
||||
|
||||
/* ---- navigation ---- */
|
||||
document.getElementById('rw_next1').onclick = function () { showStep(2); };
|
||||
document.getElementById('rw_next2').onclick = function () { showStep(3); };
|
||||
document.getElementById('rw_back2').onclick = function () { showStep(1); };
|
||||
document.getElementById('rw_back3').onclick = function () { showStep(2); };
|
||||
|
||||
var changes = wiz.getElementsByClassName('rw-change');
|
||||
for (var c = 0; c < changes.length; c++) {
|
||||
changes[c].onclick = (function (node) {
|
||||
return function () { showStep(parseInt(node.getAttribute('data-goto'), 10)); };
|
||||
})(changes[c]);
|
||||
}
|
||||
|
||||
showStep(step);
|
||||
})();
|
||||
</script>
|
||||
<noscript>
|
||||
<style type="text/css">.rw-step{display:block !important}</style>
|
||||
</noscript>
|
||||
|
||||
<?php }else{ ?>
|
||||
<div id="content" class="signup">
|
||||
|
||||
<h1><img src="img/x.gif" class="anmelden" alt="register for the game" /></h1>
|
||||
<h5><img src="img/x.gif" class="img_u05" alt="registration"/></h5>
|
||||
|
||||
<p><?php echo REGISTER_CLOSED; ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="side_info" class="outgame">
|
||||
<?php
|
||||
if(NEWSBOX1) { include("Templates/News/newsbox1.tpl"); }
|
||||
if(NEWSBOX2) { include("Templates/News/newsbox2.tpl"); }
|
||||
if(NEWSBOX3) { include("Templates/News/newsbox3.tpl"); }
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="footer-stopper outgame"></div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php include("Templates/footer.tpl"); ?>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,785 @@
|
||||
<?php
|
||||
use App\Utils\AccessLogger;
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename : index.php ##
|
||||
## Type : In Game Index Page ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## URLs: : https://travianz.org ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
if(!file_exists('var/installed') && @opendir('install')) {
|
||||
header("Location: install/");
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once("GameEngine/config.php");
|
||||
/*
|
||||
if($_SERVER['HTTP_HOST'] != '.SERVER.')
|
||||
{
|
||||
header('location: '.SERVER.'');
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
// delete the /* and the */ if you not use localhost.
|
||||
|
||||
error_reporting(E_ALL || E_NOTICE);
|
||||
|
||||
if(file_exists('Security/Security.class.php'))
|
||||
{
|
||||
require 'Security/Security.class.php';
|
||||
Security::instance();
|
||||
}
|
||||
else
|
||||
{
|
||||
die('Security: Please activate security class!');
|
||||
}
|
||||
|
||||
include_once "GameEngine/Database.php";
|
||||
require_once __DIR__ . "/GameEngine/Lang/loader.php";
|
||||
tz_load_language(LANG);
|
||||
|
||||
AccessLogger::logRequest();
|
||||
|
||||
/*
|
||||
* =========================================================================
|
||||
* MULTI INSTANCE SERVER LIST
|
||||
* =========================================================================
|
||||
* Fiecare intrare de mai jos e o instalare TravianZ complet independenta:
|
||||
* propriul subdomeniu, propriul config.php, propriu DB, propriul Admin
|
||||
* Panel. Acest fisier NU partajeaza conturi/DB intre worlds - doar citeste
|
||||
* si afiseaza contorul public de jucatori + rezumatul de setari (fostul
|
||||
* Newsbox1 din joc) al fiecarui world, si trimite Login/Register catre
|
||||
* subdomeniul propriu al acelui world.
|
||||
*
|
||||
* Pentru a adauga un world nou: il instalezi manual pe subdomeniul lui,
|
||||
* apoi adaugi o intrare aici cu login/signup/status/newsbox care se
|
||||
* potrivesc. Nu mai trebuie modificat niciun alt fisier.
|
||||
*
|
||||
* ANOMALIE semnalata (nu am modificat comportamentul): world-ul curent isi
|
||||
* cere si el statisticile prin HTTP catre propriile server_status /
|
||||
* server_newsbox, exact ca pentru worlds-urile straine, desi ar putea
|
||||
* calcula local aceleasi query-uri fara round-trip de retea. Am lasat asa
|
||||
* ca sa nu presupun cum identifici in mod sigur "acest world" in array
|
||||
* (ar necesita potrivire pe domeniu/HTTP_HOST, fragil in spatele unui
|
||||
* proxy/cPanel) - dar e un candidat clar de optimizat daca vrei.
|
||||
*/
|
||||
$servers = array(
|
||||
1 => array(
|
||||
'name' => 'Server 1',
|
||||
'url' => 'https://travianz.org/',
|
||||
'login' => 'https://travianz.org/login.php',
|
||||
'signup' => 'https://travianz.org/anmelden.php',
|
||||
'image' => 'en1_big.jpg',
|
||||
'status' => 'https://travianz.org/index.php?server_status=1',
|
||||
'newsbox' => 'https://travianz.org/index.php?server_newsbox=1'
|
||||
),
|
||||
2 => array(
|
||||
'name' => 'Server 2',
|
||||
'url' => 'https://s2.travianz.org/',
|
||||
'login' => 'https://s2.travianz.org/login.php',
|
||||
'signup' => 'https://s2.travianz.org/anmelden.php',
|
||||
'image' => 'en2_big.jpg',
|
||||
'status' => 'https://s2.travianz.org/index.php?server_status=1',
|
||||
'newsbox' => 'https://s2.travianz.org/index.php?server_newsbox=1'
|
||||
),
|
||||
3 => array(
|
||||
'name' => 'Speed 3x',
|
||||
'url' => 'https://speed.travianz.org/',
|
||||
'login' => 'https://speed.travianz.org/login.php',
|
||||
'signup' => 'https://speed.travianz.org/anmelden.php',
|
||||
'image' => 'enx_big.jpg',
|
||||
'status' => 'https://speed.travianz.org/index.php?server_status=1',
|
||||
'newsbox' => 'https://speed.travianz.org/index.php?server_newsbox=1'
|
||||
)
|
||||
// Adauga aici worlds noi, ex:
|
||||
// 4 => array(
|
||||
// 'name' => 'Server 3',
|
||||
// 'url' => 'https://s3.travianz.org/',
|
||||
// 'login' => 'https://s3.travianz.org/login.php',
|
||||
// 'signup' => 'https://s3.travianz.org/anmelden.php',
|
||||
// 'image' => 'en3_big.jpg',
|
||||
// 'status' => 'https://s3.travianz.org/index.php?server_status=1',
|
||||
// 'newsbox' => 'https://s3.travianz.org/index.php?server_newsbox=1'
|
||||
// ),
|
||||
);
|
||||
|
||||
/*
|
||||
* Fiecare instanta de joc isi expune propriile statistici prin endpoint-ul
|
||||
* ?server_status=1 de mai jos - ruleaza pe DB-ul instantei CURENTE, deci
|
||||
* Server 1 nu poate afla niciodata contoarele de la Server 2/3.
|
||||
*/
|
||||
if (isset($_GET['server_status'])) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$tribes = '1, 2, 3, 6, 7, 8, 9';
|
||||
|
||||
$users = 0;
|
||||
$active = 0;
|
||||
$online = 0;
|
||||
|
||||
$return = mysqli_query(
|
||||
$link,
|
||||
"SELECT COUNT(*) AS Total FROM " . TB_PREFIX . "users WHERE tribe IN(" . $tribes . ")"
|
||||
);
|
||||
|
||||
if ($return) {
|
||||
$row = mysqli_fetch_assoc($return);
|
||||
$users = isset($row['Total']) ? (int)$row['Total'] : 0;
|
||||
}
|
||||
|
||||
$return = mysqli_query(
|
||||
$link,
|
||||
"SELECT COUNT(*) AS Total FROM " . TB_PREFIX . "users WHERE timestamp > " . (time() - (3600 * 24)) . " AND tribe IN(" . $tribes . ")"
|
||||
);
|
||||
|
||||
if ($return) {
|
||||
$row = mysqli_fetch_assoc($return);
|
||||
$active = isset($row['Total']) ? (int)$row['Total'] : 0;
|
||||
}
|
||||
|
||||
$return = mysqli_query(
|
||||
$link,
|
||||
"SELECT COUNT(*) AS Total FROM " . TB_PREFIX . "users WHERE timestamp > " . (time() - (60 * 10)) . " AND tribe IN(" . $tribes . ")"
|
||||
);
|
||||
|
||||
if ($return) {
|
||||
$row = mysqli_fetch_assoc($return);
|
||||
$online = isset($row['Total']) ? (int)$row['Total'] : 0;
|
||||
}
|
||||
|
||||
echo json_encode(array(
|
||||
'status' => 'online',
|
||||
'players' => $users,
|
||||
'active' => $active,
|
||||
'online' => $online
|
||||
));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Endpoint public nou: ?server_newsbox=1
|
||||
* Expune, in JSON, exact aceleasi date pe care in-game le arata deja
|
||||
* Templates/News/newsbox1.tpl (jucatori online, viteza, harta, protectie,
|
||||
* top player etc.) - aceleasi query-uri/conditii, doar output JSON in loc
|
||||
* de HTML, ca sa poata fi citit de lobby-ul altui world (sau de acest
|
||||
* index.php insusi, pentru propriile date).
|
||||
*/
|
||||
if (isset($_GET['server_newsbox'])) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$online_total = 0;
|
||||
$return = mysqli_query(
|
||||
$link,
|
||||
"SELECT COUNT(*) AS Total FROM " . TB_PREFIX . "users WHERE timestamp > " . (time() - (60 * 10)) . " AND tribe != 0 AND tribe != 4 AND tribe != 5"
|
||||
);
|
||||
if ($return) {
|
||||
$row = mysqli_fetch_assoc($return);
|
||||
if ($row && isset($row['Total'])) {
|
||||
$online_total = (int)$row['Total'];
|
||||
}
|
||||
}
|
||||
|
||||
$top_username = '-';
|
||||
$top_query = mysqli_query(
|
||||
$link,
|
||||
"SELECT username FROM " . TB_PREFIX . "users WHERE " .
|
||||
(INCLUDE_ADMIN ? 'access > 0 AND ' : 'access > 0 AND access < 8 AND ') .
|
||||
"id > 5 AND tribe IN (1,2,3,6,7,8,9) AND tribe > 0 ORDER BY oldrank ASC LIMIT 1"
|
||||
);
|
||||
if ($top_query) {
|
||||
$row = mysqli_fetch_assoc($top_query);
|
||||
if ($row && !empty($row['username'])) {
|
||||
$top_username = $row['username'];
|
||||
}
|
||||
}
|
||||
|
||||
if (CP == 0) {
|
||||
$village_exp = 'Fast';
|
||||
} else if (CP == 1) {
|
||||
$village_exp = 'Slow';
|
||||
} else {
|
||||
$village_exp = '-';
|
||||
}
|
||||
|
||||
if (MEDALINTERVAL >= 86400) {
|
||||
$medal_interval = (MEDALINTERVAL / 86400) . ' Days';
|
||||
} else {
|
||||
$medal_interval = (MEDALINTERVAL / 3600) . ' Hours';
|
||||
}
|
||||
|
||||
$peaceTypes = array('None', 'Normal', 'Christmas', 'New Year', 'Easter');
|
||||
$peace_system = isset($peaceTypes[PEACE]) ? $peaceTypes[PEACE] : 'Unknown';
|
||||
|
||||
echo json_encode(array(
|
||||
'online_users' => $online_total,
|
||||
'speed' => SPEED,
|
||||
'troop_speed' => INCREASE_SPEED,
|
||||
'evasion_speed' => EVASION_SPEED,
|
||||
'map_size' => WORLD_MAX,
|
||||
'village_exp' => $village_exp,
|
||||
'protection_hours' => (int)(PROTECTION / 3600),
|
||||
'medal_interval' => $medal_interval,
|
||||
'start_date' => START_DATE,
|
||||
'peace_system' => $peace_system,
|
||||
'best_player' => $top_username
|
||||
));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetch generic, in PARALEL (curl_multi), de JSON de la o lista de
|
||||
* URL-uri indexate dupa id de world. Folosit atat pentru server_status
|
||||
* cat si pentru server_newsbox - un singur loc care stie sa vorbeasca
|
||||
* HTTP catre celelalte worlds.
|
||||
*/
|
||||
define('MULTI_STATUS_CONNECT_TIMEOUT', 2);
|
||||
define('MULTI_STATUS_TIMEOUT', 3);
|
||||
|
||||
function fetchJsonFromServers(array $urlsById)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
if (!function_exists('curl_multi_init')) {
|
||||
// cURL indisponibil - toate worlds-urile raman fara date live.
|
||||
foreach ($urlsById as $id => $url) {
|
||||
$results[$id] = null;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
$multiHandle = curl_multi_init();
|
||||
$handles = array();
|
||||
|
||||
foreach ($urlsById as $id => $url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, MULTI_STATUS_CONNECT_TIMEOUT);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, MULTI_STATUS_TIMEOUT);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
|
||||
curl_multi_add_handle($multiHandle, $ch);
|
||||
$handles[$id] = $ch;
|
||||
}
|
||||
|
||||
$running = null;
|
||||
do {
|
||||
curl_multi_exec($multiHandle, $running);
|
||||
curl_multi_select($multiHandle);
|
||||
} while ($running > 0);
|
||||
|
||||
foreach ($handles as $id => $ch) {
|
||||
$decoded = null;
|
||||
$httpCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
$response = curl_multi_getcontent($ch);
|
||||
|
||||
if ($response !== false && $response !== null && $httpCode === 200) {
|
||||
$data = json_decode($response, true);
|
||||
if (is_array($data)) {
|
||||
$decoded = $data;
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_remove_handle($multiHandle, $ch);
|
||||
curl_close($ch);
|
||||
|
||||
$results[$id] = $decoded;
|
||||
}
|
||||
|
||||
curl_multi_close($multiHandle);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
function normalizeServerStatus($data)
|
||||
{
|
||||
$default = array('status' => 'offline', 'players' => 0, 'active' => 0, 'online' => 0);
|
||||
|
||||
if (!is_array($data) || !isset($data['players'])) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return array(
|
||||
'status' => isset($data['status']) ? $data['status'] : 'online',
|
||||
'players' => (int)$data['players'],
|
||||
'active' => isset($data['active']) ? (int)$data['active'] : 0,
|
||||
'online' => isset($data['online']) ? (int)$data['online'] : 0
|
||||
);
|
||||
}
|
||||
|
||||
function normalizeServerNewsbox($data)
|
||||
{
|
||||
$default = array(
|
||||
'online_users' => 0,
|
||||
'speed' => '-',
|
||||
'troop_speed' => '-',
|
||||
'evasion_speed' => '-',
|
||||
'map_size' => '-',
|
||||
'village_exp' => '-',
|
||||
'protection_hours' => '-',
|
||||
'medal_interval' => '-',
|
||||
'start_date' => '-',
|
||||
'peace_system' => '-',
|
||||
'best_player' => '-'
|
||||
);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$result = $default;
|
||||
foreach ($default as $key => $unused) {
|
||||
if (isset($data[$key]) && $data[$key] !== '') {
|
||||
$result[$key] = $data[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helpere de afisare pentru cardurile de newsbox: cand un world nu a
|
||||
* raspuns (ex. inca nu are endpoint-ul ?server_newsbox=1 activ), toate
|
||||
* campurile raman pe placeholder-ul '-' din normalizeServerNewsbox(). Fara
|
||||
* aceste helpere, sufixele (x / ore) s-ar lipi de placeholder si ar iesi
|
||||
* afisari confuze de genul "-x" in loc de un simplu "-".
|
||||
*/
|
||||
function mi_newsbox_value($value, $suffix = '')
|
||||
{
|
||||
$value = (string)$value;
|
||||
if ($value === '-' || $value === '') {
|
||||
return '-';
|
||||
}
|
||||
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . $suffix;
|
||||
}
|
||||
|
||||
function mi_newsbox_map_size($value)
|
||||
{
|
||||
$value = (string)$value;
|
||||
if ($value === '-' || $value === '') {
|
||||
return '-';
|
||||
}
|
||||
$escaped = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
|
||||
return $escaped . 'x' . $escaped;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cache scurt pentru fetch-urile intre worlds (status + newsbox).
|
||||
* Fara asta, FIECARE vizitator pe pagina asta declanseaza N cereri HTTP
|
||||
* catre celelalte worlds - inutil pentru date cvasi-statice si pune
|
||||
* sarcina degeaba pe serverele celorlalte worlds.
|
||||
*/
|
||||
function getCachedJson($cacheFile, $ttlSeconds, callable $fetcher)
|
||||
{
|
||||
if (is_readable($cacheFile) && (time() - filemtime($cacheFile)) < $ttlSeconds) {
|
||||
$cached = json_decode(file_get_contents($cacheFile), true);
|
||||
|
||||
if (is_array($cached)) {
|
||||
return $cached;
|
||||
}
|
||||
// Anomalie: fisierul de cache exista dar nu e JSON valid - trecem
|
||||
// peste el si reluam fetch-ul live in loc sa incredem date corupte.
|
||||
}
|
||||
|
||||
$data = $fetcher();
|
||||
|
||||
$cacheDir = dirname($cacheFile);
|
||||
if (!is_dir($cacheDir)) {
|
||||
@mkdir($cacheDir, 0755, true);
|
||||
}
|
||||
// Best-effort: daca var/cache nu e writable, pur si simplu nu se
|
||||
// cacheaza si fiecare request face fetch live.
|
||||
@file_put_contents($cacheFile, json_encode($data));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
define('MULTI_STATUS_CACHE_TTL', 30);
|
||||
define('MULTI_NEWSBOX_CACHE_TTL', 60);
|
||||
|
||||
$serverStats = getCachedJson(__DIR__ . '/var/cache/server_status.json', MULTI_STATUS_CACHE_TTL, function () use ($servers) {
|
||||
$urls = array();
|
||||
foreach ($servers as $id => $server) {
|
||||
$urls[$id] = $server['status'];
|
||||
}
|
||||
|
||||
$raw = fetchJsonFromServers($urls);
|
||||
|
||||
$stats = array();
|
||||
foreach ($raw as $id => $data) {
|
||||
$stats[$id] = normalizeServerStatus($data);
|
||||
}
|
||||
|
||||
return $stats;
|
||||
});
|
||||
|
||||
$serverNewsboxes = getCachedJson(__DIR__ . '/var/cache/server_newsbox.json', MULTI_NEWSBOX_CACHE_TTL, function () use ($servers) {
|
||||
$urls = array();
|
||||
foreach ($servers as $id => $server) {
|
||||
$urls[$id] = $server['newsbox'];
|
||||
}
|
||||
|
||||
$raw = fetchJsonFromServers($urls);
|
||||
|
||||
$newsboxes = array();
|
||||
foreach ($raw as $id => $data) {
|
||||
$newsboxes[$id] = normalizeServerNewsbox($data);
|
||||
}
|
||||
|
||||
return $newsboxes;
|
||||
});
|
||||
|
||||
foreach ($servers as $serverId => $server) {
|
||||
$servers[$serverId]['stats'] = isset($serverStats[$serverId])
|
||||
? $serverStats[$serverId]
|
||||
: normalizeServerStatus(null);
|
||||
|
||||
$servers[$serverId]['newsbox'] = isset($serverNewsboxes[$serverId])
|
||||
? $serverNewsboxes[$serverId]
|
||||
: normalizeServerNewsbox(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Pastreaza variabilele vechi pentru restul paginii legacy.
|
||||
* Contorul din lobby de mai jos foloseste suma tuturor worlds-urilor.
|
||||
*/
|
||||
$users = 0;
|
||||
$active = 0;
|
||||
$online = 0;
|
||||
|
||||
foreach ($servers as $server) {
|
||||
$users += $server['stats']['players'];
|
||||
$active += $server['stats']['active'];
|
||||
$online += $server['stats']['online'];
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?php echo SERVER_NAME; ?></title>
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="gpack/travian/main.css" />
|
||||
<link rel="stylesheet" type="text/css" href="gpack/travian/flaggs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="gpack/travian/main_en.css" />
|
||||
<meta name="content-language" content="<?php echo LANG; ?>" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<script src="mt-core.js" type="text/javascript"></script>
|
||||
<script src="new.js?22102017" type="text/javascript"></script>
|
||||
<script src="new2.js?22102017" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
/* Server backgrounds are assigned inline below. */
|
||||
div.c2 {left:237px;}
|
||||
ul.c1 {position:absolute; left:0px; width: 686px;}
|
||||
|
||||
/* Multi-instance "news" panel: one compact card per world, built
|
||||
from each world's own ?server_newsbox=1 (its former in-game
|
||||
Newsbox1). Scoped classes (mi-*) so nothing in main.css collides.
|
||||
Panel lives OUTSIDE .secondarybox now (own full-width section
|
||||
below the intro columns) so it can lay worlds out side by side
|
||||
instead of stacking, and no longer stretches to match whichever
|
||||
column (left/right) happens to be taller. */
|
||||
/* body.indexpage #content are padding-bottom:120px in main.css - gandit
|
||||
pentru pagina veche, mai scurta. Acum ca panoul de worlds e ultimul
|
||||
element din #content, acel padding lasa un gol mare inainte de footer.
|
||||
Aceeasi regula (acelasi selector), declarata dupa link-ul catre main.css,
|
||||
deci castiga la ordine in cascada fara sa fortez cu !important. */
|
||||
body.indexpage #content { padding-bottom:30px; }
|
||||
#mi-worlds-panel { width:830px; max-width:100%; margin:8px auto 0; box-sizing:border-box; text-align:left; }
|
||||
#mi-worlds-panel .mi-worlds-heading { margin:0 0 8px; padding-bottom:5px; font-size:16px; color:#4a3a1f; border-bottom:2px solid #7a1220; }
|
||||
.mi-worlds-news { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:10px; }
|
||||
/* Lista noua din News (Templates/indexnews.tpl), stilizata sa semene cu
|
||||
lista "About the game:" din stanga (acelasi indent/line-height). */
|
||||
#newsbox .news ul { margin:5px 0 0 15px; padding:0; }
|
||||
#newsbox .news li { line-height:19px; padding-bottom:4px; }
|
||||
.mi-world-card { border:1px solid #d8c9a3; border-radius:4px; background:#fdfbf5; overflow:hidden; width:100%; box-sizing:border-box; }
|
||||
.mi-world-card-title { margin:0; padding:5px 8px; background:#7a1220; color:#f5e9c8; font-size:12px; font-weight:bold; letter-spacing:.3px; text-align:center; }
|
||||
.mi-world-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 6px; padding:7px; box-sizing:border-box; }
|
||||
.mi-world-stat { text-align:center; padding:4px 3px; background:#f4ecd8; border-radius:3px; box-sizing:border-box; min-width:0; white-space:normal; }
|
||||
.mi-world-stat-label { font-size:9px; color:#5b4a2f; text-transform:uppercase; letter-spacing:.2px; }
|
||||
.mi-world-stat-value { font-size:12px; font-weight:bold; color:#7a1220; margin-left:4px; overflow-wrap:break-word; }
|
||||
.mi-world-best-player { text-align:center; padding:5px 8px 7px; font-size:11px; border-top:1px solid #e6dcc0; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="presto indexPage">
|
||||
<div class="wrapper">
|
||||
<div id="country_select">
|
||||
<div id="flags"></div>
|
||||
<script src="flaggen.js?a" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var region_list = new Array('Europe','America','Asia','Middle East','Africa','Oceania');
|
||||
show_flags('', '', region_list);
|
||||
</script>
|
||||
</div>
|
||||
<div id="header"><h1><?php echo $lang['index'][0][1]; ?></h1></div>
|
||||
<div id="navigation">
|
||||
<a href="index.php" class="home"><img src="img/x.gif" alt="Travian" /></a>
|
||||
<table class="menu">
|
||||
<tr>
|
||||
<td><a href="tutorial.php"><span><?php echo TUTORIAL; ?></span></a></td>
|
||||
<td><a href="anleitung.php"><span><?php echo $lang['index'][0][2]; ?></span></a></td>
|
||||
<td><a href="https://github.com/Shadowss/TravianZ/discussions" target="_blank"><span><?php echo FORUM; ?></span></a></td>
|
||||
<td><a href="?signup" class="signup_link mark"><span><?php echo $lang['register']; ?></span></a></td>
|
||||
<td><a href="?login" class="login_link"><span><?php echo LOGIN; ?></span></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
if(T4_COMING==true){
|
||||
?>
|
||||
<div id="t4play">
|
||||
<a href="notification/">
|
||||
<img src="img/t4n/Teaser_Prelandingpage_EN.png" alt="Travian 4" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="register_now">
|
||||
<a href="?signup" class="signup_link"><?php echo $lang['register']; ?></a>
|
||||
<span><?php echo PLAY_NOW; ?></span>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="grit">
|
||||
<div class="infobox">
|
||||
<div id="what_is_travian">
|
||||
<h2><?php echo $lang['index'][0][4]; ?></h2>
|
||||
<p><?php echo $lang['index'][0][5]; ?></p>
|
||||
<p class="play_now"><a href="?signup" class="signup_link"><?php echo $lang['index'][0][6]; ?></a></p>
|
||||
</div>
|
||||
<div id="player_counter">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang['index'][0][7]; ?>:</th>
|
||||
<td><?php echo $users; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang['index'][0][8]; ?>:</th>
|
||||
<td><?php echo $active; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang['index'][0][9]; ?>:</th>
|
||||
<td><?php echo $online; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="about_the_game">
|
||||
<h2><?php echo $lang['index'][0][10]; ?>:</h2>
|
||||
<ul>
|
||||
<li><?php echo $lang['index'][0][11]; ?></li>
|
||||
<li><?php echo $lang['index'][0][12]; ?></li>
|
||||
<li><?php echo $lang['index'][0][13]; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="secondarybox">
|
||||
<div id="screenshots">
|
||||
<h2><?php echo SCREENSHOTS; ?></h2>
|
||||
<a href="#last" class="navi prev dynamic_btn"><img class="dynamic_btn" src="img/x.gif" alt="previous" /></a>
|
||||
<div id="screenshots_preview">
|
||||
<ul id="screenshot_list" class="c1">
|
||||
<li><a href="#"><img src="img/un/s/s1s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s2s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s4s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s3s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s5s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s7s.jpg" alt="Screenshot" /></a></li>
|
||||
<li><a href="#"><img src="img/un/s/s8s.jpg" alt="Screenshot" /></a></li>
|
||||
</ul>
|
||||
</div><a href="#next" class="navi next"><img class="dynamic_btn" src="img/x.gif" alt="next" /></a>
|
||||
</div>
|
||||
<div id="newsbox">
|
||||
<h2><?php echo NEWS; ?></h2>
|
||||
<div class="news"><?php include ("Templates/indexnews.tpl"); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="mi-worlds-panel">
|
||||
<h2 class="mi-worlds-heading">Available Worlds</h2>
|
||||
<div class="mi-worlds-news">
|
||||
<?php foreach ($servers as $server) { ?>
|
||||
<div class="mi-world-card">
|
||||
<h3 class="mi-world-card-title"><?php echo htmlspecialchars($server['name'], ENT_QUOTES, 'UTF-8'); ?></h3>
|
||||
<div class="mi-world-stats-grid">
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo TZ_ONLINE_USERS; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo (int)$server['newsbox']['online_users']; ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_SERVSPEED; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['speed'], 'x'); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_TROOPSPEED; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['troop_speed'], 'x'); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_EVASIONSPEED; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['evasion_speed']); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_MAPSIZE; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_map_size($server['newsbox']['map_size']); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo TZ_VILLAGE_EXP; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['village_exp']); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo TZ_BEGINNERS_PROT; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['protection_hours'], ' ' . TZ_HRS); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_MEDALINTERVAL; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['medal_interval']); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo TZ_SERVER_START; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['start_date']); ?></span>
|
||||
</div>
|
||||
<div class="mi-world-stat">
|
||||
<span class="mi-world-stat-label"><?php echo CONF_SERV_PEACESYST; ?></span>:
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['peace_system']); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mi-world-best-player">
|
||||
<span class="mi-world-stat-label"><?php echo TZ_BEST_PLAYER; ?>:</span>
|
||||
<span class="mi-world-stat-value"><?php echo mi_newsbox_value($server['newsbox']['best_player']); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<ul class="menu">
|
||||
<li><a href="anleitung.php?s=3"><?php echo FAQ; ?></a>|</li>
|
||||
<li><a href="index.php?screenshots"><?php echo SCREENSHOTS; ?></a>|</li>
|
||||
<li><a href="spielregeln.php"><?php echo SPIELREGELN; ?></a>|</li>
|
||||
<li><a href="agb.php"><?php echo AGB; ?></a>|</li>
|
||||
<li><a href="impressum.php"><?php echo IMPRINT; ?></a></li>
|
||||
<li class="copyright">© 2011-<?php echo date('Y'); ?> - TravianZ - All rights reserved</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="login_layer" class="overlay">
|
||||
<div class="mask closer"></div>
|
||||
<div id="login_list" class="overlay_content">
|
||||
<h2><?php echo CHOOSE; ?></h2>
|
||||
<a href="#" class="closer"><img class="dynamic_img" alt="Close" src="img/un/x.gif" /></a>
|
||||
<ul class="world_list">
|
||||
<?php foreach ($servers as $server) { ?>
|
||||
<li class="w_big c3" style="background-image:url('img/en/welten/<?php echo htmlspecialchars($server['image'], ENT_QUOTES, 'UTF-8'); ?>');">
|
||||
<a href="<?php echo htmlspecialchars($server['login'], ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<img class="w_button"
|
||||
src="img/un/x.gif"
|
||||
alt="<?php echo htmlspecialchars($server['name'], ENT_QUOTES, 'UTF-8'); ?>"
|
||||
title="<?php echo (int)$server['stats']['players']; ?> <?php echo PLAYERS; ?> | <?php echo (int)$server['stats']['active']; ?> <?php echo ACTIVE; ?> | <?php echo (int)$server['stats']['online']; ?> <?php echo ONLINE; ?>" />
|
||||
</a>
|
||||
<div class="label_players c0"><?php echo PLAYERS; ?>:</div>
|
||||
<div class="label_online c0"><?php echo ONLINE; ?>:</div>
|
||||
<div class="players c1"><?php echo (int)$server['stats']['players']; ?></div>
|
||||
<div class="online c1"><?php echo (int)$server['stats']['online']; ?></div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="signup_layer" class="overlay">
|
||||
<div class="mask closer"></div>
|
||||
<div id="signup_list" class="overlay_content">
|
||||
<h2><?php echo CHOOSE; ?></h2>
|
||||
<a href="#" class="closer"><img class="dynamic_img" alt="Close" src="img/un/x.gif" /></a>
|
||||
<ul class="world_list">
|
||||
<?php foreach ($servers as $server) { ?>
|
||||
<li class="w_big c4" style="background-image:url('img/en/welten/<?php echo htmlspecialchars($server['image'], ENT_QUOTES, 'UTF-8'); ?>');">
|
||||
<a href="<?php echo htmlspecialchars($server['signup'], ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<img class="w_button"
|
||||
src="img/un/x.gif"
|
||||
alt="<?php echo htmlspecialchars($server['name'], ENT_QUOTES, 'UTF-8'); ?>"
|
||||
title="<?php echo (int)$server['stats']['players']; ?> <?php echo PLAYERS; ?> | <?php echo (int)$server['stats']['active']; ?> <?php echo ACTIVE; ?> | <?php echo (int)$server['stats']['online']; ?> <?php echo ONLINE; ?>" />
|
||||
</a>
|
||||
<div class="label_players c0"><?php echo PLAYERS; ?>:</div>
|
||||
<div class="label_online c0"><?php echo ONLINE; ?>:</div>
|
||||
<div class="players c1"><?php echo (int)$server['stats']['players']; ?></div>
|
||||
<div class="online c1"><?php echo (int)$server['stats']['online']; ?></div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="iframe_layer" class="overlay">
|
||||
<div class="mask closer"></div>
|
||||
<div class="overlay_content">
|
||||
<a href="#" class="closer"><img class="dynamic_img" alt="Close" src="img/un/x.gif" /></a>
|
||||
<h2><?php echo $lang['index'][0][2]; ?></h2>
|
||||
<div id="frame_box"></div>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="screenshot_layer" class="overlay">
|
||||
<div class="mask closer"></div>
|
||||
<div class="overlay_content">
|
||||
<h3><?php echo SCREENSHOTS; ?></h3>
|
||||
<a href="#" class="closer"><img class="dynamic_img" alt="Close" src="img/x.gif" /></a>
|
||||
<div class="screenshot_view">
|
||||
<h4 id="screen_hl"></h4>
|
||||
<img id="screen_view" src="img/x.gif" alt="Screenshot" name="screen_view" />
|
||||
<div id="screen_desc"></div>
|
||||
</div>
|
||||
<a href="#prev" class="navi prev" onclick="galarie.showPrev();"><img class="dynamic_img" src="img/x.gif" alt="previous" /></a>
|
||||
<a href="#next" class="navi next" onclick="galarie.showNext();"><img class="dynamic_img" src="img/x.gif" alt="next" /></a>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var screenshots = [
|
||||
{'img':'img/en/s/s1.png','hl':"<?php echo $lang['screenshots']['title1']; ?>", 'desc':"<?php echo $lang['screenshots']['desc1']; ?>"},{'img':'img/en/s/s2.png','hl':"<?php echo $lang['screenshots']['title2']; ?>", 'desc':"<?php echo $lang['screenshots']['desc2']; ?>"},{'img':'img/en/s/s4.png','hl':"<?php echo $lang['screenshots']['title3']; ?>", 'desc':"<?php echo $lang['screenshots']['desc3']; ?>"},{'img':'img/en/s/s3.png','hl':"<?php echo $lang['screenshots']['title4']; ?>", 'desc':"<?php echo $lang['screenshots']['desc4']; ?>"},{'img':'img/en/s/s5.png','hl':"<?php echo $lang['screenshots']['title5']; ?>", 'desc':"<?php echo $lang['screenshots']['desc5']; ?>"},{'img':'img/en/s/s7.png','hl':"<?php echo $lang['screenshots']['title6']; ?>", 'desc':"<?php echo $lang['screenshots']['desc6']; ?>"},{'img':'img/en/s/s8.png','hl':"<?php echo $lang['screenshots']['title7']; ?>", 'desc':"<?php echo $lang['screenshots']['desc7']; ?>"}
|
||||
];
|
||||
var galarie = new Fx.Screenshots('screen_view', 'screen_hl', 'screen_desc', screenshots);
|
||||
<?php
|
||||
if (isset($_GET['signup'])) {
|
||||
?>
|
||||
window.addEvent('domready', function() {
|
||||
$$('.signup_link').fireEvent('click');
|
||||
});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($_GET['login'])) {
|
||||
?>
|
||||
window.addEvent('domready', function() {
|
||||
$$('.login_link').fireEvent('click');
|
||||
});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename : login.php ##
|
||||
## Type : In Game Login Page ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## URLs: : https://travianz.org ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
use App\Utils\AccessLogger;
|
||||
|
||||
if(!file_exists('var/installed') && @opendir('install')) {
|
||||
header("Location: install/");
|
||||
exit;
|
||||
}
|
||||
|
||||
include("GameEngine/Account.php");
|
||||
AccessLogger::logRequest();
|
||||
|
||||
if(isset($_GET['del_cookie'])) {
|
||||
setcookie("COOKUSR","",time()-3600*24,"/");
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
if(!isset($_COOKIE['COOKUSR'])) {
|
||||
$_COOKIE['COOKUSR'] = "";
|
||||
}
|
||||
|
||||
if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) {
|
||||
if ( !isset( $_SESSION[ 'csrf' ] ) || $_SESSION[ 'csrf' ] !== $_POST[ 'csrf' ] )
|
||||
throw new RuntimeException( 'CSRF attack' );
|
||||
}
|
||||
$key = sha1( microtime() );
|
||||
$_SESSION[ 'csrf' ] = $key;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo SERVER_NAME; ?> - Login</title>
|
||||
<link rel="shortcut icon" href="favicon.ico"/>
|
||||
<meta name="content-language" content="en" />
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<script src="mt-core.js?0faab" type="text/javascript"></script>
|
||||
<script src="mt-more.js?0faab" type="text/javascript"></script>
|
||||
<script src="unx.js?f4b7h" type="text/javascript"></script>
|
||||
<script src="new.js?0faab" type="text/javascript"></script>
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE ?>travian.css?f4b7d" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo GP_LOCATE ?>lang/en/lang.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body class="v35 ie ie7" onload="initCounter()">
|
||||
|
||||
<div class="wrapper">
|
||||
<div id="dynamic_header">
|
||||
</div>
|
||||
<div id="header"></div>
|
||||
<div id="mid">
|
||||
<?php
|
||||
/*
|
||||
* Multi-instance server: butonul "Homepage" din meniul de mai jos trebuie
|
||||
* sa duca mereu la hub-ul central (travianz.org), indiferent pe ce
|
||||
* subdomeniu (world) ruleaza aceasta instalare - nu la HOMEPAGE local din
|
||||
* config.php al acestui world. Constanta e citita doar de Templates/menu.tpl,
|
||||
* doar in ramura "vizitator neautentificat" (exact ce se randeaza pe login.php),
|
||||
* deci nu schimba nimic in meniul din joc (dupa autentificare).
|
||||
*/
|
||||
define('MI_HOMEPAGE_OVERRIDE', 'https://travianz.org/');
|
||||
include("Templates/menu.tpl");
|
||||
?>
|
||||
|
||||
<div id="content" class="login">
|
||||
|
||||
<h1><img class="img_login" src="img/x.gif" alt="log in the game" /></h1>
|
||||
|
||||
<?php
|
||||
$time = time();
|
||||
if( COMMENCE > $time )
|
||||
{
|
||||
echo '<p><font color="red" size="6">'.NOT_OPENED_YET.'</font></p>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<h5><img class="img_u04" src="img/x.gif" alt="login" /></h5>
|
||||
<p><?php echo COOKIES; ?></p>
|
||||
<?php
|
||||
$stime = strtotime( date( 'm/d/Y H:i', strtotime(START_DATE . ' ' . START_TIME ) ) );
|
||||
|
||||
// check whether the server has started or is yet to start
|
||||
if ( $stime > $time ){
|
||||
?>
|
||||
<br/><div style="text-align: center"><big>Server will start in: </big></div>
|
||||
<script language="JavaScript">
|
||||
TargetDate = "<?php echo date( 'm/d/Y H:i', strtotime(START_DATE . ' ' . START_TIME ) ); ?>";
|
||||
CountActive = true;
|
||||
CountStepper = -1;
|
||||
LeadingZero = true;
|
||||
DisplayFormat = "%%H%%:%%M%%:%%S%%";
|
||||
FinishMessage = "START NOW";
|
||||
|
||||
function calcage(secs, num1, num2) {
|
||||
s = ((Math.floor(secs/num1))%num2).toString();
|
||||
if (LeadingZero && s.length < 2)
|
||||
s = "0" + s;
|
||||
return "" + s + "";
|
||||
}
|
||||
|
||||
function CountBack(secs) {
|
||||
if (secs < 0) {
|
||||
document.getElementById("cntdwn").innerHTML = FinishMessage;
|
||||
return;
|
||||
}
|
||||
DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
|
||||
DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,100000));
|
||||
DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
|
||||
DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));
|
||||
|
||||
document.getElementById("cntdwn").innerHTML = DisplayStr;
|
||||
if (CountActive)
|
||||
setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
|
||||
}
|
||||
|
||||
function putspan(backcolor, forecolor) {
|
||||
document.write("<div class='activation_time' id='cntdwn'></div>");
|
||||
}
|
||||
|
||||
if (typeof(BackColor)=="undefined")
|
||||
BackColor = "white";
|
||||
if (typeof(ForeColor)=="undefined")
|
||||
ForeColor= "black";
|
||||
if (typeof(TargetDate)=="undefined")
|
||||
TargetDate = "12/31/2020 5:00 AM";
|
||||
if (typeof(DisplayFormat)=="undefined")
|
||||
DisplayFormat = "%%H%%:%%M%%:%%S%%";
|
||||
if (typeof(CountActive)=="undefined")
|
||||
CountActive = true;
|
||||
if (typeof(FinishMessage)=="undefined")
|
||||
FinishMessage = "";
|
||||
if (typeof(CountStepper)!="number")
|
||||
CountStepper = -1;
|
||||
if (typeof(LeadingZero)=="undefined")
|
||||
LeadingZero = true;
|
||||
|
||||
|
||||
CountStepper = Math.ceil(CountStepper);
|
||||
if (CountStepper == 0)
|
||||
CountActive = false;
|
||||
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
|
||||
putspan(BackColor, ForeColor);
|
||||
var dthen = new Date(TargetDate);
|
||||
var dnow = new Date();
|
||||
if(CountStepper>0)
|
||||
ddiff = new Date(dnow-dthen);
|
||||
else
|
||||
ddiff = new Date(dthen-dnow);
|
||||
gsecs = Math.floor(ddiff.valueOf()/1000);
|
||||
CountBack(gsecs);
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}else{ ?>
|
||||
<form method="post" name="snd" action="login.php">
|
||||
<input type="hidden" name="ft" value="a4" />
|
||||
<script type="text/javascript">
|
||||
Element.implement({
|
||||
//imgid: if an arrow belongs to the link this can be "opened"
|
||||
showOrHide: function(imgid) {
|
||||
//insert
|
||||
if (this.getStyle('display') == 'none')
|
||||
{
|
||||
if (imgid != '')
|
||||
{
|
||||
$(imgid).className = 'open';
|
||||
}
|
||||
}
|
||||
//hide
|
||||
else
|
||||
{
|
||||
if (imgid != '')
|
||||
{
|
||||
$(imgid).className = 'close';
|
||||
}
|
||||
}
|
||||
this.toggleClass('hide');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<table cellpadding="1" cellspacing="1" id="login_form">
|
||||
<tbody>
|
||||
<tr class="top">
|
||||
<th><?php echo NAME; ?></th>
|
||||
<td><input class="text" type="text" name="user" value="<?php echo htmlspecialchars($form->getDiff("user",$_COOKIE['COOKUSR'])); ?>" maxlength="30" autocomplete='off' /> <span class="error"> <?php echo $form->getError("user"); ?></span></td>
|
||||
</tr>
|
||||
<tr class="btm">
|
||||
<th><?php echo PASSWORD; ?></th>
|
||||
<td><input class="text" type="password" name="pw" value="<?php echo htmlspecialchars($form->getValue("pw"), ENT_QUOTES, 'UTF-8');?>" maxlength="100" autocomplete='off' /> <span class="error"><?php echo $form->getError("pw"); ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="btn">
|
||||
<!--<input type="hidden" name="e1d9d0c" value="" />-->
|
||||
<button value="login" name="s1" onclick="xy();" id="btn_login" class="trav_buttons" alt="login button" /> Login </button>
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<?php }
|
||||
}
|
||||
if ($form->getError("pw") == LOGIN_PW_ERROR) {
|
||||
echo "<p class=\"error_box\">
|
||||
<span class=\"error\">".PW_FORGOTTEN."</span><br>
|
||||
".PW_REQUEST."<br>
|
||||
<a href=\"password.php?npw=".$database->getUserField($form->getValue('user'), 'id', 1)."\">".PW_GENERATE."</a>
|
||||
</p>";
|
||||
}
|
||||
if($form->getError("activate") != "") {
|
||||
echo "<p class=\"error_box\">
|
||||
<span class=\"error\">".EMAIL_NOT_VERIFIED."</span><br>
|
||||
".EMAIL_FOLLOW."<br>
|
||||
<a href=\"activate.php?usr=".urlencode($form->getError("activate"))."\">".VERIFY_EMAIL."</a>
|
||||
</p>";
|
||||
}
|
||||
if($form->getError("vacation") != "") {
|
||||
echo "<p class=\"error_box\">
|
||||
<span class=\"error\">".$form->getError("vacation")."</span></p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div id="side_info" class="outgame">
|
||||
<?php
|
||||
if(NEWSBOX1) { include("Templates/News/newsbox1.tpl"); }
|
||||
if(NEWSBOX2) { include("Templates/News/newsbox2.tpl"); }
|
||||
if(NEWSBOX3) { include("Templates/News/newsbox3.tpl"); }
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="footer-stopper outgame"></div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php include("Templates/footer.tpl"); ?>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user