Esempio n. 1
0
function getTop100Players()
{
    global $db, $players_group_and_order, $armory_url, $ALLIANCE, $HORDE, $ALLIANCE_RACES, $HORDE_RACES;
    $query = sprintf("SELECT character_guid, count(character_guid) AS count, characters.name as character_name, characters.level as character_level FROM pvpstats_players INNER JOIN pvpstats_battlegrounds ON pvpstats_players.battleground_id = pvpstats_battlegrounds.id INNER JOIN characters ON pvpstats_players.character_guid = characters.guid WHERE characters.deleteDate IS NULL AND pvpstats_players.winner = 1 %s LIMIT 0,100", $players_group_and_order);
    $result = $db->query($query);
    if (!$result) {
        die("Error querying: " . $query);
    }
    $row = $result->fetch_array();
    if ($row == null) {
        return;
    }
    $position = 1;
    if (!isset($armory_url) || $armory_url == "") {
        $player_name = sprintf("<span style=\"color: %s; \"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $row['character_name']);
    } else {
        $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, $row['character_name'], $row['character_name']);
    }
    $player_guild = getPlayerGuild($row['character_guid']);
    $guild_name = getGuildName($player_guild);
    printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
    $prev_score = $row['count'];
    if (!isset($armory_url) || $armory_url == "") {
        while (($row = $result->fetch_array()) != null) {
            if ($prev_score != $row['count']) {
                $position++;
            }
            $player_name = sprintf("<span style=\"color: %s; \"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $row['character_name']);
            $player_guild = getPlayerGuild($row['character_guid']);
            $guild_name = getGuildName($player_guild);
            printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
            $prev_score = $row['count'];
        }
    } else {
        while (($row = $result->fetch_array()) != null) {
            if ($prev_score != $row['count']) {
                $position++;
            }
            $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, $row['character_name'], $row['character_name']);
            $player_guild = getPlayerGuild($row['character_guid']);
            $guild_name = getGuildName($player_guild);
            printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
            $prev_score = $row['count'];
        }
    }
}
Esempio n. 2
0
                 if ($attr_count > 3) {
                     printf("<td>%s</td>", $row['attr_4']);
                     if ($attr_count > 4) {
                         printf("<td>%s</td>", $row['attr_5']);
                     }
                 }
             }
         }
         printf("</tr>");
     }
 } else {
     while (($row = $result->fetch_array()) != null) {
         printf("<tr>");
         $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, getPlayerName($row['character_guid']), getPlayerName($row['character_guid']));
         printf("<td>%s</td>", $player_name);
         printf("<td style=\"min-width: 49px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td>", getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']));
         printf("<td>%s</td>", $row['score_killing_blows']);
         printf("<td>%s</td>", $row['score_deaths']);
         printf("<td>%s</td>", $row['score_honorable_kills']);
         printf("<td>%s</td>", $row['score_bonus_honor']);
         printf("<td>%s</td>", $row['score_damage_done']);
         printf("<td>%s</td>", $row['score_healing_done']);
         printf("<td>%s</td>", $row['attr_1']);
         if ($attr_count > 1) {
             printf("<td>%s</td>", $row['attr_2']);
             if ($attr_count > 2) {
                 printf("<td>%s</td>", $row['attr_3']);
                 if ($attr_count > 3) {
                     printf("<td>%s</td>", $row['attr_4']);
                     if ($attr_count > 4) {
                         printf("<td>%s</td>", $row['attr_5']);