Hello i want to show you the simple code, when you can check how many player are training and which type they are training.
This is very simple but usefull
offline.php
config/config.php
index.php
Remember that works if you have offline training on your server
Rep will be nice
Have fun !
This is very simple but usefull
offline.php
PHP:
<?PHP
$i = 0;
$main_content .= '<h2>Already Training on Denera World!</h2><TABLE border=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%class="table table-striped"><TR><TD CLASS=white COLSPAN=4>';
$n = $SQL->query('SELECT COUNT(`offlinetraining_skill`) as `count` FROM `players` WHERE `offlinetraining_skill` > 0;')->fetch();
$main_content .= '<div class="alert alert-success">There are '.$n['count'].' players already training on our world!</div></TD></TR><TR><TD WIDTH=30%><B>Name</B></TD><TD WIDTH="10%"><B>Level</B></TD><TD WIDTH="20%"><B>Vocation</B></TD><TD WIDTH="50%"><center><B>Training Type</B></center></TD></TR>';
$list = $SQL->query('SELECT `name`, `level`, `vocation`, `promotion`, `offlinetraining_skill` FROM `players` WHERE `offlinetraining_skill` > 0;')->fetchAll();
foreach($list as $player) {
$i++;
$main_content.= '<TR><TD WIDTH=30%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].'</A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$vocation_name[0][$player['promotion']][$player['vocation']].'</TD><TD WIDTH=50%><center>'.$skill_name[0][$player['offlinetraining_skill']].'</center></TD></TR>';
}
$main_content .= '</TABLE></td></tr></table>';
?>
config/config.php
PHP:
$skill_name[0] = array(1 => 'Club + Shielding',2 => 'Sword + Shielding',3 => 'Axe + Shielding',4 => 'Distance + Shielding',7 => 'Magic + Shielding');
index.php
PHP:
case "offline";
$topic = "Already Training";
$subtopic = "offline";
include("offline.php");
break;
Remember that works if you have offline training on your server
Rep will be nice
Have fun !