From c546a468478228c4faee5d262a1a538e36f3bc42 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 14 Sep 2017 15:03:09 +0200 Subject: [PATCH] * moved rules to twig * added bugtracker to kathrine template --- system/pages/bans.php | 2 +- system/pages/experiencestages.php | 22 +++++++++----------- system/pages/rules.php | 34 +------------------------------ system/pages/spells.php | 2 +- system/templates/rules.html.twig | 32 +++++++++++++++++++++++++++++ templates/kathrine/template.php | 5 ++--- 6 files changed, 47 insertions(+), 50 deletions(-) create mode 100644 system/templates/rules.html.twig diff --git a/system/pages/bans.php b/system/pages/bans.php index e2d42602..f55564f0 100644 --- a/system/pages/bans.php +++ b/system/pages/bans.php @@ -149,7 +149,7 @@ function getBanReason($reasonId) function getBanType($typeId) { - switch($reasonId) + switch($typeId) { case 1: return "IP Banishment"; diff --git a/system/pages/experiencestages.php b/system/pages/experiencestages.php index b3825394..b2b63c3f 100644 --- a/system/pages/experiencestages.php +++ b/system/pages/experiencestages.php @@ -12,13 +12,16 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Experience Stages'; +if(file_exists($config['data_path'] . 'XML/stages.xml')) { + $stages = new DOMDocument(); + $stages->load($config['data_path'] . 'XML/stages.xml'); +} + if(!isset($config['lua']['experienceStages']) || !getBoolean($config['lua']['experienceStages'])) { $enabled = false; - if(file_exists($config['data_path'] . 'XML/stages.xml')) { - $stages = new DOMDocument(); - $stages->load($config['data_path'] . 'XML/stages.xml'); + if(isset($stages)) { foreach($stages->getElementsByTagName('config') as $node) { if($node->getAttribute('enabled')) $enabled = true; @@ -34,23 +37,18 @@ if(!isset($config['lua']['experienceStages']) || !getBoolean($config['lua']['exp else if(isset($config['lua']['rate_exp'])) $rate_exp = $config['lua']['rate_exp']; - $content .= 'Server is not configured to use experience stages.
Current experience rate is: x' . $rate_exp . ''; + echo 'Server is not configured to use experience stages.
Current experience rate is: x' . $rate_exp . ''; return; } } -if(!isset($stages)) { - $stages = new DOMDocument(); - $stages->load($config['data_path'] . 'XML/stages.xml'); -} - if(!$stages) { echo 'Error: cannot load stages.xml!'; return; } -$content .= '

Experience stages

+echo '

Experience stages

@@ -61,11 +59,11 @@ $content .= '

Experience stages

foreach($stages->getElementsByTagName('stage') as $stage) { $maxlevel = $stage->getAttribute('maxlevel'); - $content .= ' + echo ''; } - $content .= ' + echo '
Stages table
'.$stage->getAttribute('minlevel') . '-'. (isset($maxlevel[0]) ? $maxlevel : '*') . 'x'.$stage->getAttribute('multiplier').'
'; diff --git a/system/pages/rules.php b/system/pages/rules.php index 5b7cc432..af64cc8c 100644 --- a/system/pages/rules.php +++ b/system/pages/rules.php @@ -12,36 +12,4 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Server Rules'; -if(PAGE == 'rules'): ?> - Rules
- - +echo $twig->render('rules.html.twig'); diff --git a/system/pages/spells.php b/system/pages/spells.php index 5ef955e6..3aadbc0f 100644 --- a/system/pages/spells.php +++ b/system/pages/spells.php @@ -143,7 +143,7 @@ if($canEdit) {{ config.lua.serverName }} Rules
+ +{% endif %} \ No newline at end of file diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index d2ec0144..e5c3d975 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -18,7 +18,7 @@ defined('MYAAC') or die('Direct access not allowed!'); elseif(in_array(PAGE, array('online', 'characters', 'guilds', 'highscores', 'wars', 'lastkills', 'houses', 'bans', 'forum', 'team'))) echo 'community'; - elseif(in_array(PAGE, array('account', 'accountmanagement', 'createaccount', 'lostaccount', 'rules'))) + elseif(in_array(PAGE, array('account', 'accountmanagement', 'createaccount', 'lostaccount', 'rules', 'bugtracker'))) echo 'account'; elseif(in_array(PAGE, array('points', 'gifts'))) echo 'shops'; @@ -175,8 +175,7 @@ defined('MYAAC') or die('Direct access not allowed!');
- - +