Changeset 20 for online_player.php
- Timestamp:
- Aug 13, 2007, 9:07:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
online_player.php
r16 r20 3 3 include('global.php'); 4 4 ShowHeader(); 5 ?> 5 6 echo('<h3>Online hráèi:</h3><div align="center">'); 7 $Database->select_db('mangos'); 6 8 7 <IFRAME name="registrace_frame" src="http://wow.zdechov.net/mangos/inc/stat2.php"></IFRAME> 9 $order_by = (isset($_GET['order_by'])) ? $Database->real_escape_string($_GET['order_by']) : "name"; 8 10 9 <? 11 $dir = (isset($_GET['dir'])) ? $Database->real_escape_string($_GET['dir']) : 1; 12 $order_dir = ($dir) ? "ASC" : "DESC"; 13 $dir = ($dir) ? 0 : 1; 14 15 $result = $Database->query("SELECT count(*) FROM `character` WHERE `online`= 1"); 16 $Row = $result->fetch_array(); 17 $total_online = $Row[0]; 18 19 $order_side = ""; 20 21 require_once("minimanager/scripts/defines.php"); 22 $result = $Database->query("SELECT guid,name,race,class,zone,map, 23 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_POINTS+1)."), ' ', -1) AS UNSIGNED) AS highest_rank, 24 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account 25 FROM `character` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir"); 26 27 require_once("minimanager/lang/enUS.php"); 28 $lang_index = array( 29 // ----- INDEX.PHP ----- 30 'realm' => 'Realm', 31 'online' => 'Online', 32 'offline_or_let_height' => 'Offline or Latency too Height', 33 'delete' => 'Delete', 34 'tot_users_online' => 'Celkem hráèù online', 35 'name' => 'Jméno', 36 'race' => 'Rasa', 37 'class' => 'Tøída', 38 'level' => 'Úroveò', 39 'map' => 'Mapa', 40 'zone' => 'Zóna', 41 'honor_kills' => 'Body cti', 42 ); 43 44 $output = "<font class=\"bold\">{$lang_index['tot_users_online']}: $total_online</font><br /> 45 <table class=\"TableGuilda\" border=\"1\" cellspacing=\"0\"> 46 <tr> 47 <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> 48 <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> 49 <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> 50 <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> 51 <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> 52 <th width=\"25%\">{$lang_index['zone']}</th> 53 <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> 54 </tr>"; 55 56 require_once("minimanager/scripts/id_tab.php"); 57 58 while($char = $result->fetch_row()) 59 { 60 $zone = get_zone_name($char[4]); 61 if($zone == ' ') $zone = ' '; 62 $race = get_player_race($char[2]); 63 if(($char[2] == 1) or ($char[2] == 3) or ($char[2] == 4) or ($char[2] == 7) or ($char[2] == 11)) $color = '#9090ff'; 64 else $color = '#FF5050'; 65 $output .= "<tr> 66 <td style=\"color: ".$color.";\">$char[1]</td> 67 <td><img src='images/online_player/{$char[2]}-0.gif' onmousemove='toolTip(\"".$race."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 68 <td><img src='images/online_player/{$char[3]}.gif' onmousemove='toolTip(\"".get_player_class($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 69 <td>$char[7]</td> 70 <td>".get_map_name($char[5])."</td> 71 <td>".$zone."</td> 72 <td>$char[6]</td> 73 </tr>"; 74 } 75 $output .= "</table></div>"; 76 echo($output); 77 10 78 ShowFooter(); 11 79 ?>
Note:
See TracChangeset
for help on using the changeset viewer.