Changeset 404 for global.php


Ignore:
Timestamp:
Jan 28, 2009, 11:23:01 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Názvy databází MaNGOSu přesunuty do konfiguračního souboru a odkazované skripty upraveny k použití těchto proměnných.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.php

    r403 r404  
    4141function OnlinePlayerCount()
    4242{
    43   global $Database;
    44   $Database->select_db('characters');
     43  global $Database, $Config;
     44 
     45  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    4546  $Result = $Database->select('characters', 'COUNT(*)', 'online=1');
    4647  $Row = $Result->fetch_array();
     
    5051function CharacterCount()
    5152{
    52   global $Database;
    53   $Database->select_db('characters');
     53  global $Database, $Config;
     54  $Database->select_db($Config['Mangos']['DatabaseCharacters']);
    5455  $Result = $Database->select('characters', 'COUNT(*)');
    5556  $Row = $Result->fetch_array();
     
    5960function AccountCount()
    6061{
    61   global $Database;
    62   $Database->select_db('realmd');
     62  global $Database, $Config;
     63  $Database->select_db($Config['Mangos']['DatabaseRealmd']);
    6364  $DbResult = $Database->query('SELECT COUNT(*) FROM account');
    6465  $Row = $DbResult->fetch_array();
     
    6869function MangosUptime()
    6970{
    70   global $Database;
    71   $Database->select_db('mangos');
     71  global $Database, $Config;
     72  $Database->select_db($Config['Mangos']['DatabaseMangos']);
    7273  $DbResult = $Database->query('SELECT `starttime`, `uptime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1');
    7374  $Row = $DbResult->fetch_array();
     
    8586function RunningEventCount()
    8687{
    87   global $Database;
     88  global $Database, $Config;
    8889  $Count = 0;
    89   $Database->select_db('mangos');
     90  $Database->select_db($Config['Mangos']['DatabaseMangos']);
    9091  $DbResult = $Database->select('game_event', 'occurence, length, UNIX_TIMESTAMP(start_time) as start', 'end_time > NOW() AND start_time < NOW()');
    9192  while($Row = $DbResult->fetch_array())
Note: See TracChangeset for help on using the changeset viewer.