- Timestamp:
- May 20, 2009, 8:26:17 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Readme.txt
r591 r596 24 24 download - soubory ke stažení 25 25 client - původní složka programu Heroes of Fantasy client 26 gallery - obrázková galerie Plogger27 26 pages - složka se stránkami webu 28 27 mangos_debug - záznam a zobrazování logů mangosu 29 28 29 Neverzované 30 gallery - obrázková galerie Plogger 30 31 32 33 4) Periodické spouštění 34 35 Každých 5 minut spouštět skript inc/registration_update.php -
trunk/inc/server.php
r583 r596 27 27 28 28 $this->db->select_db($Config['Mangos']['DatabaseRealmd']); 29 $pocet = $this->db->query('SELECT `id` FROM `account` WHERE `online` = 1')->num_rows; 30 return($pocet); 29 $DbResult = $this->db->query('SELECT COUNT(*) FROM `account` WHERE `online` = 1'); 30 $DbRow = $DbResult->fetch_row(); 31 return($DbRow[0]); 31 32 } 32 33 … … 48 49 global $Config; 49 50 50 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 51 $pocet = $this->db->query('SELECT `guid` FROM `characters` WHERE `online` = 1')->num_rows; 52 return($pocet); 51 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 52 $DbResult = $this->db->query('SELECT COUNT(*) FROM `characters` WHERE `online` = 1'); 53 $DbRow = $DbResult->fetch_row(); 54 return($DbRow[0]); 53 55 } 54 56 … … 87 89 88 90 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 89 $row = $this->db->query('SELECT COUNT(*) FROM characters')->fetch_ array();91 $row = $this->db->query('SELECT COUNT(*) FROM characters')->fetch_row(); 90 92 return($row[0]); 91 93 } … … 96 98 97 99 $this->db->select_db($Config['Mangos']['DatabaseRealmd']); 98 $row = $this->db->query('SELECT COUNT(*) FROM account')->fetch_ array();100 $row = $this->db->query('SELECT COUNT(*) FROM account')->fetch_row(); 99 101 return($row[0]); 100 102 } -
trunk/pages/register.php
r583 r596 1 1 <?php 2 3 include('inc/registration_limit.php'); 4 5 $RegistrationLimit = new RegistrationLimit($db, $server, $Config); 2 6 3 7 function sha_password($account, $password) … … 36 40 37 41 $db->select_db($Config['Mangos']['DatabaseRealmd']); 38 $DbResult = $db->query('SELECT COUNT(*) FROM `account`'); 39 if($DbResult->num_rows >= $Config['Mangos']['MaxAccountCount']) 42 if($RegistrationLimit->GetFreeRegistrationCount() == 0) 40 43 { 41 echo('<div class="h10">Registrace jsou uzavřeny</div>');42 echo('<div class="h1 1">Limit vyčerpán</div>');44 echo('<div class="h10">Registrace pro dnešní den vyčerpány</div>'); 45 echo('<div class="h10">Dnes bylo '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>'); 43 46 } else 44 47 { 45 echo('<div class="h11">Registrace otevřeny</div>'); 48 echo('<div class="h11">Pro tento den je povoleno '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>'); 49 echo('<div class="h11">Zbývá ještě '.$RegistrationLimit->GetFreeRegistrationCount().' volných registrací</div>'); 46 50 echo('<br />'); 47 51
Note:
See TracChangeset
for help on using the changeset viewer.