From c695014f1963dbbf0464fed54cf9fa6881f36081 Mon Sep 17 00:00:00 2001 From: "rigaer@hotmail.es" Date: Wed, 21 May 2014 18:30:20 +0200 Subject: [PATCH] Check for correct path - serverinfo --- serverinfo.php | 101 +++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/serverinfo.php b/serverinfo.php index 8f54f0a..8674e25 100644 --- a/serverinfo.php +++ b/serverinfo.php @@ -4,63 +4,72 @@ Here you will find all basic information about '.$config['site_title'].''; ?> config['enabled'] != 0) { +if (file_exists($config['server_path'].'/data/xml/stages.xml') && file_exists($config['server_path'].'/config.lua')) +{ + // Check if server stages are enabled + $stages_path = simplexml_load_file($config['server_path'].'/data/xml/stages.xml'); + $lua_path = parse_ini_file($config['server_path'].'/config.lua'); - // Stages are beeing used - echo "

Server stages

- - "; + if ($stages_path->config['enabled'] != 0) { - foreach ($stages_path->children()->stage as $stages) { + // Stages are beeing used + echo "

Server stages

+
Minium levelMaximun levelMultiplier
+ "; - if($stages['maxlevel'] === NULL) { - echo ''; - } else { - echo ''; + foreach ($stages_path->children()->stage as $stages) { + + if($stages['maxlevel'] === NULL) { + echo ''; + } else { + echo ''; + } } + + echo '
Minium levelMaximun levelMultiplier
'.$stages['minlevel'].'
Infinite
x'.$stages['multiplier'].'
'.$stages['minlevel'].'
'.$stages['maxlevel'].'
x'.$stages['multiplier'].'
'.$stages['minlevel'].'
Infinite
x'.$stages['multiplier'].'
'.$stages['minlevel'].'
'.$stages['maxlevel'].'
x'.$stages['multiplier'].'
'; + + } else { + + // Not using stages + echo "

Server rates

+ + + +
Experience rateSkills rateMagic rateLoot rate
x".$lua_path['rateExp']."
x".$lua_path['rateSkill']."
x".$lua_path['rateMagic']."
x".$lua_path['rateLoot']."
"; } - echo ''; + // General info + + $information = array( + + 'World type' => $lua_path['worldType'], + 'Protection level' => $lua_path['protectionLevel'], + 'Kills to red skull' => $lua_path['killsToRedSkull'], + 'Kills to black skull' => $lua_path['killsToBlackSkull'], + 'Remove ammo' => $lua_path['removeAmmoWhenUsingDistanceWeapon'], + 'Remove runes' => $lua_path['removeChargesFromRunes'], + 'Time to decrease frags' => $lua_path['timeToDecreaseFrags'], + 'House rent period' => $lua_path['houseRentPeriod'], + 'AFK Kickout minutes' => $lua_path['kickIdlePlayerAfterMinutes'], + 'Location' => $lua_path['location'], + 'Owner name' => $lua_path['ownerName'] + + ); + + echo "

Server general information

'; } else { - // Not using stages - echo "

Server rates

- - - -
Experience rateSkills rateMagic rateLoot rate
x".$lua_path['rateExp']."
x".$lua_path['rateSkill']."
x".$lua_path['rateMagic']."
x".$lua_path['rateLoot']."
"; + echo '

Invliad PATH, please check your config file

'; } -// General info - -$information = array( - - 'World type' => $lua_path['worldType'], - 'Protection level' => $lua_path['protectionLevel'], - 'Kills to red skull' => $lua_path['killsToRedSkull'], - 'Kills to black skull' => $lua_path['killsToBlackSkull'], - 'Remove ammo' => $lua_path['removeAmmoWhenUsingDistanceWeapon'], - 'Remove runes' => $lua_path['removeChargesFromRunes'], - 'Time to decrease frags' => $lua_path['timeToDecreaseFrags'], - 'House rent period' => $lua_path['houseRentPeriod'], - 'AFK Kickout minutes' => $lua_path['kickIdlePlayerAfterMinutes'], - 'Location' => $lua_path['location'], - 'Owner name' => $lua_path['ownerName'] - -); - -echo "

Server general information

'; - ?> \ No newline at end of file