Ejemplo n.º 1
0
 function __construct($guid)
 {
     global $config, $SQL, $mysql, $_SYSTEM;
     $this->guid = -1;
     $r = $mysql->getRow("SELECT name,race,class,totaltime,data,online,?1 as gender,?3 as guildid,?4 as guildrank\n\t  FROM `characters` WHERE guid = ?2", CHAR_GENDER_OFFSET, $guid, SQL_template(CHAR_GUILD_OFFSET), SQL_template(CHAR_GUILD_OFFSET + 1), 'char');
     if (!$r) {
         $_SYSTEM->error('Character not found!');
     }
     if ($r['guildid']) {
         $r2 = $mysql->getRow("select * from `guild_rank` where guildid = ?1 and rid = ?2", $r['guildid'], $r['guildrank'], 'char');
     }
     // Ustawienie bazowych informacji
     if ($r2) {
         $this->guild_rank = $r2['rname'];
     } else {
         $r2['rname'] = 'Unknown';
     }
     $this->guid = $guid;
     $this->name = $r['name'];
     $this->class = $r['class'];
     $this->race = $r['race'];
     $this->online = $r['online'];
     $this->gender = $r['gender'];
     $this->guild_id = $r['guildid'];
     $this->guild = guild($r['guildid']);
     $this->guild = $this->guild->name;
     $this->data = explode(' ', $r['data']);
     $this->honor = $this->data[CHAR_HONOR_OFFSET];
     $this->hk = $this->data[CHAR_HK_OFFSET];
     $this->arenapoints = $this->data[CHAR_ARENAPOINTS_OFFSET];
     $this->gold = $this->data[MONEY_OFFSET];
     $this->level = $this->data[CHAR_LEVEL_OFFSET];
     $t_time = $r['totaltime'];
     $t_days = (int) ($t_time / 86400);
     $t_time = $t_time - $t_days * 86400;
     $t_hours = (int) ($t_time / 3600);
     $t_time = $t_time - $t_hours * 3600;
     $t_min = (int) ($t_time / 60);
     $this->played[0] = $t_days;
     $this->played[1] = $t_hours;
     $this->played[2] = $t_min;
     $this->realm = $_SYSTEM->Realms[$_SYSTEM->Realm];
     $this->guild_id = $this->data[CHAR_GUILD_ID_OFFSET];
     $this->stats = $this->read_stats();
     $this->read_skills();
     $this->sort_skills();
     $this->read_items();
     $this->load_reputation();
     $this->load_tooltips();
     $this->load_talents();
     $this->load_achievements();
     $this->lastupdate = time();
     return true;
 }
Ejemplo n.º 2
0
 function start()
 {
     global $mysql, $_SYSTEM;
     $WHERE = "WHERE ";
     if ($this->guild > 0) {
         $WHERE .= SQL_template(CHAR_GUILD_OFFSET) . ' = ' . $this->guild . ' AND ';
     }
     if ($this->guid > 0) {
         $WHERE .= 'characters.guid = ' . $this->guid . ' AND ';
     }
     if ($this->class != 0) {
         $WHERE .= 'characters.class = ' . $this->class . ' AND ';
     }
     if ($this->name != '') {
         $WHERE .= 'name LIKE \'%' . $this->name . '%\' AND ';
     }
     $WHERE .= '1=1';
     $il = $this->per_page + 1;
     $st = $this->per_page * $this->page;
     $LIMIT = 'LIMIT ' . $st . ', ' . $il;
     $data = array();
     $i = 0;
     foreach ($_SYSTEM->Realms as $rID => $rName) {
         if ($this->Realm != -1 && $rID != $this->Realm) {
             continue;
         }
         $d = $mysql->getRows("SELECT characters.name,characters.race,characters.class,characters.guid,characters.online,\n\t\t\t\tguild_rank.rname,?1 AS level,?2 AS guild,?3 AS honor,?4 AS hk,?5 as gender\n                FROM `characters` left join `guild_rank` on ?6 = guild_rank.rid and ?7 = guild_rank.guildid\n\t\t\t\t{$WHERE} {$this->order} {$LIMIT}", SQL_template(CHAR_LEVEL_OFFSET), SQL_template(CHAR_GUILD_OFFSET), SQL_template(CHAR_HONOR_OFFSET), SQL_template(CHAR_HK_OFFSET), CHAR_GENDER_OFFSET, SQL_template(CHAR_GUILD_OFFSET + 1), SQL_template(CHAR_GUILD_OFFSET), 'char_' . $rID);
         if (!$d) {
             continue;
         }
         $c = $mysql->query("select count(*) from characters {$WHERE}", 'char_' . $rID);
         $this->count += mysql_result($c, 0);
         foreach ($d as $char) {
             foreach ($char as $key => $value) {
                 $data[$i][$key] = $value;
             }
             if ($data[$i]['guild'] == 0) {
                 $data[$i]['guild'] = 'None';
                 $data[$i]['guildid'] = 0;
             } else {
                 $g = guild($data[$i]['guild']);
                 $data[$i]['guild'] = $g->name;
                 $data[$i]['guildid'] = $g->id;
             }
             $data[$i]['race_string'] = character::raceToString($data[$i]['race']);
             $data[$i]['class_string'] = character::classToString($data[$i]['class']);
             if ($data[$i]['honor'] > 2000000000) {
                 $data[$i]['honor'] = 0;
             }
             $data[$i]['realm'] = $rName;
             $i++;
         }
     }
     return $data;
 }
                                    <th class="header">Exp</th>
                                    <th class="header"><abbr title="Rank">R</abbr></th>
                                    <th class="header"><abbr title="Chars">C</abbr></th>
                                    <th class="header"><abbr title="Avg. Fame / Char">AF/C</abbr></th>
                                    <th class="header"><abbr title="Avg. Exp / Char">AE/C</abbr></th>
                                    <th class="header">Last seen</th>
                                    <th class="header"><abbr title="Server">Srv.</abbr></th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php 
