| 1 | <?php
|
|---|
| 2 | include('global.php');
|
|---|
| 3 | ShowHeader();
|
|---|
| 4 |
|
|---|
| 5 | echo('<h3>Online hráči:</h3><div align="center">');
|
|---|
| 6 | $Database->select_db($Config['Mangos']['DatabaseCharacters']);
|
|---|
| 7 |
|
|---|
| 8 | $order_by = (isset($_GET['order_by'])) ? $Database->real_escape_string($_GET['order_by']) : "name";
|
|---|
| 9 |
|
|---|
| 10 | $dir = (isset($_GET['dir'])) ? $Database->real_escape_string($_GET['dir']) : 1;
|
|---|
| 11 | $order_dir = ($dir) ? "ASC" : "DESC";
|
|---|
| 12 | $dir = ($dir) ? 0 : 1;
|
|---|
| 13 |
|
|---|
| 14 | $result = $Database->query("SELECT count(*) FROM `characters` WHERE `online`= 1");
|
|---|
| 15 | $Row = $result->fetch_array();
|
|---|
| 16 | $total_online = $Row[0];
|
|---|
| 17 |
|
|---|
| 18 | $order_side = "";
|
|---|
| 19 |
|
|---|
| 20 | require_once("minimanager/scripts/defines.php");
|
|---|
| 21 | $result = $Database->query("SELECT guid, name, race, class, zone, map, CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_POINTS+1)."), ' ', -1) AS UNSIGNED) AS highest_rank, CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account FROM `characters` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir");
|
|---|
| 22 |
|
|---|
| 23 | require_once("minimanager/lang/english.php");
|
|---|
| 24 | $lang_index = array(
|
|---|
| 25 | // ----- INDEX.PHP -----
|
|---|
| 26 | 'realm' => 'Realm',
|
|---|
| 27 | 'online' => 'Online',
|
|---|
| 28 | 'offline_or_let_height' => 'Offline or Latency too Height',
|
|---|
| 29 | 'delete' => 'Delete',
|
|---|
| 30 | 'tot_users_online' => 'Celkem hráčů online',
|
|---|
| 31 | 'name' => 'Jméno',
|
|---|
| 32 | 'race' => 'Rasa',
|
|---|
| 33 | 'class' => 'Třída',
|
|---|
| 34 | 'level' => 'Úroveň',
|
|---|
| 35 | 'map' => 'Mapa',
|
|---|
| 36 | 'zone' => 'Zóna',
|
|---|
| 37 | 'honor_kills' => 'Body cti',
|
|---|
| 38 | );
|
|---|
| 39 |
|
|---|
| 40 | $output = "<font class=\"bold\">{$lang_index['tot_users_online']}: $total_online</font><br />
|
|---|
| 41 | <table class=\"TableGuilda\" border=\"1\" cellspacing=\"0\">
|
|---|
| 42 | <tr>
|
|---|
| 43 | <th width=\"26%\"><a href=\"?order_by=name&dir=$dir\">".($order_by=='name' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['name']}</a></th>
|
|---|
| 44 | <th width=\"7%\"><a href=\"?order_by=race&dir=$dir\">".($order_by=='race' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['race']}</a></th>
|
|---|
| 45 | <th width=\"7%\"><a href=\"?order_by=class&dir=$dir\">".($order_by=='class' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['class']}</a></th>
|
|---|
| 46 | <th width=\"7%\"><a href=\"?order_by=level&dir=$dir\">".($order_by=='level' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['level']}</a></th>
|
|---|
| 47 | <th width=\"20%\"><a href=\"?order_by=map&dir=$dir\">".($order_by=='map' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['map']}</a></th>
|
|---|
| 48 | <th width=\"25%\">{$lang_index['zone']}</th>
|
|---|
| 49 | <th width=\"10%\"><a href=\"?order_by=highest_rank&dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"images/online_player//arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['honor_kills']}</a></th>
|
|---|
| 50 | </tr>";
|
|---|
| 51 |
|
|---|
| 52 | require_once("minimanager/scripts/id_tab.php");
|
|---|
| 53 |
|
|---|
| 54 | while($char = $result->fetch_row())
|
|---|
| 55 | {
|
|---|
| 56 | $zone = get_zone_name($char[4]);
|
|---|
| 57 | if($zone == ' ') $zone = ' ';
|
|---|
| 58 | $race = get_player_race($char[2]);
|
|---|
| 59 | if(($char[2] == 1) or ($char[2] == 3) or ($char[2] == 4) or ($char[2] == 7) or ($char[2] == 11)) $color = '#9090ff';
|
|---|
| 60 | else $color = '#FF5050';
|
|---|
| 61 | $output .= "<tr>
|
|---|
| 62 | <td style=\"color: ".$color.";\">$char[1]</td>
|
|---|
| 63 | <td><img src='images/online_player/{$char[2]}-0.gif' onmousemove='toolTip(\"".$race."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
|
|---|
| 64 | <td><img src='images/online_player/{$char[3]}.gif' onmousemove='toolTip(\"".get_player_class($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
|
|---|
| 65 | <td>$char[7]</td>
|
|---|
| 66 | <td>".get_map_name($char[5])."</td>
|
|---|
| 67 | <td>".$zone."</td>
|
|---|
| 68 | <td>$char[6]</td>
|
|---|
| 69 | </tr>";
|
|---|
| 70 | }
|
|---|
| 71 | $output .= "</table></div>";
|
|---|
| 72 | echo($output);
|
|---|
| 73 |
|
|---|
| 74 | ShowFooter();
|
|---|
| 75 | ?>
|
|---|