Extended support for legacy versions of Apache

- Newest version of Apache is no longer required but recommended
- Support for mod_rewrite is no longer required but recommended
- Support for htaccess is no longer required, but recommended
This commit is contained in:
Wruczek 2016-06-29 02:49:18 +02:00
parent a171b24fdc
commit 861c0365a1
5 changed files with 19 additions and 8 deletions

View File

@ -19,6 +19,9 @@ $config["general"]["newsDir"] = "news";
$config["general"]["contactEmail"] = "email@strona.pl"; // Twój email kontaktowy $config["general"]["contactEmail"] = "email@strona.pl"; // Twój email kontaktowy
$config["general"]["enablehta"] = false; // Właczenie / wyłączenie dodatkowych usprawnień strony w htaccess (zalecane,
// wymaga jednak aktualnej wersji Apache oraz włączenia htaccess oraz mod_rewrite)
/********* Konfiguracja serwera TeamSpeak *********/ /********* Konfiguracja serwera TeamSpeak *********/
@ -40,6 +43,8 @@ $config["navlinks"] = array(
array("fa-shopping-cart", "Sklep", "sklep") array("fa-shopping-cart", "Sklep", "sklep")
); );
/************* Konfiguracja listy administratorow *************/ /************* Konfiguracja listy administratorow *************/
// ID grup wyświetlanych na liście administracji // ID grup wyświetlanych na liście administracji

View File

@ -4,10 +4,10 @@
<!-- Footer --> <!-- Footer -->
<hr> <hr>
<footer> <footer>
<p class="pull-left">&copy; twojanazwa 2016</p> <p class="pull-left">&copy; <?php echo $config["general"]["title"]; ?> 2016</p>
<div class="pull-right"> <div class="pull-right">
<ul class="list-inline"> <ul class="list-inline">
<li>Strona &copy; <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.1.1 | MIT License</li> <li>Strona &copy; <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.2.0 | MIT License</li>
</ul> </ul>
</div> </div>
</footer> </footer>
@ -35,6 +35,8 @@
<?php } ?> <?php } ?>
<!-- Custom JS --> <!-- Custom JS -->
<script>var apiurl = "api/status<?php echo $config["general"]["enablehta"] ? "" : ".php" ?>";</script>
<script src="js/script.js"></script> <script src="js/script.js"></script>
<script src="js/status.js"></script> <script src="js/status.js"></script>
</body> </body>

View File

@ -58,8 +58,8 @@ require_once __DIR__ . "/../include/adminlist.php";
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li><a href="viewer"><i class="fa fa-eye" aria-hidden="true"></i> Podgląd serwera</a></li> <li><a href="viewer<?php echo $config["general"]["enablehta"] ? "" : ".php" ?>"><i class="fa fa-eye" aria-hidden="true"></i> Podgląd serwera</a></li>
<li><a href="bans"><i class="fa fa-ban" aria-hidden="true"></i> Lista banów</a></li> <li><a href="bans<?php echo $config["general"]["enablehta"] ? "" : ".php" ?>"><i class="fa fa-ban" aria-hidden="true"></i> Lista banów</a></li>
<!-- Nie mam na to czasu <!-- Nie mam na to czasu
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-television" aria-hidden="true"></i></i>Ranking <span class="caret"></span></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-television" aria-hidden="true"></i></i>Ranking <span class="caret"></span></a>
@ -120,7 +120,7 @@ require_once __DIR__ . "/../include/adminlist.php";
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-eye" aria-hidden="true"></i> Podgląd serwera</div> <div class="panel-heading"><i class="fa fa-eye" aria-hidden="true"></i> Podgląd serwera</div>
<div class="panel-body"> <div class="panel-body">
<a href="viewer" class="btn btn-primary btn-lg btn-block"><i class="fa fa-eye" aria-hidden="true"></i> Zobacz &raquo;</a> <a href="viewer<?php echo $config["general"]["enablehta"] ? "" : ".php" ?>" class="btn btn-primary btn-lg btn-block"><i class="fa fa-eye" aria-hidden="true"></i> Zobacz &raquo;</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,6 @@
<?php <?php
/* Od wersji 1.2.0 sprawny htaccess nie jest już wymagany
if (!isset($_SERVER['HTACCESS'])) { if (!isset($_SERVER['HTACCESS'])) {
$title = 'Plik .htaccess nie jest włączony'; $title = 'Plik .htaccess nie jest włączony';
@ -9,7 +10,9 @@ if (!isset($_SERVER['HTACCESS'])) {
die(showError($title, $text)); die(showError($title, $text));
} }
*/
/* Od wersji 1.2.0 mod_rewrite nie jest już wymagany
if(!in_array('mod_rewrite', apache_get_modules())) { if(!in_array('mod_rewrite', apache_get_modules())) {
$title = 'Brak wymaganych rozszerzeń'; $title = 'Brak wymaganych rozszerzeń';
@ -25,6 +28,7 @@ service apache2 reload</pre>
die(showError($title, $text)); die(showError($title, $text));
} }
*/
if(!file_exists(__DIR__ . "/../config/config.php")) { if(!file_exists(__DIR__ . "/../config/config.php")) {
@ -80,7 +84,7 @@ function showError($title, $text) { ?>
<?php echo $text; ?> <?php echo $text; ?>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
Strona &copy; <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.1.1 | MIT License Strona &copy; <a href="http://wruczek.top">Wruczek</a> 2016 | <a href="https://github.com/Wruczek/ts-website">ts-website</a> v 1.2.0 | MIT License
</div> </div>
</div> </div>

View File

@ -8,9 +8,9 @@ $(document).ready(function () {
}) })
function checkStatus() { function checkStatus() {
$.ajax({ $.ajax({
url: "api/status", url: apiurl,
success: function (json) { success: function (json) {
json = json.tsstatus; json = json.tsstatus;