Changeset 570


Ignore:
Timestamp:
Apr 20, 2009, 9:51:07 PM (16 years ago)
Author:
barny
Message:

Upraven minimanager aby se spustil vymazal jsem uptime script :)

Location:
trunk/mmadmin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mmadmin/index.php

    r374 r570  
    2020$output .= "<div class=\"top\">";
    2121
    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 = array
    28         (
    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     else
    43     {
    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         else
    47             $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 else
    53 {
    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 }
    5722
    5823//  This retrieves the actual database version from the database itself,  instead of hardcoding it into a string
  • trunk/mmadmin/stat.php

    r567 r570  
    7272 $total_chars = $sql->result($query,0);
    7373
    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']);
    7575 $query = $sql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime");
    7676 $uptime = $sql->fetch_row($query);
  • trunk/mmadmin/user.php

    r374 r570  
    7171                <option value=\"banned\">{$lang_user['by_banned']}</option>
    7272                <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>
    7474           </select></form></td>
    7575           <td>";
     
    152152 $search_value = $sql->quote_smart($_GET['search_value']);
    153153 $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');
    155155 if (!array_key_exists($search_by, $search_menu)) $search_by = 'username';
    156156
     
    211211                <option value=\"banned\">{$lang_user['by_banned']}</option>
    212212                <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>
    214214           </select></form></td><td>";
    215215           makebutton($lang_global['search'], "javascript:do_submit()",80);
     
    541541     </tr>
    542542         <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>
    545545     </tr>
    546546     <tr><td>";
     
    595595
    596596        $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)");
    601601        $sql->close();
    602602
     
    620620 $id = $sql->quote_smart($_GET['id']);
    621621
    622  $result = $sql->query("SELECT id,username,gmlevel,email,joindate,last_ip,failed_logins,locked,last_login,online,tbc FROM 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'");
    623623 $data = $sql->fetch_row($result);
    624624
     
    730730           <td>{$lang_user['client_type']}</td>";
    731731      if($user_lvl >= $action_permission['update']) { $output .="
    732                 <td><select name=\"tbc\">";
     732                <td><select name=\"expansion\">";
    733733      $output .= "<option value=\"0\">{$lang_user['classic']}</option>
    734734                         <option value=\"1\" ";
     
    831831 $failed = (isset($_POST['failed'])) ? $sql->quote_smart($_POST['failed']) : 0;
    832832 $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;
    834834 $banned = (isset($_POST['banned'])) ? $sql->quote_smart($_POST['banned']) : 0;
    835835 $locked = (isset($_POST['locked'])) ? $sql->quote_smart($_POST['locked']) : 0;
     
    868868                 }
    869869
    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");
    871871
    872872 $sql->close();
Note: See TracChangeset for help on using the changeset viewer.