Changeset 307 for minimanager/index.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/index.php
r304 r307 22 22 if (test_port($server[$realm_id]['addr'],$server[$realm_id]['game_port'])) { 23 23 24 $query = $sql->query("SELECT uptime FROM uptime ORDER BY starttime DESC LIMIT 1"); 25 $uptime = $sql->result($query, 0); 26 $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} : (".(int)($uptime/60/60/24)."D : ".(($uptime/60/60 >= 24 )?(int)($uptime/60/60-24*(int)($uptime/60/60/24)):(int)($uptime/60/60))."H : ".(($uptime/60 >= 60 )?(int)($uptime/60-60*(int)($uptime/60/60)):(int)($uptime/60))."M : ".(($uptime >= 60 )?(int)($uptime-60*(int)($uptime/60)):(int)$uptime)."S)</font></h1>"; 24 25 /* $query = $sql->query("SELECT uptime FROM uptime ORDER BY starttime DESC LIMIT 1"); 26 * $uptime = $sql->result($query, 0); 27 * $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} : (".(int)($uptime/60/60/24)."D : ".(($uptime/60/60 >= 24 )?(int)($uptime/60/60-24*(int)($uptime/60/60/24)):(int)($uptime/60/60))."H : ".(($uptime/60 >= 60 )?(int)($uptime/60-60*(int)($uptime/60/60)):(int)($uptime/60))."M : ".(($uptime >= 60 )?(int)($uptime-60*(int)($uptime/60)):(int)$uptime)."S)</font></h1>"; 28 */ 29 $query = $sql->query("SELECT `starttime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1"); 30 $getuptime = mysql_fetch_row($query); 31 $uptimetime = time() - $getuptime[0]; 32 $uptime = array( 33 'd' => $uptimetime / 86400 % 7, 34 'h' => $uptimetime / 3600 % 24, 35 'm' => $uptimetime / 60 % 60, 36 's' => $uptimetime / 1 % 60, 37 ); 38 if ($uptime[d] < 2) { 39 $sd = ""; } 40 else { 41 $sd = "s"; } 42 43 if ($uptime[h] < 2) { 44 $sh = ""; } 45 else { 46 $sh = "s"; } 47 48 if ($uptime[m] < 2) { 49 $sm = ""; } 50 else { 51 $sm = "s"; } 52 53 if ($uptime[s] < 2) { 54 $ss = ""; } 55 else { 56 $ss = "s"; } 57 58 if ($uptime[d] > 0) { 59 $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " . $uptime[d] . " day$sd " . $uptime[h] . " hour$sh " . $uptime[m] . " minute$sm and " . $uptime[s] . " second$ss.</font></h1>"; 60 } else { 61 if ($uptime[h] > 0) { 62 $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " . $uptime[h] . " hour$sh " . $uptime[m] . " minute$sm and " . $uptime[s] . " second$ss.</font></h1>"; 63 } else { 64 $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " . $uptime[m] . " minute$sm and " . $uptime[s] . " second$ss.</font></h1>"; 65 } 66 } 67 27 68 $online = true; 28 69 } else { … … 30 71 $online = false; 31 72 } 32 $output .= "Mangos: {$server[$realm_id]['rev']} Using DB: {$mangos_db[$realm_id]['db_rev']}</div>"; 73 /*$output .= "Mangos: {$server[$realm_id]['rev']} Using DB: {$mangos_db[$realm_id]['db_rev']}</div>";*/ 74 // This retrieves the actual database version from the database itself, instead of hardcoding it into a string 75 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 76 $query_db_version = $sql->query("SELECT version FROM db_version"); 77 $db_rev = $sql->result($query_db_version, 0); 78 $output .= "Mangos: {$server[$realm_id]['rev']} Using DB: $db_rev</div>"; 33 79 34 80 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); … … 75 121 $dir = ($dir) ? 0 : 1; 76 122 77 $result = $sql->query("SELECT count(*) FROM `character ` WHERE `online`= 1");123 $result = $sql->query("SELECT count(*) FROM `characters` WHERE `online`= 1"); 78 124 $total_online = $sql->result($result, 0); 79 125 80 126 if( !$user_lvl && !$server[$realm_id]['both_factions']){ 81 $result = $sql->query("SELECT race FROM `character ` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `character` WHERE account = '$user_id') LIMIT 1");127 $result = $sql->query("SELECT race FROM `characters` WHERE account = '$user_id' AND totaltime = (SELECT MAX(totaltime) FROM `characters` WHERE account = '$user_id') LIMIT 1"); 82 128 if ($sql->num_rows($result)){ 83 129 $order_side = (in_array($sql->result($result, 0, 'race'),array(2,5,6,8,10))) ? … … 93 139 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_GUILD_ID+1)."), ' ', -1) AS UNSIGNED) as GNAME, 94 140 mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".(36+1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender 95 FROM `character ` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir");141 FROM `characters` WHERE `online`= 1 $order_side ORDER BY $order_by $order_dir"); 96 142 97 143 $output .= "
Note:
See TracChangeset
for help on using the changeset viewer.