Правка опечатки в выводе пула для существ...
[cswow.git] / module / top / top_100.php
blob4d2ab298bbf20acf647cb393605ef54272f2be0b
1 <?php
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'");
19 $rows = $cDB->select(
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']);
21 if ($rows)
23 echo "<table class=report width=500>";
24 echo "<tbody>";
25 echo "<tr><td colspan=7 class=head>$lang[top_money_header]</td></tr>";
26 echo "<tr>";
27 echo "<th></th>";
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>";
34 echo "</tr>\n";
35 $count=1;
36 foreach ($rows as $player)
38 $imgsize=24;
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)
45 // continue;
46 echo "<tr>";
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>";
54 echo "</tr>\n";
55 $count++;
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']);
67 if ($rows)
69 echo "<table class=report width=500>";
70 echo "<tbody>";
71 echo "<tr><td colspan=8 class=head>$lang[top_honor_header]</td></tr>";
72 echo "<tr>";
73 echo "<th></th>";
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>";
81 echo "</tr>\n";
82 $count = 1;
83 foreach ($rows as $player)
85 $imgsize=24;
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)
93 // continue;
94 echo "<tr>";
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>";
103 echo "</tr>\n";
104 $count++;
106 echo "</tbody></table>";
109 else if ($output_mode == "TOP_ARENA")
111 $arena_type = 0;
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`,
118 `arena_team`.`name`,
119 `arena_team`.`type`,
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`
126 FROM
127 `arena_team`,
128 `arena_team_stats`
129 WHERE
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>";
137 if ($rows)
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";
148 echo "<tr>";
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>";
156 echo "</td>";
157 echo "</tr>\n";
159 else
160 echo "<tr><td colspan=4 align=center>$lang[empty]</td></tr>";
161 echo "</tbody></table>";