1 | <?php
|
---|
2 |
|
---|
3 |
|
---|
4 | require_once 'header.php';
|
---|
5 | require_once 'libs/char_lib.php';
|
---|
6 | valid_login($action_permission['read']);
|
---|
7 |
|
---|
8 | function top100($realmid, &$sqlr, &$sqlc)
|
---|
9 | {
|
---|
10 | global $output, $lang_top,
|
---|
11 | $realm_db, $characters_db, $server,
|
---|
12 | $itemperpage, $developer_test_mode, $multi_realm_mode;
|
---|
13 |
|
---|
14 | $realm_id = $realmid;
|
---|
15 |
|
---|
16 | $sqlc->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
|
---|
17 |
|
---|
18 | //==========================$_GET and SECURE========================
|
---|
19 | $type = (isset($_GET['type'])) ? $sqlc->quote_smart($_GET['type']) : 'level';
|
---|
20 | if (preg_match('/^[_[:lower:]]{1,10}$/', $type)); else $type = 'level';
|
---|
21 |
|
---|
22 | $start = (isset($_GET['start'])) ? $sqlc->quote_smart($_GET['start']) : 0;
|
---|
23 | if (is_numeric($start)); else $start=0;
|
---|
24 |
|
---|
25 | $order_by = (isset($_GET['order_by'])) ? $sqlc->quote_smart($_GET['order_by']) : 'level';
|
---|
26 | if (preg_match('/^[_[:lower:]]{1,14}$/', $order_by)); else $order_by = 'level';
|
---|
27 |
|
---|
28 | $dir = (isset($_GET['dir'])) ? $sqlc->quote_smart($_GET['dir']) : 1;
|
---|
29 | if (preg_match('/^[01]{1}$/', $dir)); else $dir=1;
|
---|
30 |
|
---|
31 | $order_dir = ($dir) ? 'DESC' : 'DESC';
|
---|
32 | $dir = ($dir) ? 0 : 1;
|
---|
33 | //==========================$_GET and SECURE end========================
|
---|
34 |
|
---|
35 | $type_list = array('level', 'stat', 'defense', 'attack', 'resist', 'crit_hit', 'pvp');
|
---|
36 | if (in_array($type, $type_list));
|
---|
37 | else $type = 'level';
|
---|
38 |
|
---|
39 | $result = $sqlc->query('SELECT count(*) FROM characters');
|
---|
40 | $all_record = $sqlc->result($result, 0);
|
---|
41 | $all_record = (($all_record < 100) ? $all_record : 100);
|
---|
42 |
|
---|
43 | $result = $sqlc->query('SELECT guid, name, race, class, gender, level, totaltime, online, money,
|
---|
44 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_GUILD_ID+1).'), " ", -1) AS UNSIGNED) as gname,
|
---|
45 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MAX_HEALTH+1).'), " ", -1) AS UNSIGNED) AS health,
|
---|
46 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MAX_MANA+1).'), " ", -1) AS UNSIGNED) AS mana,
|
---|
47 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_STR+1).'), " ", -1) AS UNSIGNED) AS str,
|
---|
48 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_AGI+1).'), " ", -1) AS UNSIGNED) AS agi,
|
---|
49 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_STA+1).'), " ", -1) AS UNSIGNED) AS sta,
|
---|
50 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_INT+1).'), " ", -1) AS UNSIGNED) AS intel,
|
---|
51 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_SPI+1).'), " ", -1) AS UNSIGNED) AS spi,
|
---|
52 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_ARMOR+1).'), " ", -1) AS UNSIGNED) AS armor,
|
---|
53 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_BLOCK+1).'), " ", -1) AS UNSIGNED) AS block,
|
---|
54 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_DODGE+1).'), " ", -1) AS UNSIGNED) AS dodge,
|
---|
55 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_PARRY+1).'), " ", -1) AS UNSIGNED) AS parry,
|
---|
56 | (CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_AP+1).'), " ", -1) AS UNSIGNED)
|
---|
57 | + CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_AP_MOD+1).'), " ", -1) AS UNSIGNED)) AS ap,
|
---|
58 | (CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RANGED_AP+1).'), " ", -1) AS UNSIGNED)
|
---|
59 | + CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RANGED_AP_MOD+1).'), " ", -1) AS UNSIGNED)) AS ranged_ap,
|
---|
60 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MINDAMAGE+1).'), " ", -1) AS UNSIGNED) AS min_dmg,
|
---|
61 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MAXDAMAGE+1).'), " ", -1) AS UNSIGNED) AS max_dmg,
|
---|
62 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MINRANGEDDAMAGE+1).'), " ", -1) AS UNSIGNED) AS min_ranged_dmg,
|
---|
63 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MAXRANGEDDAMAGE+1).'), " ", -1) AS UNSIGNED) AS max_ranged_dmg,
|
---|
64 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_EXPERTISE+1).'), " ", -1) AS UNSIGNED) AS expertise,
|
---|
65 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_OFFHAND_EXPERTISE+1).'), " ", -1) AS UNSIGNED) AS off_expertise,
|
---|
66 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_HOLY+1).'), " ", -1) AS UNSIGNED) AS holy,
|
---|
67 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_FIRE+1).'), " ", -1) AS UNSIGNED) AS fire,
|
---|
68 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_NATURE+1).'), " ", -1) AS UNSIGNED) AS nature,
|
---|
69 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_FROST+1).'), " ", -1) AS UNSIGNED) AS frost,
|
---|
70 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_SHADOW+1).'), " ", -1) AS UNSIGNED) AS shadow,
|
---|
71 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RES_ARCANE+1).'), " ", -1) AS UNSIGNED) AS arcane,
|
---|
72 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MELEE_CRIT+1).'), " ", -1) AS UNSIGNED) AS melee_crit,
|
---|
73 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RANGE_CRIT+1).'), " ", -1) AS UNSIGNED) AS range_crit,
|
---|
74 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_MELEE_HIT+1).'), " ", -1) AS UNSIGNED) AS melee_hit,
|
---|
75 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_RANGE_HIT+1).'), " ", -1) AS UNSIGNED) AS range_hit,
|
---|
76 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_SPELL_HIT+1).'), " ", -1) AS UNSIGNED) AS spell_hit,
|
---|
77 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1) AS UNSIGNED) AS honor,
|
---|
78 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_HONOR_KILL+1).'), " ", -1) AS UNSIGNED) AS kills,
|
---|
79 | CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, " ", '.(CHAR_DATA_OFFSET_ARENA_POINTS+1).'), " ", -1) AS UNSIGNED) AS arena
|
---|
80 | FROM characters ORDER BY '.$order_by.' '.$order_dir.' LIMIT '.$start.', '.$itemperpage.'');
|
---|
81 |
|
---|
82 |
|
---|
83 | //==========================top tage navigaion starts here========================
|
---|
84 | $output .= '
|
---|
85 | <center>
|
---|
86 | <div id="tab">
|
---|
87 | <ul>
|
---|
88 | <li'.(($type === 'level') ? ' id="selected"' : '' ).'>
|
---|
89 | <a href="top100.php?start='.$start.'">
|
---|
90 | '.$lang_top['general'].'
|
---|
91 | </a>
|
---|
92 | </li>
|
---|
93 | <li'.(($type === 'stat') ? ' id="selected"' : '' ).'>
|
---|
94 | <a href="top100.php?start='.$start.'&type=stat&order_by=health">
|
---|
95 | '.$lang_top['stats'].'
|
---|
96 | </a>
|
---|
97 | </li>
|
---|
98 | <li'.(($type === 'defense') ? ' id="selected"' : '' ).'>
|
---|
99 | <a href="top100.php?start='.$start.'&type=defense&order_by=armor">
|
---|
100 | '.$lang_top['defense'].'
|
---|
101 | </a>
|
---|
102 | </li>
|
---|
103 | <li'.(($type === 'resist') ? ' id="selected"' : '' ).'>
|
---|
104 | <a href="top100.php?start='.$start.'&type=resist&order_by=holy">
|
---|
105 | '.$lang_top['resist'].'
|
---|
106 | </a>
|
---|
107 | </li>
|
---|
108 | <li'.(($type === 'attack') ? ' id="selected"' : '' ).'>
|
---|
109 | <a href="top100.php?start='.$start.'&type=attack&order_by=ap">
|
---|
110 | '.$lang_top['melee'].'
|
---|
111 | </a>
|
---|
112 | </li>
|
---|
113 | <li'.(($type === 'crit_hit') ? ' id="selected"' : '' ).'>
|
---|
114 | <a href="top100.php?start='.$start.'&type=crit_hit&order_by=ranged_ap">
|
---|
115 | '.$lang_top['ranged'].'
|
---|
116 | </a>
|
---|
117 | </li>
|
---|
118 | <li'.(($type === 'pvp') ? ' id="selected"' : '' ).'>
|
---|
119 | <a href="top100.php?start='.$start.'&type=pvp&order_by=honor">
|
---|
120 | '.$lang_top['pvp'].'
|
---|
121 | </a>
|
---|
122 | </li>
|
---|
123 | </ul>
|
---|
124 | </div>
|
---|
125 | <div id="tab_content">
|
---|
126 | <table class="top_hidden" style="width: 720px">';
|
---|
127 | if($developer_test_mode && $multi_realm_mode)
|
---|
128 | {
|
---|
129 | $realms = $sqlr->query('SELECT count(*) FROM realmlist');
|
---|
130 | $tot_realms = $sqlr->result($realms, 0);
|
---|
131 | if (1 < $tot_realms && 1 < count($server))
|
---|
132 | {
|
---|
133 | $output .= '
|
---|
134 | <tr>
|
---|
135 | <td colspan="2" align="left">';
|
---|
136 | makebutton('View', 'javascript:do_submit(\'form'.$realm_id.'\',0)', 130);
|
---|
137 | $output .= '
|
---|
138 | <form action="top100.php?type='.$type.'" method="post" name="form'.$realm_id.'">
|
---|
139 | Number of Realms :
|
---|
140 | <input type="hidden" name="action" value="realms" />
|
---|
141 | <select name="n_realms">';
|
---|
142 | for($i=1;$i<=$tot_realms;++$i)
|
---|
143 | $output .= '
|
---|
144 | <option value="'.$i.'">'.htmlentities($i).'</option>';
|
---|
145 | $output .= '
|
---|
146 | </select>
|
---|
147 | </form>
|
---|
148 | </td>
|
---|
149 | </tr>';
|
---|
150 | }
|
---|
151 | }
|
---|
152 | $output .= '
|
---|
153 | <tr>
|
---|
154 | <td align="right">Total: '.$all_record.'</td>
|
---|
155 | <td align="right" width="25%">';
|
---|
156 | $output .= generate_pagination('top100.php?type='.$type.'&order_by='.$order_by.'&dir='.(($dir) ? 0 : 1).'', $all_record, $itemperpage, $start);
|
---|
157 | $output .= '
|
---|
158 | </td>
|
---|
159 | </tr>
|
---|
160 | </table>';
|
---|
161 | //==========================top tage navigaion ENDS here ========================
|
---|
162 | $output .= '
|
---|
163 | <table class="lined" style="width: 720px">
|
---|
164 | <tr>
|
---|
165 | <th width="5%">#</th>
|
---|
166 | <th width="14%">'.$lang_top['name'].'</th>
|
---|
167 | <th width="11%">'.$lang_top['race'].' '.$lang_top['class'].'</th>
|
---|
168 | <th width="8%"><a href="top100.php?type='.$type.'&order_by=level&start='.$start.'&dir='.$dir.'"'.($order_by==='level' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['level'].'</a></th>';
|
---|
169 | if ($type === 'level')
|
---|
170 | {
|
---|
171 | $output .= '
|
---|
172 | <th width="22%">'.$lang_top['guild'].'</th>
|
---|
173 | <th width="20%"><a href="top100.php?type='.$type.'&order_by=money&start='.$start.'&dir='.$dir.'"'.($order_by==='money' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['money'].'</a></th>
|
---|
174 | <th width="20%"><a href="top100.php?type='.$type.'&order_by=totaltime&start='.$start.'&dir='.$dir.'"'.($order_by==='totaltime' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['time_played'].'</a></th>';
|
---|
175 | }
|
---|
176 | elseif ($type === 'stat')
|
---|
177 | {
|
---|
178 | $output .= '
|
---|
179 | <th width="11%"><a href="top100.php?type='.$type.'&order_by=health&start='.$start.'&dir='.$dir.'"'.($order_by==='health' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['health'].'</a></th>
|
---|
180 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=mana&start='.$start.'&dir='.$dir.'"'.($order_by==='mana' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['mana'].'</a></th>
|
---|
181 | <th width="9%"><a href="top100.php?type='.$type.'&order_by=str&start='.$start.'&dir='.$dir.'"'.($order_by==='str' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['str'].'</a></th>
|
---|
182 | <th width="8%"><a href="top100.php?type='.$type.'&order_by=agi&start='.$start.'&dir='.$dir.'"'.($order_by==='agi' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['agi'].'</a></th>
|
---|
183 | <th width="8%"><a href="top100.php?type='.$type.'&order_by=sta&start='.$start.'&dir='.$dir.'"'.($order_by==='sta' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['sta'].'</a></th>
|
---|
184 | <th width="8%"><a href="top100.php?type='.$type.'&order_by=intel&start='.$start.'&dir='.$dir.'"'.($order_by==='intel' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['intel'].'</a></th>
|
---|
185 | <th width="8%"><a href="top100.php?type='.$type.'&order_by=spi&start='.$start.'&dir='.$dir.'"'.($order_by==='spi' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['spi'].'</a></th>';
|
---|
186 | }
|
---|
187 | elseif ($type === 'defense')
|
---|
188 | {
|
---|
189 | $output .= '
|
---|
190 | <th width="16%"><a href="top100.php?type='.$type.'&order_by=armor&start='.$start.'&dir='.$dir.'"'.($order_by==='armor' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['armor'].'</a></th>
|
---|
191 | <th width="16%"><a href="top100.php?type='.$type.'&order_by=block&start='.$start.'&dir='.$dir.'"'.($order_by==='block' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['block'].'</a></th>
|
---|
192 | <th width="15%"><a href="top100.php?type='.$type.'&order_by=dodge&start='.$start.'&dir='.$dir.'"'.($order_by==='dodge' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['dodge'].'</a></th>
|
---|
193 | <th width="15%"><a href="top100.php?type='.$type.'&order_by=parry&start='.$start.'&dir='.$dir.'"'.($order_by==='parry' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['parry'].'</a></th>';
|
---|
194 | }
|
---|
195 | elseif ($type === 'resist')
|
---|
196 | {
|
---|
197 | $output .= '
|
---|
198 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=holy&start='.$start.'&dir='.$dir.'"'.($order_by==='holy' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['holy'].'</a></th>
|
---|
199 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=fire&start='.$start.'&dir='.$dir.'"'.($order_by==='fire' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['fire'].'</a></th>
|
---|
200 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=nature&start='.$start.'&dir='.$dir.'"'.($order_by==='nature' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['nature'].'</a></th>
|
---|
201 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=frost&start='.$start.'&dir='.$dir.'"'.($order_by==='frost' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['frost'].'</a></th>
|
---|
202 | <th width="11%"><a href="top100.php?type='.$type.'&order_by=shadow&start='.$start.'&dir='.$dir.'"'.($order_by==='shadow' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['shadow'].'</a></th>
|
---|
203 | <th width="11%"><a href="top100.php?type='.$type.'&order_by=arcane&start='.$start.'&dir='.$dir.'"'.($order_by==='arcane' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['arcane'].'</a></th>';
|
---|
204 | }
|
---|
205 | elseif ($type === 'attack')
|
---|
206 | {
|
---|
207 | $output .= '
|
---|
208 | <th width="20%"><a href="top100.php?type='.$type.'&order_by=ap&start='.$start.'&dir='.$dir.'"'.($order_by==='ap' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['ap'].'</a></th>
|
---|
209 | <th width="6%"><a href="top100.php?type='.$type.'&order_by=min_dmg&start='.$start.'&dir='.$dir.'"'.($order_by==='min_dmg' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['min_dmg'].'</a></th>
|
---|
210 | <th width="6%"><a href="top100.php?type='.$type.'&order_by=max_dmg&start='.$start.'&dir='.$dir.'"'.($order_by==='max_dmg' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['max_dmg'].'</a></th>
|
---|
211 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=melee_crit&start='.$start.'&dir='.$dir.'"'.($order_by==='melee_crit' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['crit'].'</a></th>
|
---|
212 | <th width="5%"><a href="top100.php?type='.$type.'&order_by=melee_hit&start='.$start.'&dir='.$dir.'"'.($order_by==='melee_hit' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['hit'].'</a></th>
|
---|
213 | <th width="5%"><a href="top100.php?type='.$type.'&order_by=expertise&start='.$start.'&dir='.$dir.'"'.($order_by==='expertise' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['expertise'].'</a></th>
|
---|
214 | <th width="9%"><a href="top100.php?type='.$type.'&order_by=off_expertise&start='.$start.'&dir='.$dir.'"'.($order_by==='off_expertise' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['off_expertise'].'</a></th>
|
---|
215 | </tr>';
|
---|
216 | }
|
---|
217 | elseif ($type === 'crit_hit')
|
---|
218 | {
|
---|
219 | $output .= '
|
---|
220 | <th width="18%"><a href="top100.php?type='.$type.'&order_by=ranged_ap&start='.$start.'&dir='.$dir.'"'.($order_by==='ranged_ap' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['ap'].'</a></th>
|
---|
221 | <th width="12%"><a href="top100.php?type='.$type.'&order_by=min_ranged_dmg&start='.$start.'&dir='.$dir.'"'.($order_by==='min_ranged_dmg' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['min_dmg'].'</a></th>
|
---|
222 | <th width="12%"><a href="top100.php?type='.$type.'&order_by=max_ranged_dmg&start='.$start.'&dir='.$dir.'"'.($order_by==='max_ranged_dmg' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['max_dmg'].'</a></th>
|
---|
223 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=range_crit&start='.$start.'&dir='.$dir.'"'.($order_by==='range_crit' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['crit'].'</a></th>
|
---|
224 | <th width="10%"><a href="top100.php?type='.$type.'&order_by=range_hit&start='.$start.'&dir='.$dir.'"'.($order_by==='range_hit' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['hit'].'</a></th>';
|
---|
225 | }
|
---|
226 | elseif ($type === 'pvp')
|
---|
227 | {
|
---|
228 | $output .= '
|
---|
229 | <th width="20%"><a href="top100.php?type='.$type.'&order_by=honor&start='.$start.'&dir='.$dir.'"'.($order_by==='honor' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['rank'].'</a></th>
|
---|
230 | <th width="14%">'.$lang_top['honor_points'].'</th>
|
---|
231 | <th width="14%"><a href="top100.php?type='.$type.'&order_by=kills&start='.$start.'&dir='.$dir.'"'.($order_by==='kills' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['kills'].'</a></th>
|
---|
232 | <th width="14%"><a href="top100.php?type='.$type.'&order_by=arena&start='.$start.'&dir='.$dir.'"'.($order_by==='arena' ? ' class="'.$order_dir.'"' : '').'>'.$lang_top['arena_points'].'</a></th>';
|
---|
233 | }
|
---|
234 | $output .= '
|
---|
235 | </tr>';
|
---|
236 | $i=0;
|
---|
237 | while($char = $sqlc->fetch_assoc($result))
|
---|
238 | {
|
---|
239 | $output .= '
|
---|
240 | <tr valign="top">
|
---|
241 | <td>'.(++$i+$start).'</td>
|
---|
242 | <td><a href="char.php?id='.$char['guid'].'&realm='.$realm_id.'">'.htmlentities($char['name']).'</a></td>
|
---|
243 | <td>
|
---|
244 | <img src="img/c_icons/'.$char['race'].'-'.$char['gender'].'.gif" alt="'.char_get_race_name($char['race']).'" onmousemove="toolTip(\''.char_get_race_name($char['race']).'\', \'item_tooltip\')" onmouseout="toolTip()" />
|
---|
245 | <img src="img/c_icons/'.$char['class'].'.gif" alt="'.char_get_class_name($char['class']).'" onmousemove="toolTip(\''.char_get_class_name($char['class']).'\', \'item_tooltip\')" onmouseout="toolTip()" />
|
---|
246 | </td>
|
---|
247 | <td>'.char_get_level_color($char['level']).'</td>';
|
---|
248 | if ($type === 'level')
|
---|
249 | {
|
---|
250 | $guild_name = $sqlc->result($sqlc->query('SELECT name FROM guild WHERE guildid = '.$char['gname'].''), 0);
|
---|
251 | $days = floor(round($char['totaltime'] / 3600)/24);
|
---|
252 | $hours = round($char['totaltime'] / 3600) - ($days * 24);
|
---|
253 | $time = '';
|
---|
254 | if ($days)
|
---|
255 | $time .= $days.' days ';
|
---|
256 | if ($hours)
|
---|
257 | $time .= $hours.' hours';
|
---|
258 |
|
---|
259 | $output .= '
|
---|
260 | <td><a href="guild.php?action=view_guild&realm='.$realm_id.'&error=3&id='.$char['gname'].'">'.htmlentities($guild_name).'</a></td>
|
---|
261 | <td align="right">
|
---|
262 | '.substr($char['money'], 0, -4).'<img src="img/gold.gif" alt="" align="middle" />
|
---|
263 | '.substr($char['money'], -4, 2).'<img src="img/silver.gif" alt="" align="middle" />
|
---|
264 | '.substr($char['money'], -2).'<img src="img/copper.gif" alt="" align="middle" />
|
---|
265 | </td>
|
---|
266 | <td align="right">'.$time.'</td>';
|
---|
267 | }
|
---|
268 | elseif ($type === 'stat')
|
---|
269 | {
|
---|
270 | $output .= '
|
---|
271 | <td>'.$char['health'].'</td>
|
---|
272 | <td>'.$char['mana'].'</td>
|
---|
273 | <td>'.$char['str'].'</td>
|
---|
274 | <td>'.$char['agi'].'</td>
|
---|
275 | <td>'.$char['sta'].'</td>
|
---|
276 | <td>'.$char['intel'].'</td>
|
---|
277 | <td>'.$char['spi'].'</td>';
|
---|
278 | }
|
---|
279 | elseif ($type === 'defense')
|
---|
280 | {
|
---|
281 | $block = unpack('f', pack('L', $char['block']));
|
---|
282 | $block = round($block[1],2);
|
---|
283 | $dodge = unpack('f', pack('L', $char['dodge']));
|
---|
284 | $dodge = round($dodge[1],2);
|
---|
285 | $parry = unpack('f', pack('L', $char['parry']));
|
---|
286 | $parry = round($parry[1],2);
|
---|
287 |
|
---|
288 | $output .= '
|
---|
289 | <td>'.$char['armor'].'</td>
|
---|
290 | <td>'.$block.'%</td>
|
---|
291 | <td>'.$dodge.'%</td>
|
---|
292 | <td>'.$parry.'%</td>';
|
---|
293 | }
|
---|
294 | elseif ($type === 'resist')
|
---|
295 | {
|
---|
296 | $output .= '
|
---|
297 | <td>'.$char['holy'].'</td>
|
---|
298 | <td>'.$char['fire'].'</td>
|
---|
299 | <td>'.$char['nature'].'</td>
|
---|
300 | <td>'.$char['frost'].'</td>
|
---|
301 | <td>'.$char['shadow'].'</td>
|
---|
302 | <td>'.$char['arcane'].'</td>';
|
---|
303 | }
|
---|
304 | elseif ($type === 'attack')
|
---|
305 | {
|
---|
306 | $melee = unpack('f', pack('L', $char['melee_crit']));
|
---|
307 | $melee = round($melee[1],2);
|
---|
308 | $mindamage = unpack('f', pack('L', $char['min_dmg']));
|
---|
309 | $mindamage = round($mindamage[1],0);
|
---|
310 | $maxdamage = unpack('f', pack('L', $char['max_dmg']));
|
---|
311 | $maxdamage = round($maxdamage[1],0);
|
---|
312 |
|
---|
313 | $output .= '
|
---|
314 | <td>'.$char['ap'].'</td>
|
---|
315 | <td>'.$mindamage.'</td>
|
---|
316 | <td>'.$maxdamage.'</td>
|
---|
317 | <td>'.$melee.'%</td>
|
---|
318 | <td>'.$char['melee_hit'].'</td>
|
---|
319 | <td>'.$char['expertise'].'</td>
|
---|
320 | <td>'.$char['off_expertise'].'</td>';
|
---|
321 | }
|
---|
322 | elseif ($type === 'crit_hit')
|
---|
323 | {
|
---|
324 | $range = unpack('f', pack('L', $char['range_crit']));
|
---|
325 | $range = round($range[1],2);
|
---|
326 | $minrangeddamage = unpack('f', pack('L', $char['min_ranged_dmg']));
|
---|
327 | $minrangeddamage = round($minrangeddamage[1],0);
|
---|
328 | $maxrangeddamage = unpack('f', pack('L', $char['max_ranged_dmg']));
|
---|
329 | $maxrangeddamage = round($maxrangeddamage[1],0);
|
---|
330 |
|
---|
331 | $output .= '
|
---|
332 | <td>'.$char['ranged_ap'].'</td>
|
---|
333 | <td>'.$minrangeddamage.'</td>
|
---|
334 | <td>'.$maxrangeddamage.'</td>
|
---|
335 | <td>'.$range.'%</td>
|
---|
336 | <td>'.$char['range_hit'].'</td>';
|
---|
337 | }
|
---|
338 | elseif ($type === 'pvp')
|
---|
339 | {
|
---|
340 | $output .= '
|
---|
341 | <td align="left"><img src="img/ranks/rank'.char_get_pvp_rank_id($char['honor'], char_get_side_id($char['race'])).'.gif" alt=""></img> '.char_get_pvp_rank_name($char['honor'], char_get_side_id($char['race'])).'</td>
|
---|
342 | <td>'.$char['honor'].'</td>
|
---|
343 | <td>'.$char['kills'].'</td>
|
---|
344 | <td>'.$char['arena'].'</td>';
|
---|
345 | }
|
---|
346 | $output .= '
|
---|
347 | </tr>';
|
---|
348 | }
|
---|
349 | $output .= '
|
---|
350 | </table>
|
---|
351 | <table class="top_hidden" style="width: 720px">
|
---|
352 | <tr>
|
---|
353 | <td align="right">Total: '.$all_record.'</td>
|
---|
354 | <td align="right" width="25%">';
|
---|
355 | $output .= generate_pagination('top100.php?type='.$type.'&order_by='.$order_by.'&dir='.(($dir) ? 0 : 1).'', $all_record, $itemperpage, $start);
|
---|
356 | unset($all_record);
|
---|
357 | $output .= '
|
---|
358 | </td>
|
---|
359 | </tr>
|
---|
360 | </table>
|
---|
361 | </div>
|
---|
362 | <br />
|
---|
363 | </center>';
|
---|
364 |
|
---|
365 | }
|
---|
366 |
|
---|
367 |
|
---|
368 | //#############################################################################
|
---|
369 | // MAIN
|
---|
370 | //#############################################################################
|
---|
371 |
|
---|
372 | //$err = (isset($_GET['error'])) ? $_GET['error'] : NULL;
|
---|
373 |
|
---|
374 | //$output .= '
|
---|
375 | // <div class="top">';
|
---|
376 |
|
---|
377 | $lang_top = lang_top();
|
---|
378 |
|
---|
379 | //if(1 == $err);
|
---|
380 | //else
|
---|
381 | // $output .= "
|
---|
382 | // <h1>'.$lang_top['top100'].'</h1>;
|
---|
383 |
|
---|
384 | //unset($err);
|
---|
385 |
|
---|
386 | //$output .= '
|
---|
387 | // </div>';
|
---|
388 |
|
---|
389 | $action = (isset($_POST['action'])) ? $_POST['action'] : NULL;
|
---|
390 |
|
---|
391 | if ('realms' === $action)
|
---|
392 | {
|
---|
393 | if (isset($_POST['n_realms']))
|
---|
394 | {
|
---|
395 | $n_realms = $_POST['n_realms'];
|
---|
396 |
|
---|
397 | $realms = $sqlr->query('SELECT id, name FROM realmlist LIMIT 10');
|
---|
398 |
|
---|
399 | if (1 < $sqlr->num_rows($realms) && 1 < (count($server)))
|
---|
400 | {
|
---|
401 | for($i=1;$i<=$n_realms;++$i)
|
---|
402 | {
|
---|
403 | $realm = $sqlr->fetch_assoc($realms);
|
---|
404 | if(isset($server[$realm['id']]))
|
---|
405 | {
|
---|
406 | $output .= '
|
---|
407 | <div class="top"><h1>Top 100 of '.$realm['name'].'</h1></div>';
|
---|
408 | top100($realm['id'], $sqlr, $sqlc);
|
---|
409 | }
|
---|
410 | }
|
---|
411 | }
|
---|
412 | else
|
---|
413 | {
|
---|
414 | $output .= '
|
---|
415 | <div class="top"><h1>'.$lang_top['top100'].'</h1></div>';
|
---|
416 | top100($realm_id, $sqlr, $sqlc);
|
---|
417 | }
|
---|
418 | }
|
---|
419 | else
|
---|
420 | {
|
---|
421 | $output .= '
|
---|
422 | <div class="top"><h1>'.$lang_top['top100'].'</h1></div>';
|
---|
423 | top100($realm_id, $sqlr, $sqlc);
|
---|
424 | }
|
---|
425 | }
|
---|
426 | else
|
---|
427 | {
|
---|
428 | $output .= '
|
---|
429 | <div class="top"><h1>'.$lang_top['top100'].'</h1></div>';
|
---|
430 | top100($realm_id, $sqlr, $sqlc);
|
---|
431 | }
|
---|
432 |
|
---|
433 | unset($action);
|
---|
434 | unset($action_permission);
|
---|
435 | unset($lang_top);
|
---|
436 |
|
---|
437 | require_once 'footer.php';
|
---|
438 |
|
---|
439 |
|
---|
440 | ?>
|
---|