real_escape_string($_GET['order']) : 'name';
$dir = (isset($_GET['dir'])) ? $db->real_escape_string($_GET['dir']) : 'down';
$order_dir = ($dir == 'up') ? 'ASC' :'DESC';
$dir = ($dir == 'down') ? 'up' : 'down';
$dir_img = ($dir == 'down') ? '' : '';
function MakeLink($show, $sort)
{
global $dir, $dir_img, $html;
if(isset($_GET['order']) and $_GET['order'] == $sort)
{
$arrow = $dir_img;
}
else
{
$arrow = '';
}
return($arrow.''.$show.'');
}
echo('
Online hráči
');
if(array_key_exists('RealmIndex', $_COOKIE))
{
$Realm = new Realm($System, $_COOKIE['RealmIndex']);
echo('Celkem '.$Realm->OnlineCharactersCount().' hráčů.
'.
'
Frakce |
'.MakeLink('Jméno', 'name').' |
'.MakeLink('Rasa', 'race').' |
'.MakeLink('Třída', 'class').' |
'.MakeLink('Úroveň', 'level').' |
'.MakeLink('Mapa', 'map').' |
'.MakeLink('Body cti', 'highest_rank').' '.
MakeLink('Body arén', 'arena_points').' |
');
$sql = $Realm->CharactersDatabase->query('SELECT guid, name, race, class, zone, map, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['HonorPoints'].'+1), " ", -1) AS UNSIGNED) AS highest_rank, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['ArenaPoints'].' + 1), " ", -1) AS UNSIGNED) AS arena_points, '.
'mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.$Config['Mangos']['CharacterDataOffset']['Gender'].' + 1), " ", -1) as unsigned) ), 8, 0), 4, 1) AS gender '.
'FROM `characters` WHERE `online`= 1 ORDER BY `'.$order_by.'` '.$order_dir);
while($row = $sql->fetch_assoc())
{
$aliance = array(1, 3, 4, 7, 11);
$frakce = (in_array($row['race'], $aliance)) ? '' : '';
$gender = ($row['gender'] == 0) ? '0' : '1';
echo('
'.$frakce.' |
'.$row['name'].' |
|
|
'.$row['level'].' |
'.$server->MapName($row['map']).' ('.$server->ZoneName($row['zone']).') |
'.$row['highest_rank'].' '.$row['arena_points'].' |
');
}
echo('
');
} else
{
$PlayerList = array();
$DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Enabled =1');
while($DbRealm = $DbResult2->fetch_assoc())
{
$Realm = new Realm($System, $DbRealm['Id']);
$sql = $Realm->CharactersDatabase->query('SELECT guid, name, race, class, zone, map, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['HonorPoints'].'+1), " ", -1) AS UNSIGNED) AS highest_rank, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level, '.
'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['ArenaPoints'].' + 1), " ", -1) AS UNSIGNED) AS arena_points, '.
'mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.$Config['Mangos']['CharacterDataOffset']['Gender'].' + 1), " ", -1) as unsigned) ), 8, 0), 4, 1) AS gender '.
'FROM `characters` WHERE `online`= 1');
$I = 0;
while($DbRow = $sql->fetch_assoc())
{
$DbRow['svet'] = $DbRealm['Name'];
$PlayerList[$DbRow[$order_by].$I] = $DbRow;
$I++;
}
}
echo('Celkem '.count($PlayerList).' hráčů ve všech světech.
'.
'
'.
'Frakce | '.
''.MakeLink('Jméno', 'name').' | '.
''.MakeLink('Rasa', 'race').' | '.
''.MakeLink('Třída', 'class').' | '.
''.MakeLink('Úroveň', 'level').' | '.
''.MakeLink('Svět', 'svet').' | '.
'
');
if($order_dir == 'ASC') ksort($PlayerList);
else krsort($PlayerList);
foreach($PlayerList as $row)
{
$aliance = array(1, 3, 4, 7, 11);
$frakce = (in_array($row['race'], $aliance)) ? '' : '';
$gender = ($row['gender'] == 0) ? '0' : '1';
echo(''.
''.$frakce.' | '.
''.$row['name'].' | '.
' | '.
' | '.
''.$row['level'].' | '.
''.$row['svet'].' | '.
'
');
}
echo('
');
}
?>