$playercount = 1;
foreach ($db->query("SELECT * FROM accounts ORDER BY aliveFame DESC LIMIT 100;") as $rupee) {
    update($rupee['id']);
    $name = $rupee['name'];
    $guild = guild($rupee['id']);
    $guildname = guildname($guild);
    $alivefame = alivefame($rupee['id']);
    $aliveexp = aliveexp($rupee['id']);
    $characters = alivechars($rupee['id']);
    $stars = stars($rupee['id']);
    $lastseen = lastseen($rupee['id']);
    ?>
                                    <tr>
                                        <td><?php 
    echo $playercount;
    ?>
.</td>
                                        <td>
                                            <div class="star-container">
                                                <a href="player.php?name=<?php 
Ejemplo n.º 4
0
<?php

if ($_GET['name']) {
    if (!(int) $_GET['name']) {
        $data = $mysql->getRows("SELECT guildid,name FROM `guild` where name = '?1'", $_GET['name'], 'char');
        foreach ($data as $guild) {
            if ($_GET['name'] == $guild['name']) {
                $_GET['name'] = $guild['guildid'];
                break;
            }
        }
    }
}
$guild = guild((int) $_GET['name']);
if ($guild->id == -1) {
    $_SYSTEM->error('Guild not found!');
}
$tp->assign('guild', $guild->name);
$tp->assign('guildid', $guild->id);
$tp->assign('gm_id', $guild->leader_id);
$tp->assign('gm', $guild->leader);
$tp->assign('faction', $guild->faction ? $_LANGUAGE->text['horde'] : $_LANGUAGE->text['alliance']);
$tp->assign('faction2', $guild->faction ? 'horde' : 'alliance');
$tp->assign('alliance', $guild->faction);
$tp->assign('members', $guild->members);
$tp->assign('realm', $guild->realm);
$tp->assign('realmid', $guild->realmID);
if (!$guild->faction) {
    $races = '<option value="1">Human</option><option value="3">Dwarf</option><option value="4">Night Elf</option><option value="7">Gnome</option><option value="1">Draenei</option>';
} else {
    $races = '<option value="2">Orc</option><option value="5">Undead</option><option value="10">Blood Elf</option><option value="6">Tauren</option><option value="8">Troll</option>';
Ejemplo n.º 5
0
<?php

$tp = new template();
$tp->add('guild');
$guild = guild($_GET['guild']);
if ($guild->id == -1) {
    $_SYSTEM->error('Guild not found!');
}
$tp->assign('name', $guild->name);
$tp->assign('gm_id', $guild->leader_id);
$tp->assign('gm', $guild->leader);
$tp->assign('faction', $guild->faction ? $_LANGUAGE->text['horde'] : $_LANGUAGE->text['alliance']);
$tp->assign('alliance', $guild->faction);
$tp->assign('gender_nr', $guild->leader_gender);
$tp->assign('members', $guild->members);
$tp->assign('race_nr', $guild->leader_race);
$tp->assign('class_nr', $guild->leader_class);
$tp->assign('realm', $guild->realm);
$tp->assign('realmid', $guild->realmID);
$tp->assign('race', $_LANGUAGE->text[character::raceToString($guild->leader_race)]);
$tp->assign('class', $_LANGUAGE->text[character::classToString($guild->leader_class)]);
$_LANGUAGE->translate($tp);
$tp->display();