Changeset 570
- Timestamp:
- Apr 20, 2009, 9:51:07 PM (16 years ago)
- Location:
- trunk/mmadmin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mmadmin/index.php
r374 r570 20 20 $output .= "<div class=\"top\">"; 21 21 22 if (test_port($server[$realm_id]['addr'],$server[$realm_id]['game_port']))23 {24 $query = $sql->query("SELECT `starttime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1");25 $getuptime = mysql_fetch_row($query);26 $uptimetime = time() - $getuptime[0];27 $uptime = array28 (29 'd' => $uptimetime / 86400 % 7,30 'h' => $uptimetime / 3600 % 24,31 'm' => $uptimetime / 60 % 60,32 's' => $uptimetime / 1 % 60,33 );34 35 if ($uptime['d'] < 2) $sd = ""; else $sd = "s";36 if ($uptime['h'] < 2) $sh = ""; else $sh = "s";37 if ($uptime['m'] < 2) $sm = ""; else $sm = "s";38 if ($uptime['s'] < 2) $ss = ""; else $ss = "s";39 40 if ($uptime['d'] > 0)41 $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>";42 else43 {44 if ($uptime['h'] > 0)45 $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>";46 else47 $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>";48 }49 50 $online = true;51 }52 else53 {54 $output .= "<h1><font class=\"error\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['offline_or_let_high']}</font></h1>";55 $online = false;56 }57 22 58 23 // This retrieves the actual database version from the database itself, instead of hardcoding it into a string -
trunk/mmadmin/stat.php
r567 r570 72 72 $total_chars = $sql->result($query,0); 73 73 74 $sql->connect($realm_db[ $realm_id]['addr'], $realm_db[$realm_id]['user'], $realm_db[$realm_id]['pass'], $realm_db[$realm_id]['name']);74 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 75 75 $query = $sql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime"); 76 76 $uptime = $sql->fetch_row($query); -
trunk/mmadmin/user.php
r374 r570 71 71 <option value=\"banned\">{$lang_user['by_banned']}</option> 72 72 <option value=\"locked\">{$lang_user['by_locked']}</option> 73 <option value=\" tbc\">{$lang_user['by_tbc']}</option>73 <option value=\"expansion\">{$lang_user['by_expansion']}</option> 74 74 </select></form></td> 75 75 <td>"; … … 152 152 $search_value = $sql->quote_smart($_GET['search_value']); 153 153 $search_by = $sql->quote_smart($_GET['search_by']); 154 $search_menu = array('username', 'id', 'gmlevel', 'greater_gmlevel', 'email', 'joindate', 'last_ip', 'failed_logins', 'last_login', 'online', 'banned', 'locked', ' tbc');154 $search_menu = array('username', 'id', 'gmlevel', 'greater_gmlevel', 'email', 'joindate', 'last_ip', 'failed_logins', 'last_login', 'online', 'banned', 'locked', 'expansion'); 155 155 if (!array_key_exists($search_by, $search_menu)) $search_by = 'username'; 156 156 … … 211 211 <option value=\"banned\">{$lang_user['by_banned']}</option> 212 212 <option value=\"locked\">{$lang_user['by_locked']}</option> 213 <option value=\" tbc\">{$lang_user['by_tbc']}</option>213 <option value=\"expansion\">{$lang_user['by_expansion']}</option> 214 214 </select></form></td><td>"; 215 215 makebutton($lang_global['search'], "javascript:do_submit()",80); … … 541 541 </tr> 542 542 <tr> 543 <td>{$lang_user[' tbc_account']}</td>544 <td><input type=\"checkbox\" name=\"new_ tbc\" value=\"1\" checked=\"checked\" /></td>543 <td>{$lang_user['expansion_account']}</td> 544 <td><input type=\"checkbox\" name=\"new_expansion\" value=\"1\" checked=\"checked\" /></td> 545 545 </tr> 546 546 <tr><td>"; … … 595 595 596 596 $locked = (isset($_GET['new_locked'])) ? $sql->quote_smart($_GET['new_locked']) : 0; 597 $ tbc = (isset($_GET['new_tbc'])) ? $sql->quote_smart($_GET['new_tbc']) : 0;598 599 $result = $sql->query("INSERT INTO account (username,sha_pass_hash,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online, tbc)600 VALUES ('$new_user','$pass',0 ,'$new_mail',now() ,'$last_ip',0, $locked ,NULL, 0, $ tbc)");597 $expansion = (isset($_GET['new_expansion'])) ? $sql->quote_smart($_GET['new_expansion']) : 0; 598 599 $result = $sql->query("INSERT INTO account (username,sha_pass_hash,gmlevel,email, joindate,last_ip,failed_logins,locked,last_login,online,expansion) 600 VALUES ('$new_user','$pass',0 ,'$new_mail',now() ,'$last_ip',0, $locked ,NULL, 0, $expansion)"); 601 601 $sql->close(); 602 602 … … 620 620 $id = $sql->quote_smart($_GET['id']); 621 621 622 $result = $sql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online, tbcFROM account WHERE id = '$id'");622 $result = $sql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online,expansion FROM account WHERE id = '$id'"); 623 623 $data = $sql->fetch_row($result); 624 624 … … 730 730 <td>{$lang_user['client_type']}</td>"; 731 731 if($user_lvl >= $action_permission['update']) { $output .=" 732 <td><select name=\" tbc\">";732 <td><select name=\"expansion\">"; 733 733 $output .= "<option value=\"0\">{$lang_user['classic']}</option> 734 734 <option value=\"1\" "; … … 831 831 $failed = (isset($_POST['failed'])) ? $sql->quote_smart($_POST['failed']) : 0; 832 832 $gmlevel = (isset($_POST['gmlevel'])) ? $sql->quote_smart($_POST['gmlevel']) : 0; 833 $ tbc = (isset($_POST['tbc'])) ? $sql->quote_smart($_POST['tbc']) : 1;833 $expansion = (isset($_POST['expansion'])) ? $sql->quote_smart($_POST['expansion']) : 1; 834 834 $banned = (isset($_POST['banned'])) ? $sql->quote_smart($_POST['banned']) : 0; 835 835 $locked = (isset($_POST['locked'])) ? $sql->quote_smart($_POST['locked']) : 0; … … 868 868 } 869 869 870 $sql->query("UPDATE account SET email='$mail', $user_pass_change failed_logins='$failed',locked='$locked',gmlevel='$gmlevel', tbc='$tbc' WHERE id=$id");870 $sql->query("UPDATE account SET email='$mail', $user_pass_change failed_logins='$failed',locked='$locked',gmlevel='$gmlevel',expansion='$expansion' WHERE id=$id"); 871 871 872 872 $sql->close();
Note:
See TracChangeset
for help on using the changeset viewer.