mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Redesign install system & New Medal System
Redesign install system & New Medal System Artefact Holder [#ARTEFACT] WW Builder [#WWBUILDER] Great Store [#GREATSTORE] Wall Master [#WALLMASTER] Hero 99+ [#HERO100]
This commit is contained in:
@@ -318,6 +318,7 @@ define("NEW_FUNCTIONS_DISPLAY_LINKS", %NEW_FUNCTIONS_DISPLAY_LINKS%);
|
||||
define("NEW_FUNCTIONS_MEDAL_3YEAR", %NEW_FUNCTIONS_MEDAL_3YEAR%);
|
||||
define("NEW_FUNCTIONS_MEDAL_5YEAR", %NEW_FUNCTIONS_MEDAL_5YEAR%);
|
||||
define("NEW_FUNCTIONS_MEDAL_10YEAR", %NEW_FUNCTIONS_MEDAL_10YEAR%);
|
||||
define("NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM", %NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%);
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
|
||||
@@ -168,6 +168,7 @@ class Process {
|
||||
$findReplace["%NEW_FUNCTIONS_MEDAL_3YEAR%"] = $_POST['new_functions_medal_3year'];
|
||||
$findReplace["%NEW_FUNCTIONS_MEDAL_5YEAR%"] = $_POST['new_functions_medal_5year'];
|
||||
$findReplace["%NEW_FUNCTIONS_MEDAL_10YEAR%"] = $_POST['new_functions_medal_10year'];
|
||||
$findReplace["%NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%"] = $_POST['new_functions_special_medals_system'];
|
||||
|
||||
fwrite($gameConfig, str_replace(array_keys($findReplace), array_values($findReplace), $text));
|
||||
|
||||
|
||||
@@ -1,106 +1,84 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Filename accounts.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: https://travianz.org ##
|
||||
## https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
## Filename : accounts.tpl ##
|
||||
## Type : Install Panel Frontend & Backend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
if(isset($_GET['err']) && $_GET['err'] == 1) {
|
||||
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">At least Multihunter & Support password are required in this form.</span></div><br /><br />";
|
||||
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;margin-bottom:14px;">At least Multihunter & Support password are required.</div>';
|
||||
}
|
||||
|
||||
if(isset($_GET['err']) && $_GET['err'] == 2) {
|
||||
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">Natars is a reserved username for an in-game NPC tribe. Please choose a different admin username.</span></div><br /><br />";
|
||||
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;margin-bottom:14px;">Natars is reserved. Choose different admin username.</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form action="include/accounts.php" method="post" id="dataform">
|
||||
<div class="grid-2">
|
||||
<div class="card">
|
||||
<span class="f10 c">Multihunter account</span>
|
||||
<div style="margin-top:12px;display:grid;gap:10px;">
|
||||
<div><label>Name</label><input class="input" type="text" value="Multihunter" disabled></div>
|
||||
<div><label>Password</label><input class="input" type="password" name="mhpw" required></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="f10 c">Support account</span>
|
||||
<div style="margin-top:12px;display:grid;gap:10px;">
|
||||
<div><label>Name</label><input class="input" type="text" value="Support" disabled></div>
|
||||
<div><label>Password</label><input class="input" type="password" name="spw" required></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Multihunter account</span>
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="mhuser" id="mhuser" value="Multihunter" disabled="disabled"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="password" name="mhpw" id="mhpw" value=""></td></tr>
|
||||
<tr><td>Note: Rember this password! You need it for the Admin</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Support account</span>
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="suser" id="suser" value="Support" disabled="disabled"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="password" name="spw" id="spw" value=""></td></tr>
|
||||
<tr><td>Note: Rember this password! You need it for the Admin</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Admin account</span>
|
||||
<table>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Admin name:</span></td>
|
||||
<td><input type="text" name="aname" id="aname" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Admin email:</span></td>
|
||||
<td><input type="text" name="aemail" id="aemail" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Admin password:</span></td>
|
||||
<td><input type="password" name="apass" id="apass" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Admin tribe:</span></td>
|
||||
<td>
|
||||
<select name="atribe" id="atribe">
|
||||
<option value="1" selected="selected">Romans</option>
|
||||
<option value="2">Teutons</option>
|
||||
<option value="3">Gauls</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Show admin in stats:</span></td>
|
||||
<td>
|
||||
<select name="admin_rank">
|
||||
<option value="true">true</option>
|
||||
<option value="false" selected="selected">false</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Include Support Messages in Admin Mailbox:</span></td>
|
||||
<td>
|
||||
<select name="admin_support_msgs">
|
||||
<option value="true" selected="selected">true</option>
|
||||
<option value="false">false</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Allow Administrative Accounts to be Raided and Attacked:</span></td>
|
||||
<td>
|
||||
<select name="admin_raidable">
|
||||
<option value="true" selected="selected">true</option>
|
||||
<option value="false">false</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2">Note: this will add a first user and will set them up as an Admin</td><td></td></tr>
|
||||
<tr><td colspan="2">Note: you can leave this section empty, if you want</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<center>
|
||||
<input type="submit" name="Submit" id="Submit" value="Submit"></center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="f10 c">Admin account</span>
|
||||
<div class="grid-2" style="margin-top:12px;">
|
||||
<div><label>Admin name</label><input class="input" name="aname"></div>
|
||||
<div><label>Admin email</label><input class="input" name="aemail" type="email"></div>
|
||||
<div><label>Admin password</label><input class="input" name="apass" type="password"></div>
|
||||
<div><label>Tribe</label>
|
||||
<select class="input" name="atribe">
|
||||
<option value="1" selected>Romans</option>
|
||||
<option value="2">Teutons</option>
|
||||
<option value="3">Gauls</option>
|
||||
</select>
|
||||
</div>
|
||||
<div><label>Show in stats</label>
|
||||
<select class="input" name="admin_rank">
|
||||
<option value="true">true</option>
|
||||
<option value="false" selected>false</option>
|
||||
</select>
|
||||
</div>
|
||||
<div><label>Include Support Msgs</label>
|
||||
<select class="input" name="admin_support_msgs">
|
||||
<option value="true" selected>true</option>
|
||||
<option value="false">false</option>
|
||||
</select>
|
||||
</div>
|
||||
<div><label>Allow Raidable</label>
|
||||
<select class="input" name="admin_raidable">
|
||||
<option value="true" selected>true</option>
|
||||
<option value="false">false</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p style="color:#64748b;font-size:12px;margin-top:12px;">Note: leave empty if you want to skip admin creation.</p>
|
||||
<div style="text-align:center;margin-top:12px;">
|
||||
<button class="btn" type="submit">Create Accounts</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+223
-763
File diff suppressed because it is too large
Load Diff
@@ -3,50 +3,37 @@
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Filename dataform.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: https://travianz.org ##
|
||||
## https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
## Filename : dataform.tpl ##
|
||||
## Type : Install Panel Frontend & Backend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
include_once('../GameEngine/config.php');
|
||||
|
||||
if(isset($_GET['c']) && $_GET['c'] == 1) {
|
||||
echo "<div class=\"headline\"><span class=\"f10 c5\">Error importing database. Check configuration.</span></div><br>";
|
||||
echo '<div class="card" style="border-color:#fecaca;background:#fef2f2;color:#991b1b;"><b>Error importing database. Check configuration.</b></div>';
|
||||
}
|
||||
|
||||
if(isset($_GET['err']) && $_GET['err'] == 1) {
|
||||
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">Existing structure was found in the database! Please remove old game tables with the <i>".TB_PREFIX."</i> prefix from the '<strong>".SQL_DB."</strong>' database before continuing.</span></div><br /><br />";
|
||||
echo '<div class="card" style="border-color:#fecaca;background:#fef2f2;color:#991b1b;">Existing structure found! Please remove tables with prefix <b>'.TB_PREFIX.'</b> from database <b>'.SQL_DB.'</b>.</div>';
|
||||
}
|
||||
?>
|
||||
<form action="process.php" method="post" id="dataform">
|
||||
<input type="hidden" name="substruc" value="1">
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Create Database Structure</span>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<b>Warning</b>: This can take some time. Please wait until the next page has been loaded. Click Create to proceed...
|
||||
<br>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<input type="submit" name="Submit" id="Submit" value="Create..." onClick="return proceed()">
|
||||
<br>
|
||||
<br>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<input type="hidden" name="substruc" value="1">
|
||||
<div class="card">
|
||||
<span class="f10 c">Create Database Structure</span>
|
||||
<p style="color:#475569;"><b>Warning</b>: This can take some time. Please wait until the next page loads.</p>
|
||||
<div style="text-align:center;margin-top:12px;">
|
||||
<button class="btn" id="Submit" onclick="return proceed()">Create Database...</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+54
-50
@@ -1,57 +1,61 @@
|
||||
<?php
|
||||
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Filename end.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: https://travianz.org ##
|
||||
## https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
## Filename : end.tpl ##
|
||||
## Type : Install Panel Frontend & Backend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
?>
|
||||
<p>
|
||||
Thanks for installing TravianZ.
|
||||
<h4>Please remove/rename the installation folder.</h4>
|
||||
All the files are placed. The database is created, so you can now start playing on your own Travian.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Delete install folder (sudo rm -R install)</li>
|
||||
<li>CHMOD GameEngine back to 755 (sudo chmod -R 755 GameEngine)</li>
|
||||
<li>CHMOD Prevention to 777 (sudo chmod -R 777 GameEngine/Prevention)</li>
|
||||
<li>CHMOD Notes to 777 (sudo chmod -R 777 GameEngine/Notes)</li>
|
||||
<li>CHMOD var/log to 777 (sudo chmod -R 777 var/log)</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Protect folder /Admin with password protect directory</li>
|
||||
</ul>
|
||||
|
||||
<?php include("../GameEngine/config.php");
|
||||
$time = time();
|
||||
rename("../install/","../installed_".$time);
|
||||
touch('../var/installed');
|
||||
?>
|
||||
<p>
|
||||
<center><font size="4"><a href="<?php echo HOMEPAGE; ?>">> My TravianZ homepage <</font></a></center>
|
||||
</p>
|
||||
</br>
|
||||
<center>
|
||||
<h2>Please support our developers and donate.</h2>
|
||||
</br>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
<input type="hidden" name="cmd" value="_s-xclick">
|
||||
<input type="hidden" name="hosted_button_id" value="QHUTVY5MLECFQ">
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
|
||||
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
|
||||
</form>
|
||||
</center>
|
||||
include("../GameEngine/config.php"); $time=time(); @rename("../install/","../installed_".$time); @touch('../var/installed'); ?>
|
||||
<div class="card" style="text-align:center;">
|
||||
<h2 style="margin:0 0 8px;">🎉 Installation Complete!</h2>
|
||||
<p style="color:#475569;">Thanks for installing TravianZ. Please remove the install folder.</p>
|
||||
<div style="display:inline-block;text-align:left;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:12px 16px;font-family:ui-monospace;font-size:13px;line-height:1.6;">
|
||||
rm -R install<br>
|
||||
chmod -R 755 GameEngine<br>
|
||||
chmod -R 777 GameEngine/Prevention<br>
|
||||
chmod -R 777 GameEngine/Notes<br>
|
||||
chmod -R 777 var/log
|
||||
</div>
|
||||
<div style="margin-top:16px;"><a class="btn" href="<?php echo HOMEPAGE; ?>">Go to Homepage →</a></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin:0 0 12px;text-align:center;">🚀 Next Steps</h3>
|
||||
<div class="grid-2" style="gap:14px;">
|
||||
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
|
||||
<b>🔒 Secure Your Server</b>
|
||||
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Protect /Admin with .htpasswd, enable HTTPS, and set cronjobs for automated tasks.</p>
|
||||
</div>
|
||||
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
|
||||
<b>📖 Read the Docs</b>
|
||||
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Learn about speed settings, Natars, and world configuration in the GitHub Wiki.</p>
|
||||
</div>
|
||||
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
|
||||
<b>💬 Join Community</b>
|
||||
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Get help, share mods, and report bugs on GitHub Discussions.</p>
|
||||
</div>
|
||||
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
|
||||
<b>⭐ Star on GitHub</b>
|
||||
<p style="margin:6px 0 0;color:#475569;font-size:14px;">If you like TravianZ, star the repo to support the project.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align:center;margin-top:16px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;">
|
||||
<a class="btn" style="background:#0f172a;" href="https://github.com/Shadowss/TravianZ" target="_blank">GitHub</a>
|
||||
<a class="btn" style="background:#16a34a;" href="https://github.com/Shadowss/TravianZ/wiki" target="_blank">Documentation</a>
|
||||
<a class="btn" style="background:#64748b;" href="mailto:cata7007@gmail.com">Contact Support</a>
|
||||
</div>
|
||||
</div>
|
||||
+39
-50
@@ -1,51 +1,40 @@
|
||||
|
||||
<br>
|
||||
|
||||
<h4> Disclaimer</h4>
|
||||
|
||||
<ul>
|
||||
<li>Along with the installation/usage of this game, you shall be fully responsible for any legal results that may raised initiated by the owners of any unlicensed content you permit your copy of this game to publish.</li>
|
||||
|
||||
<li>Neither the team that created this script nor the team that customised it to create this distribution/release shall be responsible for any damage done to your computer/server system.</li>
|
||||
|
||||
<li>All code was confirmed to be running correctly by the creation team without any visible security risk they were aware of at the time the released it. Similarly for the customisation team who customised it to create this distribution/release.</li>
|
||||
|
||||
<li>Users are asked to review the code on their own accord and behalf.</li>
|
||||
|
||||
<li>Any customization to the source code are the property of each customisation's author, it is up to each author's discretion whether to share it by including it in free open source distributions such as this one.</li>
|
||||
|
||||
<li><b>You have no rights to edit copyright notices or/and claim this script as your own.</b></li>
|
||||
|
||||
<li>Last but not least, Enjoy.</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<ul>
|
||||
<li><h4>Before Installation (Linux):</h4></li>
|
||||
<li>CHMOD install to 777 (chmod -R 777 install)</li>
|
||||
<li>CHMOD GameEngine to 777 (chmod -R 777 GameEngine)</li>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Delete install folder (sudo rm -R install)</li>
|
||||
<li>CHMOD GameEngine back to 755 (sudo chmod -R 755 GameEngine)</li>
|
||||
<li>CHMOD Prevention to 777 (sudo chmod -R 777 GameEngine/Prevention)</li>
|
||||
<li>CHMOD Notes to 777 (sudo chmod -R 777 GameEngine/Notes)</li>
|
||||
<li>CHMOD var/log to 777 (sudo chmod -R 777 var/log)</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Protect folder /Admin with password protect directory</li>
|
||||
</ul>
|
||||
|
||||
<div class="lbox">
|
||||
TravianZ Team
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<center>
|
||||
<form>
|
||||
<input type="button" name="next" value="Next" onclick="location.href='?s=1'">
|
||||
</form>
|
||||
</center>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin:0 0 8px;font-size:16px;">⚠️ Disclaimer</h3>
|
||||
<ul style="margin:0;padding-left:18px;line-height:1.6;color:#334155;">
|
||||
<li>Along with the installation/usage of this game, you shall be fully responsible for any legal results...</li>
|
||||
<li>Neither the team that created this script nor the team that customised it shall be responsible for any damage...</li>
|
||||
<li>All code was confirmed to be running correctly by the creation team...</li>
|
||||
<li>Users are asked to review the code on their own accord.</li>
|
||||
<li>Any customization to the source code are the property of each author's discretion.</li>
|
||||
<li><b>You have no rights to edit copyright notices or/and claim this script as your own.</b></li>
|
||||
<li>Last but not least, Enjoy.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grid-2">
|
||||
<div class="card">
|
||||
<h3 style="margin:0 0 8px;">🐧 Before Installation (Linux)</h3>
|
||||
<div style="font-family:ui-monospace;background:#0f172a;color:#e2e8f0;padding:10px;border-radius:8px;font-size:13px;">
|
||||
chmod -R 777 install<br>chmod -R 777 GameEngine
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3 style="margin:0 0 8px;">✅ After Installation</h3>
|
||||
<div style="font-family:ui-monospace;background:#0f172a;color:#e2e8f0;padding:10px;border-radius:8px;font-size:13px;">
|
||||
rm -R install<br>
|
||||
chmod -R 755 GameEngine<br>
|
||||
chmod -R 777 GameEngine/Prevention<br>
|
||||
chmod -R 777 GameEngine/Notes<br>
|
||||
chmod -R 777 var/log
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<b>🔒 Protect /Admin</b> with password protect directory (.htaccess).
|
||||
</div>
|
||||
|
||||
<div style="text-align:center;margin-top:16px;">
|
||||
<a class="btn" href="?s=1">Next →</a>
|
||||
<div style="margin-top:8px;color:#64748b;font-size:12px;">TravianZ Team</div>
|
||||
</div>
|
||||
+23
-31
@@ -1,38 +1,30 @@
|
||||
<div class="menu">
|
||||
<div class="stepper">
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Filename menu.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
## Filename : menu.tpl ##
|
||||
## Type : Install Panel Frontend & Backend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
switch($_GET['s']) {
|
||||
case 0:
|
||||
echo "<li class=\"c2 f9\">Intro</li><li class=\"c1 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 1:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c2 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 2:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c2 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 3:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c2 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 4:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">World Data</li><li class=\"c2 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 5:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">World Data</li><li class=\"c3 f9\">Accounts</li><li class=\"c2 f9\">End</li>";
|
||||
break;
|
||||
}
|
||||
|
||||
?></div>
|
||||
$steps = ['Intro','Configuration','Database','World Data','Accounts','End'];
|
||||
$cur = (int)($_GET['s'] ?? 0);
|
||||
foreach($steps as $i=>$name){
|
||||
$state = $i < $cur ? 'done' : ($i == $cur ? 'active' : '');
|
||||
echo "<div class='step $state'><span class='num'>".($i+1)."</span><span>$name</span></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
+105
-137
@@ -1,145 +1,113 @@
|
||||
<style type="text/css">
|
||||
.menu{
|
||||
margin-left: 23px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
.f18 {
|
||||
font-size: 18pt;
|
||||
}
|
||||
span.cc3 {position: absolute;right:10%}
|
||||
span.cc2 {position: absolute;left:10%}
|
||||
<style>
|
||||
:root{
|
||||
--bg:#0f172a; --bg2:#1e293b; --card:#ffffff; --muted:#64748b;
|
||||
--text:#0f172a; --border:#e5e7eb; --primary:#16a34a; --radius:14px;
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
body{margin:0;background:#f1f5f9!important;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;color:var(--text);}
|
||||
|
||||
div.lbox {width: 280px; padding-left: 29px; padding-bottom: 15px;}
|
||||
div.rbox {width: 196px; padding-left: 10px; padding-bottom: 15px;}
|
||||
div.wholebox {width: 494px; padding-left: 29px; padding-bottom: 15px;}
|
||||
div.wholebox div {float:none;}
|
||||
div.lbox ul, div.rbox ul {margin: 0 0 0 15px; padding: 0 15px 0 0;}
|
||||
/* ASCUNDE VECHIUL */
|
||||
#header, #mtop, #dynamic_header, img#msfilter, .footer-stopper, #side_info,
|
||||
#footer, .footer, #ce, div[style*="TRAVIANGAMES"], .copyright {display:none !important;}
|
||||
|
||||
.wrapper{max-width:1100px;margin:0 auto!important;padding:0 16px 20px!important;background:transparent!important;box-shadow:none!important;}
|
||||
|
||||
/* HEADER */
|
||||
.tz-header{
|
||||
max-width:1100px;margin:20px auto 0;padding:22px 24px;
|
||||
background:linear-gradient(135deg,var(--bg),var(--bg2));
|
||||
border-radius:18px;color:#fff;display:flex;align-items:center;gap:16px;
|
||||
box-shadow:0 12px 30px rgba(2,6,23,.25);
|
||||
}
|
||||
.tz-header svg{width:42px;height:42px;flex-shrink:0;}
|
||||
.tz-header h1{margin:0;font-size:24px;letter-spacing:.3px;}
|
||||
.tz-header p{margin:2px 0 0;color:#cbd5e1;font-size:13px;}
|
||||
|
||||
/* FOOTER NOU */
|
||||
.tz-footer{
|
||||
max-width:1100px;margin:30px auto 30px;padding:16px 20px;
|
||||
background:#fff;border:1px solid var(--border);border-radius:14px;
|
||||
display:flex;justify-content:space-between;align-items:center;gap:12px;
|
||||
color:#64748b;font-size:13px;box-shadow:0 4px 14px rgba(0,0,0,.04);
|
||||
}
|
||||
.tz-footer b{color:#0f172a;}
|
||||
@media(max-width:700px){.tz-footer{flex-direction:column;text-align:center;}}
|
||||
|
||||
#mid{display:grid!important;grid-template-columns:260px 1fr!important;gap:18px!important;margin:18px 0 0!important;background:transparent!important;}
|
||||
#side_navi{background:var(--card)!important;border:1px solid var(--border)!important;border-radius:var(--radius)!important;padding:14px!important;height:fit-content!important;box-shadow:0 4px 14px rgba(0,0,0,.04)!important;}
|
||||
#content.login{background:var(--card)!important;border:1px solid var(--border)!important;border-radius:var(--radius)!important;padding:22px!important;box-shadow:0 4px 14px rgba(0,0,0,.04)!important;float:none!important;width:auto!important;margin:0!important;}
|
||||
|
||||
.headline{text-align:center;margin:8px 0 18px;}
|
||||
.headline .f18{font-size:22px!important;font-weight:700!important;color:#dc2626!important;}
|
||||
.card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:14px;}
|
||||
.btn{display:inline-block;background:var(--primary);color:#fff;border:0;padding:10px 18px;border-radius:10px;font-weight:600;cursor:pointer;text-decoration:none;box-shadow:0 6px 16px rgba(22,163,74,.2);}
|
||||
.btn:hover{filter:brightness(1.05);}
|
||||
.input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:10px;font-size:14px;background:#fff;}
|
||||
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
|
||||
@media(max-width:900px){#mid{grid-template-columns:1fr!important;}.tz-header{margin:12px 16px 0;}}
|
||||
|
||||
/* STEPPER */
|
||||
.stepper{display:flex;flex-direction:column;gap:8px;}
|
||||
.step{display:flex!important;align-items:center!important;gap:10px!important;padding:8px 10px!important;border-radius:10px!important;color:#334155!important;position:static!important;}
|
||||
.step .num{width:28px!important;height:28px!important;min-width:28px!important;border-radius:50%!important;display:flex!important;align-items:center!important;justify-content:center!important;background:#e2e8f0!important;color:#334155!important;font-weight:700!important;font-size:13px!important;position:static!important;}
|
||||
.step.active{background:#ecfdf5!important;color:#065f46!important;}
|
||||
.step.active .num{background:#16a34a!important;color:#fff!important;}
|
||||
.step.done{color:#166534!important;}
|
||||
.step.done .num{background:#bbf7d0!important;color:#166534!important;}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded',function(){
|
||||
// HEADER
|
||||
var h = document.createElement('div');
|
||||
h.className = 'tz-header';
|
||||
h.innerHTML = `
|
||||
<svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32 4L8 14v14c0 13.5 9.3 26.1 24 30 14.7-3.9 24-16.5 24-30V14L32 4z" fill="url(#g)"/>
|
||||
<path d="M32 8l20 8v12c0 11.2-7.7 21.7-20 25-12.3-3.3-20-13.8-20-25V16l20-8z" fill="#16a34a" opacity=".9"/>
|
||||
<path d="M26 32l5 5 11-11" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<defs><linearGradient id="g" x1="8" y1="4" x2="56" y2="58"><stop stop-color="#22c55e"/><stop offset="1" stop-color="#0f172a"/></linearGradient></defs>
|
||||
</svg>
|
||||
<div><h1>TravianZ Installation</h1><p>Setup wizard • v.9.0 Incremental Refactor</p></div>
|
||||
`;
|
||||
var wrap = document.querySelector('.wrapper');
|
||||
if(wrap) wrap.parentNode.insertBefore(h, wrap);
|
||||
|
||||
// FOOTER
|
||||
var f = document.createElement('div');
|
||||
f.className = 'tz-footer';
|
||||
f.innerHTML = `<div>© 2010 - 2026 TravianZ • All rights reserved</div><div>Server running on <b>v.9.0 Incremental Refactor</b></div>`;
|
||||
document.body.appendChild(f);
|
||||
|
||||
// curăță resturi vechi
|
||||
document.querySelectorAll('img, div, footer').forEach(el=>{
|
||||
if(el.textContent && el.textContent.includes('TRAVIANGAMES')) el.style.display='none';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
class IHG_Progressbar {
|
||||
|
||||
protected $bar_id;
|
||||
|
||||
protected $max_ticks;
|
||||
|
||||
protected $ticks;
|
||||
|
||||
protected $label;
|
||||
|
||||
public function __construct($max_ticks, $label = '%d van %d') {
|
||||
$this->bar_id = uniqid('progressbar');
|
||||
$this->label = $label;
|
||||
|
||||
$this->max_ticks = $max_ticks;
|
||||
$this->ticks = 0;
|
||||
}
|
||||
|
||||
public function tick() {
|
||||
$this->ticks++;
|
||||
$this->draw_progress();
|
||||
}
|
||||
|
||||
public function draw() {
|
||||
$this->draw_bar();
|
||||
$this->draw_progress();
|
||||
}
|
||||
|
||||
static public function draw_css() {
|
||||
echo '
|
||||
<style type="text/css">
|
||||
.ihg_progress_bar {
|
||||
display: block;
|
||||
width: 500px;
|
||||
height: 20px;
|
||||
border: 1px solid gray;
|
||||
padding: 1px;
|
||||
|
||||
margin: 3px auto;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ihg_progress_ticks {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
background-color: orange;
|
||||
width: 0;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ihg_progress_label_a,
|
||||
.ihg_progress_label_b {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
width: 500px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ihg_progress_label_a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ihg_progress_label_b {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
';
|
||||
}
|
||||
|
||||
protected function draw_bar() {
|
||||
echo '
|
||||
<div class="ihg_progress_bar">
|
||||
<span class="ihg_progress_label_a" id="' . $this->bar_id . '_label_a"></span>
|
||||
<div class="ihg_progress_ticks" id="' . $this->bar_id . '">
|
||||
<span class="ihg_progress_label_b" id="' . $this->bar_id . '_label_b"></span>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var bar = document.getElementById("' . $this->bar_id . '");
|
||||
var label_a = document.getElementById("' . $this->bar_id . '_label_a");
|
||||
var label_b = document.getElementById("' . $this->bar_id . '_label_b");
|
||||
|
||||
window["' . $this->bar_id . '"] = function(width, label) {
|
||||
bar.style.width = width + "%";
|
||||
label_a.innerHTML = label;
|
||||
label_b.innerHTML = label;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
';
|
||||
|
||||
$this->flush();
|
||||
}
|
||||
|
||||
protected function draw_progress() {
|
||||
|
||||
$width = round($this->ticks / $this->max_ticks * 100, 2);
|
||||
$label = sprintf($this->label, $this->ticks, $this->max_ticks);
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
window["' . $this->bar_id . '"]("' . $width . '", "' . addslashes($label) . '");
|
||||
</script>
|
||||
|
||||
';
|
||||
$this->flush();
|
||||
}
|
||||
|
||||
protected function flush() {
|
||||
while(ob_get_level() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
flush();
|
||||
}
|
||||
protected $bar_id; protected $max_ticks; protected $ticks; protected $label;
|
||||
public function __construct($max_ticks, $label = 'Step %d from %d') {
|
||||
$this->bar_id = uniqid('pb'); $this->label = $label;
|
||||
$this->max_ticks = $max_ticks; $this->ticks = 0;
|
||||
}
|
||||
public function tick(){ $this->ticks++; $this->draw_progress(); }
|
||||
public function draw(){ $this->draw_bar(); $this->draw_progress(); }
|
||||
static public function draw_css(){
|
||||
echo '<style>.ihg_wrap{margin:8px 0 18px}.ihg_bar{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden}.ihg_fill{height:100%;width:0;background:linear-gradient(90deg,#22c55e,#16a34a);transition:width .3s}.ihg_lab{font-size:12px;color:#64748b;margin-top:6px;text-align:center}</style>';
|
||||
}
|
||||
protected function draw_bar(){
|
||||
echo '<div class="ihg_wrap"><div class="ihg_bar"><div class="ihg_fill" id="'.$this->bar_id.'"></div></div><div class="ihg_lab" id="'.$this->bar_id.'_l"></div></div>';
|
||||
echo '<script>(function(){var b=document.getElementById("'.$this->bar_id.'"),l=document.getElementById("'.$this->bar_id.'_l");window["'.$this->bar_id.'"]=function(w,t){b.style.width=w+"%";l.textContent=t}})();</script>';
|
||||
$this->flush();
|
||||
}
|
||||
protected function draw_progress(){
|
||||
$w = round($this->ticks/$this->max_ticks*100,2);
|
||||
$t = sprintf($this->label,$this->ticks,$this->max_ticks);
|
||||
echo '<script>window["'.$this->bar_id.'"]("'.$w.'","'.addslashes($t).'");</script>'; $this->flush();
|
||||
}
|
||||
protected function flush(){ while(ob_get_level()>0){ob_end_flush();} flush(); }
|
||||
}
|
||||
?>
|
||||
+43
-184
@@ -1,202 +1,61 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Filename dataform.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: https://travianz.org ##
|
||||
## https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
## Filename : wdata.tpl ##
|
||||
## Type : Install Panel Frontend & Backend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
// install/wdata.tpl
|
||||
|
||||
include_once('../GameEngine/config.php');
|
||||
|
||||
if (isset($_GET['c']) && $_GET['c'] == '1') {
|
||||
echo '<br /><hr /><br /><div class="headline"><span class="f10 c5">Error creating wdata. Check configuration or file.</span></div><br><br>';
|
||||
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;">Error creating wdata. Check configuration or file.</div>';
|
||||
}
|
||||
if (isset($_GET['err']) && $_GET['err'] == '1') {
|
||||
echo '<br /><hr /><br /><div class="headline"><span class="f10 c5">Existing World Data found in the database! Please empty tables <i>'
|
||||
. TB_PREFIX . 'odata, ' . TB_PREFIX . 'units, ' . TB_PREFIX . 'vdata, ' . TB_PREFIX . 'wdata</i> before continuing.</span></div><br /><br />';
|
||||
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;">Existing World Data found! Empty tables <i>'.TB_PREFIX.'odata, '.TB_PREFIX.'units, '.TB_PREFIX.'vdata, '.TB_PREFIX.'wdata</i>.</div>';
|
||||
}
|
||||
|
||||
$autoStartCroppers = isset($_GET['startCroppers']) && $_GET['startCroppers'] === '1';
|
||||
?>
|
||||
|
||||
<form action="process.php" method="post" id="dataform">
|
||||
<input type="hidden" name="subwdata" value="1" />
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Create World Data</span>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<b>Warning</b>: This can take some time. Please wait until the next page has been loaded.
|
||||
Click Create to proceed...
|
||||
<br /><br />
|
||||
|
||||
<!-- Submit block (hidden when autoStartCroppers=1) -->
|
||||
<div id="submitWrap" style="display:<?php echo $autoStartCroppers ? 'none' : 'block'; ?>;">
|
||||
<center>
|
||||
<input type="submit" name="Submit" id="Submit" value="Create..." onClick="return proceed()" />
|
||||
<br /><br />
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<!-- Progress UI (shown when startCroppers=1) -->
|
||||
<div id="progressBox" style="display:<?php echo $autoStartCroppers ? 'block' : 'none'; ?>; margin-top:20px;">
|
||||
<div style="font-weight:bold;margin-bottom:6px;">Building croppers…</div>
|
||||
|
||||
<div style="background:#ddd;border-radius:8px;overflow:hidden;height:20px;max-width:500px;">
|
||||
<!-- Orange bar to match Travian vibes -->
|
||||
<div id="pbar" style="background:#f6a21a;height:100%;width:0%;transition:width .2s;"></div>
|
||||
</div>
|
||||
|
||||
<div id="pinfo" style="margin-top:6px;font-size:13px;color:#333;">Starting…</div>
|
||||
|
||||
<pre id="plog" style="margin-top:10px;background:#f9f9f9;border:1px solid #ddd;border-radius:8px;padding:8px;font-size:12px;max-height:200px;overflow:auto;"></pre>
|
||||
|
||||
<!-- Continue button appears on completion -->
|
||||
<div id="autoNext" style="display:none;margin-top:10px;">
|
||||
Proceeding to next step in <b id="cd">3</b>…
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="subwdata" value="1" />
|
||||
<div class="card">
|
||||
<span class="f10 c">Create World Data</span>
|
||||
<p style="color:#475569;"><b>Warning</b>: This can take some time. Please wait until the next page has been loaded.</p>
|
||||
|
||||
<div id="submitWrap" style="display:<?php echo $autoStartCroppers?'none':'block';?>;text-align:center;">
|
||||
<button class="btn" id="Submit" onclick="return proceed()">Create World...</button>
|
||||
</div>
|
||||
|
||||
<div id="progressBox" style="display:<?php echo $autoStartCroppers?'block':'none';?>;">
|
||||
<div style="font-weight:600;margin:10px 0;">Building croppers…</div>
|
||||
<div style="background:#e5e7eb;border-radius:999px;overflow:hidden;height:12px;max-width:600px;">
|
||||
<div id="pbar" style="background:linear-gradient(90deg,#f59e0b,#f97316);height:100%;width:0%;transition:width .2s;"></div>
|
||||
</div>
|
||||
<div id="pinfo" style="margin-top:6px;font-size:13px;color:#475569;">Starting…</div>
|
||||
<pre id="plog" style="margin-top:10px;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:10px;font-size:12px;max-height:200px;overflow:auto;"></pre>
|
||||
<div id="autoNext" style="display:none;margin-top:10px;color:#166534;font-weight:600;">Proceeding to next step in <b id="cd">3</b>…</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script><?php include('wdata_js_here_if_needed'); ?></script>
|
||||
<!-- păstrezi scriptul tău JS de mai jos exact cum era -->
|
||||
<script>
|
||||
(function () {
|
||||
var NEXT_URL = 'index.php?s=4'; // your next step
|
||||
var COUNTDOWN_SECS = 3;
|
||||
var finished = false;
|
||||
|
||||
function startCountdown() {
|
||||
var box = document.getElementById('autoNext');
|
||||
var cdEl = document.getElementById('cd');
|
||||
var left = COUNTDOWN_SECS;
|
||||
box.style.display = 'block';
|
||||
cdEl.textContent = left;
|
||||
var t = setInterval(function () {
|
||||
left--;
|
||||
cdEl.textContent = left;
|
||||
if (left <= 0) {
|
||||
clearInterval(t);
|
||||
window.location.href = NEXT_URL;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function startCroppersBuild() {
|
||||
var box = document.getElementById('progressBox');
|
||||
var pbar = document.getElementById('pbar');
|
||||
var pinfo= document.getElementById('pinfo');
|
||||
var plog = document.getElementById('plog');
|
||||
|
||||
var submitWrap = document.getElementById('submitWrap');
|
||||
if (submitWrap) submitWrap.style.display = 'none';
|
||||
box.style.display = 'block';
|
||||
|
||||
if (!('EventSource' in window)) {
|
||||
plog.textContent += "Your browser does not support live progress.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
var MAX_RETRIES = 3;
|
||||
var retries = 0;
|
||||
|
||||
var es = new EventSource('ajax_croppers.php');
|
||||
|
||||
es.onopen = function () {
|
||||
// When a connection (re)opens and we had errors before, log a small note
|
||||
if (!finished && retries > 0) {
|
||||
plog.textContent += "Reconnected to server.\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
}
|
||||
};
|
||||
|
||||
es.onmessage = function (e) {
|
||||
// Ignore non-JSON messages (pings / blanks)
|
||||
if (!e.data || e.data.charCodeAt(0) !== 123 /* '{' */) return;
|
||||
|
||||
try {
|
||||
var d = JSON.parse(e.data);
|
||||
var pct = (d.pct || 0) | 0;
|
||||
var done = (d.done || 0) | 0;
|
||||
var total = (d.total|| 0) | 0;
|
||||
|
||||
// If we've already finished, ignore further events
|
||||
if (finished) return;
|
||||
|
||||
// Valid data received -> reset retry counter
|
||||
retries = 0;
|
||||
|
||||
pbar.style.width = pct + '%';
|
||||
pinfo.textContent = done + ' / ' + total + ' (' + pct + '%)';
|
||||
|
||||
if (d.msg) {
|
||||
plog.textContent += d.msg + "\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
}
|
||||
|
||||
if (pct >= 100) {
|
||||
finished = true;
|
||||
plog.textContent += "✅ Completed!\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
es.close();
|
||||
startCountdown();
|
||||
}
|
||||
|
||||
// Optional: handle explicit error flag from server if you ever send it
|
||||
if (d.error) {
|
||||
finished = true;
|
||||
plog.textContent += "❌ " + (d.msg || "Server reported an error.") + "\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
es.close();
|
||||
startCountdown();
|
||||
}
|
||||
} catch (err) {
|
||||
// Silently ignore parsing problems now that we guard by '{'
|
||||
// plog.textContent += "Parse error.\n";
|
||||
}
|
||||
};
|
||||
|
||||
es.onerror = function () {
|
||||
// Don’t spam after we’re done
|
||||
if (finished) return;
|
||||
|
||||
retries++;
|
||||
plog.textContent += "⚠ Connection hiccup (" + retries + "/" + MAX_RETRIES + "), retrying…\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
|
||||
// EventSource will auto-reconnect by itself; we just decide when to give up
|
||||
if (retries >= MAX_RETRIES) {
|
||||
finished = true;
|
||||
plog.textContent += "❌ Too many connection failures — skipping croppers build.\n";
|
||||
plog.scrollTop = plog.scrollHeight;
|
||||
es.close();
|
||||
// Reuse the same countdown UI to move on
|
||||
startCountdown();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
<?php if ($autoStartCroppers) { echo 'startCroppersBuild();'; } ?>
|
||||
});
|
||||
var NEXT_URL = 'index.php?s=4'; var COUNTDOWN_SECS = 3; var finished = false;
|
||||
function startCountdown(){var box=document.getElementById('autoNext'),cd=document.getElementById('cd'),left=COUNTDOWN_SECS;box.style.display='block';cd.textContent=left;var t=setInterval(function(){left--;cd.textContent=left;if(left<=0){clearInterval(t);window.location.href=NEXT_URL}},1000)}
|
||||
function startCroppersBuild(){var box=document.getElementById('progressBox'),pbar=document.getElementById('pbar'),pinfo=document.getElementById('pinfo'),plog=document.getElementById('plog'),submitWrap=document.getElementById('submitWrap');if(submitWrap)submitWrap.style.display='none';box.style.display='block';if(!('EventSource'in window)){plog.textContent+="Browser no SSE\n";return}var MAX=3,retries=0,es=new EventSource('ajax_croppers.php');es.onopen=function(){if(!finished&&retries>0){plog.textContent+="Reconnected\n"}};es.onmessage=function(e){if(!e.data||e.data.charCodeAt(0)!==123)return;try{var d=JSON.parse(e.data),pct=d.pct|0,done=d.done|0,total=d.total|0;if(finished)return;retries=0;pbar.style.width=pct+'%';pinfo.textContent=done+' / '+total+' ('+pct+'%)';if(d.msg){plog.textContent+=d.msg+"\n";plog.scrollTop=plog.scrollHeight}if(pct>=100){finished=true;plog.textContent+="✅ Completed!\n";es.close();startCountdown()}if(d.error){finished=true;plog.textContent+="❌ "+(d.msg||"Error")+"\n";es.close();startCountdown()}}catch(err){}};es.onerror=function(){if(finished)return;retries++;plog.textContent+="⚠ hiccup ("+retries+"/"+MAX+")\n";if(retries>=MAX){finished=true;plog.textContent+="❌ Too many failures\n";es.close();startCountdown()}}}
|
||||
document.addEventListener('DOMContentLoaded',function(){<?php if($autoStartCroppers){echo 'startCroppersBuild();';} ?>});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</script>
|
||||
Reference in New Issue
Block a user