Changeset 578 for trunk/inc


Ignore:
Timestamp:
Apr 30, 2009, 7:10:05 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Některé chyby a varování.
Location:
trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/html.php

    r576 r578  
    221221   
    222222    $pocet = mysql_num_rows(mysql_query("SELECT id FROM `articles`".$where."ORDER BY `date` DESC;"));
    223     $offset = ($_GET["offset"] ? $_GET["offset"] : $pocet);
     223    $offset = (isset($_GET["offset"]) ? $_GET["offset"] : $pocet);
    224224
    225225    if($pocet != 0)
  • trunk/inc/player.php

    r577 r578  
    115115  public function GetGmLvl()
    116116  {
    117     // $this -> NumCheck($guid);
    118     $this->db->select_db($db_realmd);
    119     $row = $this->db->query('SELECT `gmlevel` FROM `account` WHERE `id` = "'.$_SESSION['UserId'].'" LIMIT 1;')->fetch_array();
     117    global $Config;
     118   
     119    $this->db->select_db($Config['Mangos']['DatabaseRealmd']);
     120    $row = $this->db->query('SELECT `gmlevel` FROM `account` WHERE `id` = "'.$_SESSION['UserId'].'" LIMIT 1;')->fetch_assoc();
    120121    return($row['gmlevel']);
    121122  }
     
    124125  {
    125126    $Class = array(1 => 'warrior', 2 => 'paladin', 3 => 'hunter', 4 => 'rogue', 5 => 'priest', 6 => 'death knight', 7 => 'shaman', 8 => 'mage', 9 => 'warlock', 11 => 'druid');
    126     $Result = $Class[$Id];
    127     if($Result == '') $Result = 'unknown';
     127    if(array_key_exists($Id, $Class)) $Result = $Class[$Id];
     128    else $Result = 'unknown';
    128129    return($Result);
    129130  }
     
    132133  {
    133134    $Race = array(1 => 'human', 2 => 'orc', 4 => 'dwarf', 4 => 'nightelf', 5 => 'undead', 6 => 'tauren', 7 => 'gnome', 8 => 'troll', 9 => 'goblin', 10 => 'bloodelf', 11 => 'draenei');
    134     $Result = $Race[$Id];
    135     if($Result == '') $Result = 'unknown';
     135    if(array_key_exists($Id, $Race)) $Result = $Race[$Id];
     136    else $Result = 'unknown';
    136137    return($Result);
    137138  }
Note: See TracChangeset for help on using the changeset viewer.