Changeset 142 for minimanager/index.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/index.php
r22 r142 8 8 * License: GNU General Public License v2(GPL) 9 9 */ 10 10 11 11 require_once("header.php"); 12 12 valid_login(0); 13 13 require_once("scripts/id_tab.php"); 14 14 require_once("scripts/get_lib.php"); 15 15 require_once("scripts/bbcode_lib.php"); … … 20 20 $output .= "<div class=\"top\">"; 21 21 if (test_port($server[$realm_id]['addr'],$server[$realm_id]['game_port'])) { 22 22 23 23 $query = $sql->query("SELECT uptime/60 FROM uptime ORDER BY starttime DESC LIMIT 1"); 24 24 $uptime = $sql->result($query, 0); 25 25 $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} : (".(int)($uptime/60).":".(($uptime >= 60 )?(int)($uptime-60*(int)($uptime/60)):(int)$uptime)."h)</font></h1>"; 26 26 $online = true; 27 } else { 27 } else { 28 28 $output .= "<h1><font class=\"error\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['offline_or_let_height']}</font></h1>"; 29 29 $online = false; … … 31 31 $output .= "Mangos: {$server[$realm_id]['rev']} Using DB: {$mangos_db[$realm_id]['db_rev']}</div>"; 32 32 33 $sql->db($mangos_db[$realm_id]['name']); 33 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 34 $sql->db($characters_db[$realm_id]['name']); 35 34 36 //MOTD part 35 37 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0; … … 45 47 $output .= "<center> 46 48 <table class=\"lined\"> 47 <tr> 49 <tr> 48 50 <th align=\"right\">"; 49 51 if ($user_lvl) $output .= "<a href=\"motd.php?action=add_motd\">{$lang_index['add_motd']}</a>"; … … 70 72 $order_dir = ($dir) ? "ASC" : "DESC"; 71 73 $dir = ($dir) ? 0 : 1; 72 74 73 75 $result = $sql->query("SELECT count(*) FROM `character` WHERE `online`= 1"); 74 76 $total_online = $sql->result($result, 0); … … 83 85 84 86 require_once("scripts/defines.php"); 85 87 86 88 $result = $sql->query("SELECT guid,name,race,class,zone,map, 87 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_KILL+1)."), ' ', -1) AS UNSIGNED) AS highest_rank, 88 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account 89 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_POINTS+1)."), ' ', -1) AS UNSIGNED) AS highest_rank, 90 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1)."), ' ', -1) AS UNSIGNED) AS level,account, 91 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(229+1)."), ' ', -1) AS UNSIGNED) as GNAME 89 92 FROM `character` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir"); 90 93 … … 92 95 <font class=\"bold\">{$lang_index['tot_users_online']} : $total_online</font><br /><br /> 93 96 <table class=\"lined\"> 94 <tr> 95 <th width=\"26%\"><a href=\"index.php?order_by=name&dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['name']}</a></th> 96 <th width=\"7%\"><a href=\"index.php?order_by=race&dir=$dir\">".($order_by=='race' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['race']}</a></th> 97 <th width=\"7%\"><a href=\"index.php?order_by=class&dir=$dir\">".($order_by=='class' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['class']}</a></th> 98 <th width=\"7%\"><a href=\"index.php?order_by=level&dir=$dir\">".($order_by=='level' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['level']}</a></th> 99 <th width=\"20%\"><a href=\"index.php?order_by=map&dir=$dir\">".($order_by=='map' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['map']}</a></th> 100 <th width=\"25%\">{$lang_index['zone']}</td> 101 <th width=\"10%\"><a href=\"index.php?order_by=highest_rank&dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['honor_kills']}</a></th> 97 <tr> 98 <th width=\"20%\"><a href=\"index.php?order_by=name&dir=$dir\"".($order_by=='name' ? " class=\"$order_dir\"" : "").">{$lang_index['name']}</a></th> 99 <th width=\"5%\"><a href=\"index.php?order_by=race&dir=$dir\"".($order_by=='race' ? " class=\"$order_dir\"" : "").">{$lang_index['race']}</a></th> 100 <th width=\"5%\"><a href=\"index.php?order_by=class&dir=$dir\"".($order_by=='class' ? " class=\"$order_dir\"" : "").">{$lang_index['class']}</a></th> 101 <th width=\"5%\"><a href=\"index.php?order_by=level&dir=$dir\"".($order_by=='level' ? " class=\"$order_dir\"" : "").">{$lang_index['level']}</a></th> 102 <th width=\"5%\"><a href=\"index.php?order_by=highest_rank&dir=$dir\"".($order_by=='highest_rank' ? " class=\"$order_dir\"" : "").">Rank</a></th> 103 <th width=\"15%\"><a href=\"index.php?order_by=GNAME&dir=$dir\"".($order_by=='GNAME' ? " class=\"$order_dir\"" : "").">Guild</a></th> 104 <th width=\"20%\"><a href=\"index.php?order_by=map&dir=$dir\"".($order_by=='map' ? " class=\"$order_dir\"" : "").">{$lang_index['map']}</a></th> 105 <th width=\"25%\">{$lang_index['zone']}</th> 102 106 </tr>"; 103 107 … … 105 109 106 110 while($char = $sql->fetch_row($result)){ 111 112 $guild_name = $sql->fetch_row($sql->query("SELECT `name` FROM `guild` WHERE `guildid`=".$char[9].";")); 113 114 $accid = $char[8]; 115 116 $sql->db("realmd"); 117 $gmlvl = $sql->query("SELECT `gmlevel` FROM `account`WHERE `id`='$accid';"); 118 $gml = $sql->fetch_row($gmlvl); 119 $gm = $gml[0]; 120 121 $sql->db($characters_db[$realm_id]['name']); 122 123 $level = $char[7]; 124 125 if($level > 0) 126 { 127 $lev = '<font color="#FFFFFF">'.$level.'</font>'; 128 } 129 if($level > 9) 130 { 131 $lev = '<font color="#858585">'.$level.'</font>'; 132 } 133 if($level > 19) 134 { 135 $lev = '<font color="#339900">'.$level.'</font>'; 136 } 137 if($level > 29) 138 { 139 $lev = '<font color="#3300CC">'.$level.'</font>'; 140 } 141 if($level > 39) 142 { 143 $lev = '<font color="#5552FF">'.$level.'</font>'; 144 } 145 if($level > 49) 146 { 147 $lev = '<font color="#FF8000">'.$level.'</font>'; 148 } 149 if($level > 59) 150 { 151 $lev = '<font color="#FF0000">'.$level.'</font>'; 152 } 153 if($level > 69) 154 { 155 $lev = '<font color="#FF00CC">'.$level.'</font>'; 156 } 157 if($level > 70) 158 { 159 $lev = '<font color="#FFF000">'.$level.'</font>'; 160 } 161 107 162 $output .= "<tr> 108 <td><a href=\"char.php?id=$char[0]\"> $char[1]</a></td>109 <td><img src='img/c_icons/{$char[2]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[2])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>163 <td><a href=\"char.php?id=$char[0]\"><span onmousemove='toolTip(\"".get_player_user_level($gm)."\",\"item_tooltip\")' onmouseout='toolTip()'>$char[1]</span></a></td> 164 <td><img src='img/c_icons/{$char[2]}-0.gif' onmousemove='toolTip(\"".get_player_race($char[2])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 110 165 <td><img src='img/c_icons/{$char[3]}.gif' onmousemove='toolTip(\"".get_player_class($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 111 <td>$char[7]</td> 112 <td>".get_map_name($char[5])."</td> 166 <td>$lev</td> 167 <td><span onmouseover='toolTip(\"".$CHAR_RANK[$CHAR_RACE[$char[2]][1]][pvp_ranks($char[6])]."\",\"item_tooltip\")' onmouseout='toolTip()' style='color: white;'><img src='img/ranks/rank".pvp_ranks($char[6],$CHAR_RACE[$char[2]][1]).".gif'></span></td> 168 <td><a href=\"guild.php?id=$char[9]\">$guild_name[0]</a></td> 169 <td>".get_map_name($char[5])."</td> 113 170 <td>".get_zone_name($char[4])."</td> 114 <td>$char[6]</td>115 171 </tr>"; 116 172 } 117 173 $output .= "</table><br /></center>"; 118 174 } 175 119 176 $sql->close(); 120 177
Note:
See TracChangeset
for help on using the changeset viewer.