Changeset 699 for trunk/inc


Ignore:
Timestamp:
Mar 22, 2010, 7:42:20 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazení postav na účtu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/player.php

    r693 r699  
    9898   }
    9999
    100   public function GetPlayerLvl($guid)
     100  public function GetPlayerLvl($guid, $RealmId)
    101101  {
    102102    global $Config, $System;
    103103
    104     $Realm = new Realm($System, $_COOKIE['RealmIndex']);
     104    $Realm = new Realm($System, $RealmId);
    105105    $DbResult = $Realm->CharactersDatabase->query('SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.($Config['Mangos']['CharacterDataOffset']['Level'] + 1).'), " ", -1) AS UNSIGNED) AS `level` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1;');
    106106    $row = $DbResult->fetch_assoc();
     
    329329    global $Config, $System, $html;
    330330   
    331     echo('<table class="BaseTable">
     331    $DbResult = $System->Database->query('SELECT Name,Id FROM Realm WHERE Enabled=1');
     332    while($DbRealm = $DbResult->fetch_array())
     333    {
     334      echo('<div>'.$DbRealm['Name'].'</div>');
     335      echo('<table class="BaseTable">
    332336          <tr>
    333337            <th>Jméno</th>
     
    337341            <th>Nahráno</th>
    338342          </tr>');
    339     $Realm = new Realm($System, $_COOKIE['RealmIndex']);   
    340     $sql = $Realm->CharactersDatabase->query('SELECT `guid`,`name`,`race`,`totaltime`,`class`, mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.($Config['Mangos']['CharacterDataOffset']['Gender'] + 1).'), " ",-1) AS unsigned) ), 8, 0), 4, 1) AS gender FROM `characters` WHERE `account`='.$accid.' ORDER BY `totaltime` DESC LIMIT 0, 10');
    341     while($row = $sql->fetch_array())
    342     {
    343       $gender = ($row['gender'] == 0) ? '0' : '1';
    344       echo('<tr>'.
     343      $Realm = new Realm($System, $DbRealm['Id']);   
     344      $sql = $Realm->CharactersDatabase->query('SELECT `guid`,`name`,`race`,`totaltime`,`class`, mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.($Config['Mangos']['CharacterDataOffset']['Gender'] + 1).'), " ",-1) AS unsigned) ), 8, 0), 4, 1) AS gender FROM `characters` WHERE `account`='.$accid.' ORDER BY `totaltime` DESC LIMIT 0, 10');
     345      while($row = $sql->fetch_array())
     346      {
     347        $gender = ($row['gender'] == 0) ? '0' : '1';
     348        echo('<tr>'.
    345349        '<td>'.$row['name'].'</td>'.
    346         '<td>'.$this->GetPlayerLvl($row['guid']).'</td>'.
    347         '<td><img src="'.$html->Link('imgs/icons/'.$row['race'].'-'.$gender.'.gif').'" alt="rasa" /></td>'.
     350        '<td>'.$this->GetPlayerLvl($row['guid'], $DbRealm['Id']).'</td>'.
     351        '<td><img src="'.$html->Link('/imgs/icons/'.$row['race'].'-'.$gender.'.gif').'" alt="rasa" /></td>'.
    348352        '<td><img src="'.$html->Link('/imgs/icons/'.$row['class'].'.gif').'" alt="trida" /></td>'.
    349353        '<td>'.round($row['totaltime'] / 3600).' h</td>'.
    350354        '</tr>');
    351     }
    352     echo('</table>');
     355      }
     356      echo('</table>');
     357    }
    353358  }
    354359}
Note: See TracChangeset for help on using the changeset viewer.