Changeset 633
- Timestamp:
- Sep 12, 2009, 10:50:39 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/realm.php
r630 r633 10 10 $this->Id = $Id; 11 11 $this->Database = new Database($this->Config['Mangos']['RealmList'][$Id]['DatabaseHost'], $this->Config['Mangos']['RealmList'][$Id]['DatabaseUser'], $this->Config['Mangos']['RealmList'][$Id]['DatabasePassword'], $this->Config['Mangos']['RealmList'][$Id]['DatabaseCharacters']); 12 if( mysqli_connect_error())12 if($this->Database->connect_error) 13 13 { 14 die('Přihlášení k databázi realmu '.$this->Id.' selhalo'); //: '.mysqli_connect_error());14 //die('Přihlášení k databázi realmu '.$this->Id.' selhalo: '.$this->Database->connect_error); 15 15 } 16 16 $this->Database->charset($this->Config['Database']['Charset']); … … 19 19 function OnlineCharactersCount() 20 20 { 21 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 22 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `characters` WHERE `online` = 1'); 23 $DbRow = $DbResult->fetch_row(); 24 return($DbRow[0]); 21 if($this->Database->connect_error) return(0); 22 else { 23 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 24 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `characters` WHERE `online` = 1'); 25 $DbRow = $DbResult->fetch_row(); 26 return($DbRow[0]); 27 } 25 28 } 26 29 … … 42 45 public function CharacterCount() 43 46 { 44 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 45 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `characters`'); 46 $DbRow = $DbResult->fetch_row(); 47 return($DbRow[0]); 47 if($this->Database->connect_error) return(''); 48 else { 49 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 50 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `characters`'); 51 $DbRow = $DbResult->fetch_row(); 52 return($DbRow[0]); 53 } 48 54 } 49 55 50 56 public function GuidToCharName($guid) 51 57 { 52 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 53 $row = $this->Database->query('SELECT `name` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_array(); 54 return($row['name']); 58 if($this->Database->connect_error) return(0); 59 else { 60 $this->Database->select_db($this->Config['Mangos']['RealmList'][$this->Id]['DatabaseCharacters']); 61 $row = $this->Database->query('SELECT `name` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_array(); 62 return($row['name']); 63 } 55 64 } 56 65 -
trunk/index.php
r630 r633 126 126 '<script type="text/javascript"> 127 127 <!-- 128 document.write("<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?wowzdechov& amp;t4&" + escape(top.document.referrer) + "\" alt=\"CNW:Tracker\" border=\"0\" width=\"0\" height=\"0\"></a>");128 document.write("<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?wowzdechov&t4&" + escape(top.document.referrer) + "\" alt=\"CNW:Tracker\" border=\"0\" width=\"1\" height=\"1\"><\/a>"); 129 129 // --> 130 130 </script>'. -
trunk/pages/realmlist.wtf
r502 r633 1 set realmlist wow.zdechov.net1 set realmlist heroesoffantasy.cz -
trunk/pages/server.php
r630 r633 68 68 $Output .= '<table class="BaseTable" style="width: 100%; margin: 5px;"> 69 69 <tr> 70 <th colspan="2">Server '. ($Index + 1).'</td>70 <th colspan="2">Server '.$Index.'</td> 71 71 </tr> 72 72 <tr>
Note:
See TracChangeset
for help on using the changeset viewer.