Changeset 633 for trunk


Ignore:
Timestamp:
Sep 12, 2009, 10:50:39 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazování seznamu světů při jejich nedostupnosti.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/realm.php

    r630 r633  
    1010    $this->Id = $Id;
    1111    $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)
    1313    {
    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);
    1515    }
    1616    $this->Database->charset($this->Config['Database']['Charset']);
     
    1919  function OnlineCharactersCount()
    2020  {
    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    }
    2528  }
    2629
     
    4245  public function CharacterCount()
    4346  {
    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    }
    4854  }
    4955 
    5056  public function GuidToCharName($guid)
    5157  {
    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    }
    5564  }
    5665 
  • trunk/index.php

    r630 r633  
    126126  '<script type="text/javascript">
    127127  <!--
    128   document.write("<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?wowzdechov&amp;t4&amp;" + 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>");
    129129  // -->
    130130  </script>'.
  • trunk/pages/realmlist.wtf

    r502 r633  
    1 set realmlist wow.zdechov.net
     1set realmlist heroesoffantasy.cz
  • trunk/pages/server.php

    r630 r633  
    6868  $Output .= '<table class="BaseTable" style="width: 100%; margin: 5px;">
    6969  <tr>
    70     <th colspan="2">Server '.($Index + 1).'</td>
     70    <th colspan="2">Server '.$Index.'</td>
    7171  </tr>
    7272  <tr>
Note: See TracChangeset for help on using the changeset viewer.