2 include_once("conf.php");
3 include_once("include/player_data.php");
4 include_once("include/functions.php");
6 $type = @$_REQUEST['top'];
8 $output_mode = "TOP_MONEY";
9 if ($type == "money") $output_mode = "TOP_MONEY";
10 if ($type == "honor") $output_mode = "TOP_HONOR";
11 if ($type == "arena2") $output_mode = "TOP_ARENA";
12 if ($type == "arena3") $output_mode = "TOP_ARENA";
13 if ($type == "arena5") $output_mode = "TOP_ARENA";
16 if ($output_mode == "TOP_MONEY")
18 $gm_accs = $rDB->selectCol("SELECT `id` FROM `account` WHERE `gmlevel`<>'0'");
20 "SELECT `guid`, `name` , `race` , `class`, `gender`, `level` , `money` , `account` FROM `characters` {WHERE `account` NOT IN (?a) AND `money`>'0'} ORDER BY `money` DESC LIMIT ?d", empty($gm_accs)?DBSIMPLE_SKIP
:$gm_accs, $config['top_money_limit']);
23 echo "<table class=report width=500>";
25 echo "<tr><td colspan=7 class=head>$lang[top_money_header]</td></tr>";
28 echo "<th width=1px></th>";
29 echo "<th>$lang[player_level]</th>";
30 echo "<th width=50%>$lang[player_name]</th>";
31 echo "<th width=50%>$lang[player_money]</th>";
32 echo "<th width=1px>$lang[player_race]</th>";
33 echo "<th width=1px>$lang[player_class]</th>";
36 foreach ($rows as $player)
39 $gender = $player['gender'];
40 $class = $player['class'];
41 $race = $player['race'];
42 $level = $player['level'];
43 $money = $player['money'];
44 // if (sizeof($char_data)!=PLAYER_FIELD_PADDING+2)
47 echo "<td align = center>$count</td>";
48 echo "<td><img width=$imgsize height=$imgsize src=\"".getFactionImage($race)."\"></td>";
49 echo "<td align=center>$level</td>";
50 echo "<td><a href=?player=$player[guid]>$player[name]</a></td>";
51 echo "<td align=center>".money($money)."</td>";
52 echo "<td align=center><img width=$imgsize height=$imgsize src=\"".getRaceImage($race,$gender)."\"></td>";
53 echo "<td align=center><img width=$imgsize height=$imgsize src=\"".getClassImage($class)."\"></td>";
57 echo "</tbody></table>";
60 else if ($output_mode == "TOP_HONOR")
62 $sort = @$_REQUEST['sort'];
63 if ($sort == 'kills') $sort_str = 'totalKills';
64 else $sort_str = 'totalHonorPoints';
65 $gm_accs = $rDB->selectCol("SELECT `id` FROM `account` WHERE `gmlevel`<>'0'");
66 $rows = $cDB->select("SELECT `guid`, `name` , `race` , `class`, `gender`, `level` , `totalHonorPoints`, `totalKills` FROM `characters` {WHERE `account` NOT IN (?a) AND `totalHonorPoints`>'0'} ORDER BY `$sort_str` DESC LIMIT ?d", empty($gm_accs)?DBSIMPLE_SKIP
:$gm_accs, $config['top_honor_limit']);
69 echo "<table class=report width=500>";
71 echo "<tr><td colspan=8 class=head>$lang[top_honor_header]</td></tr>";
74 echo "<th width=1px></th>";
75 echo "<th>$lang[player_level]</th>";
76 echo "<th width=50%>$lang[player_name]</th>";
77 echo "<th width=50%><a href=\"?top=honor\">$lang[player_honor]</a></th>";
78 echo "<th><a href=\"?top=honor&sort=kills\">$lang[player_kills]</a></th>";
79 echo "<th width=1px>$lang[player_race]</th>";
80 echo "<th width=1px>$lang[player_class]</th>";
83 foreach ($rows as $player)
86 $gender = $player['gender'];
87 $class = $player['class'];
88 $race = $player['race'];
89 $level = $player['level'];
90 $honor = $player['totalHonorPoints'];
91 $kills = $player['totalKills'];
92 // if (sizeof($char_data)!=PLAYER_FIELD_PADDING+2)
95 echo "<td align = center>$count</td>";
96 echo "<td><img width=$imgsize height=$imgsize src=\"".getFactionImage($race)."\"></td>";
97 echo "<td align=center>$level</td>";
98 echo "<td><a href=?player=$player[guid]>$player[name]</a></td>";
99 echo "<td>".$honor."</td>";
100 echo "<td>".$kills."</td>";
101 echo "<td align=center><img width=$imgsize height=$imgsize src=\"".getRaceImage($race,$gender)."\"></td>";
102 echo "<td align=center><img width=$imgsize height=$imgsize src=\"".getClassImage($class)."\"></td>";
106 echo "</tbody></table>";
109 else if ($output_mode == "TOP_ARENA")
112 if ($type == "arena2") $arena_type = 2;
113 if ($type == "arena3") $arena_type = 3;
114 if ($type == "arena5") $arena_type = 5;
116 $rows = $cDB->select("SELECT
117 `arena_team`.`arenateamid`,
120 `arena_team`.`BackgroundColor`,
121 `arena_team`.`EmblemStyle`,
122 `arena_team`.`EmblemColor`,
123 `arena_team`.`BorderStyle`,
124 `arena_team`.`BorderColor`,
125 `arena_team_stats`.`rating`
130 `arena_team`.`type`=?d AND
131 `arena_team`.`arenateamid`=`arena_team_stats`.`arenateamid`
132 ORDER BY `arena_team_stats`.`rating` DESC
133 LIMIT ?d", $arena_type, $config['top_arena_limit']);
134 echo "<table class=report width=500><tbody>";
135 echo "<tr><td colspan=4 class=head>".sprintf($lang['top_arena_header'], $arena_type)."</tr>";
136 echo "<tr><th width=1></th><th>$lang[arena_team_name]</th><th>$lang[arena_rating]</th><th>$lang[arena_team]</th></tr>";
138 foreach ($rows as $arena_team_info)
140 $type = $arena_team_info['type'];
141 $back = ($arena_team_info['BackgroundColor']+
0)&0xFFFFFF;
142 $emblem = $arena_team_info['EmblemStyle'];
143 $ecolor = ($arena_team_info['EmblemColor']+
0)&0xFFFFFF;
144 $border = $arena_team_info['BorderStyle'];
145 $bcolor = ($arena_team_info['BorderColor']+
0)&0xFFFFFF;
146 $emblem_image = "images/player_info/arena_small_ico.php?type=$type&back=$back&emblem=$emblem&ecolor=$ecolor&border=$border&bcolor=$bcolor";
149 echo "<td><img src=$emblem_image width=64></td>";
150 echo "<td align = center><a href=\"?arenateam=".$arena_team_info['arenateamid']."\">".$arena_team_info['name']."</a></td>";
151 echo "<td align = center>".$arena_team_info['rating']."</td>";
152 echo "<td align = center>";
153 $team = $cDB->select("SELECT * FROM `arena_team_member` WHERE `arenateamid`=?d", $arena_team_info['arenateamid']);
154 foreach ($team as $team_member)
155 echo "<a href=?player=$team_member[guid]>".getCharacterName($team_member['guid'])."</a><br>";
160 echo "<tr><td colspan=4 align=center>$lang[empty]</td></tr>";
161 echo "</tbody></table>";