* moved admin pages to twig

* edited account.management.html.twig to fit modern templates, tibiacom have its own template
* sample characters are now assigned to admin account and have group_id 4 to not be shown on highscores
* fixed database pages loading
* added require.database plugin option, which will prove if DATABASE_VERSION is enough
This commit is contained in:
slawkens
2017-10-10 15:32:59 +02:00
parent 856e72150c
commit 0a82f306f6
11 changed files with 837 additions and 695 deletions

View File

@@ -50,11 +50,14 @@ else
$uri = str_replace(array('index.php/', '?'), '', $uri);
$uri = strtolower($uri);
$found = false;
if(empty($uri) || isset($_REQUEST['template'])) {
$_REQUEST['p'] = 'news';
$found = true;
}
else if(file_exists(SYSTEM . 'pages/' . $uri . '.php')) {
$_REQUEST['p'] = $uri;
$found = true;
}
else {
$rules = array(
@@ -100,7 +103,6 @@ else {
exit();
}
$found = false;
foreach($rules as $rule => $redirect) {
if (preg_match($rule, $uri)) {
$tmp = explode('/', $uri);
@@ -118,15 +120,18 @@ else {
}
}
if(!$found) {
$_REQUEST['p'] = '404';
}
if(!$found)
$_REQUEST['p'] = $uri;
}
// define page visited, so it can be used within events system
$page = isset($_REQUEST['subtopic']) ? $_REQUEST['subtopic'] : (isset($_REQUEST['p']) ? $_REQUEST['p'] : '');
if(empty($page) || preg_match('/[^A-z0-9_\-]/', $page))
$page = 'news';
if(empty($page) || preg_match('/[^A-z0-9_\-]/', $page)) {
if(!$found)
$page = '404';
else
$page = 'news';
}
$page = strtolower($page);
define('PAGE', $page);
@@ -306,7 +311,7 @@ if($load_it)
else
{
$file = SYSTEM . 'pages/' . $page . '.php';
if(!@file_exists($file))
if(!@file_exists($file) && !$found)
{
$page = '404';
$file = SYSTEM . 'pages/404.php';