Ignore:
Timestamp:
Aug 9, 2009, 8:28:30 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Funkce pro aktualizaci počtu postav v seznamu světů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/model/server.php

    r67 r68  
    330330    return($DbRow[0]);
    331331  } 
     332 
     333  function UpdateRealmlistAccountCount()
     334  {
     335    global $Config;
     336   
     337    $this->Database->query('TRUNCATE TABLE server'.$this->Id.'_realmd.realmcharacters');
     338    $DbResult = $this->Database->select('Realm', '*', 'Server = '.$this->Id);
     339    while($Realm = $DbResult->fetch_assoc())
     340    {
     341      $this->Database->query('INSERT INTO server'.$this->Id.'_realmd.realmcharacters (SELECT '.$Realm['Id'].' AS realmid, server'.$this->Id.'_realmd.account.id AS acctid, (SELECT COUNT(*) FROM realm'.$Realm['Id'].'_characters.characters WHERE realm'.$Realm['Id'].'_characters.characters.account = server'.$this->Id.'_realmd.account.id) AS numchars FROM server'.$this->Id.'_realmd.account)');
     342    }
     343  }
    332344}
    333345
Note: See TracChangeset for help on using the changeset viewer.