Check for correct path - serverinfo

This commit is contained in:
rigaer@hotmail.es 2014-05-21 18:30:20 +02:00
parent 29ebf4ee60
commit c695014f19

View File

@ -4,11 +4,15 @@
Here you will find all basic information about <?php echo '<b>'.$config['site_title'].'</b>'; ?> Here you will find all basic information about <?php echo '<b>'.$config['site_title'].'</b>'; ?>
<?php <?php
// Check if server stages are enabled // Check if PATH is correct
$stages_path = simplexml_load_file($config['server_path'].'/data/xml/stages.xml');
$lua_path = parse_ini_file($config['server_path'].'/config.lua');
if ($stages_path->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');
if ($stages_path->config['enabled'] != 0) {
// Stages are beeing used // Stages are beeing used
echo "<h2>Server stages</h2> echo "<h2>Server stages</h2>
@ -26,7 +30,7 @@ if ($stages_path->config['enabled'] != 0) {
echo '</tbody></table>'; echo '</tbody></table>';
} else { } else {
// Not using stages // Not using stages
echo "<h2>Server rates</h2> echo "<h2>Server rates</h2>
@ -34,11 +38,11 @@ if ($stages_path->config['enabled'] != 0) {
<tbody><tr class='yellow'><td>Experience rate</td><td>Skills rate</td><td>Magic rate</td><td>Loot rate</td></tr> <tbody><tr class='yellow'><td>Experience rate</td><td>Skills rate</td><td>Magic rate</td><td>Loot rate</td></tr>
<tr><td><center>x".$lua_path['rateExp']."</center></td><td><center>x".$lua_path['rateSkill']."</center></td><td><center>x".$lua_path['rateMagic']."</center></td><td><center>x".$lua_path['rateLoot']."</center></td></tr> <tr><td><center>x".$lua_path['rateExp']."</center></td><td><center>x".$lua_path['rateSkill']."</center></td><td><center>x".$lua_path['rateMagic']."</center></td><td><center>x".$lua_path['rateLoot']."</center></td></tr>
</tbody></table>"; </tbody></table>";
} }
// General info // General info
$information = array( $information = array(
'World type' => $lua_path['worldType'], 'World type' => $lua_path['worldType'],
'Protection level' => $lua_path['protectionLevel'], 'Protection level' => $lua_path['protectionLevel'],
@ -52,15 +56,20 @@ $information = array(
'Location' => $lua_path['location'], 'Location' => $lua_path['location'],
'Owner name' => $lua_path['ownerName'] 'Owner name' => $lua_path['ownerName']
); );
echo "<h2>Server general information</h2><ul>"; echo "<h2>Server general information</h2><ul>";
foreach ($information as $key => $value) { foreach ($information as $key => $value) {
echo "<li>".$key." - <b>".$value."</b></li>"; echo "<li>".$key." - <b>".$value."</b></li>";
} }
echo '</ul>'; echo '</ul>';
} else {
echo '<h1>Invliad PATH, please check your config file</h1>';
}
?> ?>
<?php include 'layout/overall/footer.php'; ?> <?php include 'layout/overall/footer.php'; ?>