1 | <?php
|
---|
2 |
|
---|
3 |
|
---|
4 | require_once 'header.php';
|
---|
5 | require_once 'libs/char_lib.php';
|
---|
6 | valid_login($action_permission['read']);
|
---|
7 |
|
---|
8 | //########################################################################################################################
|
---|
9 | // SHOW CHAR REPUTATION
|
---|
10 | //########################################################################################################################
|
---|
11 | function char_rep(&$sqlr, &$sqlc)
|
---|
12 | {
|
---|
13 | global $output, $lang_global, $lang_char,
|
---|
14 | $realm_id, $characters_db, $mmfpm_db,
|
---|
15 | $action_permission, $user_lvl, $user_name;
|
---|
16 |
|
---|
17 | require_once 'libs/fact_lib.php';
|
---|
18 | $reputation_rank = fact_get_reputation_rank_arr();
|
---|
19 | $reputation_rank_length = fact_get_reputation_rank_length();
|
---|
20 |
|
---|
21 | if (empty($_GET['id']))
|
---|
22 | error($lang_global['empty_fields']);
|
---|
23 |
|
---|
24 | // this is multi realm support, as of writing still under development
|
---|
25 | // this page is already implementing it
|
---|
26 | if (empty($_GET['realm']))
|
---|
27 | $realmid = $realm_id;
|
---|
28 | else
|
---|
29 | {
|
---|
30 | $realmid = $sqlr->quote_smart($_GET['realm']);
|
---|
31 | if (is_numeric($realmid))
|
---|
32 | $sqlc->connect($characters_db[$realmid]['addr'], $characters_db[$realmid]['user'], $characters_db[$realmid]['pass'], $characters_db[$realmid]['name']);
|
---|
33 | else
|
---|
34 | $realmid = $realm_id;
|
---|
35 | }
|
---|
36 |
|
---|
37 | $id = $sqlc->quote_smart($_GET['id']);
|
---|
38 | if (is_numeric($id)); else $id = 0;
|
---|
39 |
|
---|
40 | $result = $sqlc->query('SELECT account, name, race, class, level, gender FROM characters WHERE guid = '.$id.' LIMIT 1');
|
---|
41 |
|
---|
42 | if ($sqlc->num_rows($result))
|
---|
43 | {
|
---|
44 | $char = $sqlc->fetch_assoc($result);
|
---|
45 |
|
---|
46 | // we get user permissions first
|
---|
47 | $owner_acc_id = $sqlc->result($result, 0, 'account');
|
---|
48 | $result = $sqlr->query('SELECT gmlevel, username FROM account WHERE id = '.$char['account'].'');
|
---|
49 | $owner_gmlvl = $sqlr->result($result, 0, 'gmlevel');
|
---|
50 | $owner_name = $sqlr->result($result, 0, 'username');
|
---|
51 |
|
---|
52 | if (($user_lvl > $owner_gmlvl)||($owner_name === $user_name))
|
---|
53 | {
|
---|
54 | $result = $sqlc->query('SELECT faction, standing FROM character_reputation WHERE guid = '.$id.' AND (flags & 1 = 1)');
|
---|
55 |
|
---|
56 | $output .= '
|
---|
57 | <center>
|
---|
58 | <div id="tab">
|
---|
59 | <ul>
|
---|
60 | <li id="selected"><a href="char.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['char_sheet'].'</a></li>
|
---|
61 | <li><a href="char_inv.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['inventory'].'</a></li>
|
---|
62 | '.(($char['level'] < 10) ? '' : '<li><a href="char_talent.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['talents'].'</a></li>').'
|
---|
63 | <li><a href="char_achieve.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['achievements'].'</a></li>
|
---|
64 | <li><a href="char_quest.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['quests'].'</a></li>
|
---|
65 | <li><a href="char_friends.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['friends'].'</a></li>
|
---|
66 | </ul>
|
---|
67 | </div>
|
---|
68 | <div id="tab_content">
|
---|
69 | <div id="tab">
|
---|
70 | <ul>
|
---|
71 | <li><a href="char.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['char_sheet'].'</a></li>';
|
---|
72 | if( char_get_class_name($char['class']) == 'Hunter' )
|
---|
73 | $output .= '
|
---|
74 | <li><a href="char_pets.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['pets'].'</a></li>';
|
---|
75 | $output .= '
|
---|
76 | <li id="selected"><a href="char_rep.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['reputation'].'</a></li>
|
---|
77 | <li><a href="char_skill.php?id='.$id.'&realm='.$realmid.'">'.$lang_char['skills'].'</a></li>
|
---|
78 | </ul>
|
---|
79 | </div>
|
---|
80 | <div id="tab_content2">
|
---|
81 | <font class="bold">
|
---|
82 | '.htmlentities($char['name']).' -
|
---|
83 | <img src="img/c_icons/'.$char['race'].'-'.$char['gender'].'.gif"
|
---|
84 | onmousemove="toolTip(\''.char_get_race_name($char['race']).'\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />
|
---|
85 | <img src="img/c_icons/'.$char['class'].'.gif"
|
---|
86 | onmousemove="toolTip(\''.char_get_class_name($char['class']).'\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /> - lvl '.char_get_level_color($char['level']).'
|
---|
87 | </font>
|
---|
88 | <br /><br />';
|
---|
89 |
|
---|
90 | $temp_out = array
|
---|
91 | (
|
---|
92 | 1 => array('
|
---|
93 | <table class="lined" style="width: 550px;">
|
---|
94 | <tr>
|
---|
95 | <th colspan="3" align="left">
|
---|
96 | <div id="divi1" onclick="expand(\'i1\', this, \'Alliance\')">[-] Alliance</div>
|
---|
97 | </th>
|
---|
98 | </tr>
|
---|
99 | <tr>
|
---|
100 | <td>
|
---|
101 | <table id="i1" class="lined" style="width: 535px; display: table;">',0),
|
---|
102 | 2 => array('
|
---|
103 | <table class="lined" style="width: 550px;">
|
---|
104 | <tr>
|
---|
105 | <th colspan="3" align="left">
|
---|
106 | <div id="divi2" onclick="expand(\'i2\', this, \'Horde\')">[-] Horde</div>
|
---|
107 | </th>
|
---|
108 | </tr>
|
---|
109 | <tr>
|
---|
110 | <td>
|
---|
111 | <table id="i2" class="lined" style="width: 535px; display: table;">',0),
|
---|
112 | 3 => array('
|
---|
113 | <table class="lined" style="width: 550px;">
|
---|
114 | <tr>
|
---|
115 | <th colspan="3" align="left">
|
---|
116 | <div id="divi3" onclick="expand(\'i3\', this, \'Alliance Forces\')">[-] Alliance Forces</div>
|
---|
117 | </th>
|
---|
118 | </tr>
|
---|
119 | <tr>
|
---|
120 | <td>
|
---|
121 | <table id="i3" class="lined" style="width: 535px; display: table;">',0),
|
---|
122 | 4 => array('
|
---|
123 | <table class="lined" style="width: 550px;">
|
---|
124 | <tr>
|
---|
125 | <th colspan="3" align="left">
|
---|
126 | <div id="divi4" onclick="expand(\'i4\', this, \'Horde Forces\')">[-] Horde Forces</div>
|
---|
127 | </th>
|
---|
128 | </tr>
|
---|
129 | <tr>
|
---|
130 | <td>
|
---|
131 | <table id="i4" class="lined" style="width: 535px; display: table;">',0),
|
---|
132 | 5 => array('
|
---|
133 | <table class="lined" style="width: 550px;">
|
---|
134 | <tr>
|
---|
135 | <th colspan="3" align="left">
|
---|
136 | <div id="divi5" onclick="expand(\'i5\', this, \'Steamwheedle Cartels\')">[-] Steamwheedle Cartel</div>
|
---|
137 | </th>
|
---|
138 | </tr>
|
---|
139 | <tr>
|
---|
140 | <td>
|
---|
141 | <table id="i5" class="lined" style="width: 535px; display: table;">',0),
|
---|
142 | 6 => array('
|
---|
143 | <table class="lined" style="width: 550px;">
|
---|
144 | <tr>
|
---|
145 | <th colspan="3" align="left">
|
---|
146 | <div id="divi6" onclick="expand(\'i6\', this, \'The Burning Crusade\')">[-] The Burning Crusade</div>
|
---|
147 | </th>
|
---|
148 | </tr>
|
---|
149 | <tr>
|
---|
150 | <td>
|
---|
151 | <table id="i6" class="lined" style="width: 535px; display: table;">',0),
|
---|
152 | 7 => array('
|
---|
153 | <table class="lined" style="width: 550px;">
|
---|
154 | <tr>
|
---|
155 | <th colspan="3" align="left">
|
---|
156 | <div id="divi7" onclick="expand(\'i7\', this, \'Shattrath City\')">[-] Shattrath City</div>
|
---|
157 | </th>
|
---|
158 | </tr>
|
---|
159 | <tr>
|
---|
160 | <td>
|
---|
161 | <table id="i7" class="lined" style="width: 535px; display: table;">',0),
|
---|
162 | 8 => array('
|
---|
163 | <table class="lined" style="width: 550px;">
|
---|
164 | <tr>
|
---|
165 | <th colspan="3" align="left">
|
---|
166 | <div id="divi8" onclick="expand(\'i8\', this, \'Alliance Vanguard\')">[-] Alliance Vanguard</div>
|
---|
167 | </th>
|
---|
168 | </tr>
|
---|
169 | <tr>
|
---|
170 | <td>
|
---|
171 | <table id="i8" class="lined" style="width: 535px; display: table;">',0),
|
---|
172 | 9 => array('
|
---|
173 | <table class="lined" style="width: 550px;">
|
---|
174 | <tr>
|
---|
175 | <th colspan="3" align="left">
|
---|
176 | <div id="divi9" onclick="expand(\'i9\', this, \'Horde Expedition \')">[-] Horde Expedition </div>
|
---|
177 | </th>
|
---|
178 | </tr>
|
---|
179 | <tr>
|
---|
180 | <td>
|
---|
181 | <table id="i9" class="lined" style="width: 535px; display: table;">',0),
|
---|
182 | 10 => array('
|
---|
183 | <table class="lined" style="width: 550px;">
|
---|
184 | <tr>
|
---|
185 | <th colspan="3" align="left">
|
---|
186 | <div id="divi10" onclick="expand(\'i10\', this, \'Sholazar Basin\')">[-] Sholazar Basin</div>
|
---|
187 | </th>
|
---|
188 | </tr>
|
---|
189 | <tr>
|
---|
190 | <td>
|
---|
191 | <table id="i10" class="lined" style="width: 535px; display: table;">',0),
|
---|
192 | 11 => array('
|
---|
193 | <table class="lined" style="width: 550px;">
|
---|
194 | <tr>
|
---|
195 | <th colspan="3" align="left">
|
---|
196 | <div id="divi11" onclick="expand(\'i11\', this, \'Wrath of the Lich King\')">[-] Wrath of the Lich King</div>
|
---|
197 | </th>
|
---|
198 | </tr>
|
---|
199 | <tr>
|
---|
200 | <td>
|
---|
201 | <table id="i11" class="lined" style="width: 535px; display: table;">',0),
|
---|
202 | 12 => array('
|
---|
203 | <table class="lined" style="width: 550px;">
|
---|
204 | <tr>
|
---|
205 | <th colspan="3" align="left">
|
---|
206 | <div id="divi12" onclick="expand(\'i12\', this, \'Other\')">[-] Other</div>
|
---|
207 | </th>
|
---|
208 | </tr>
|
---|
209 | <tr>
|
---|
210 | <td>
|
---|
211 | <table id="i12" class="lined" style="width: 535px; display: table;">',0),
|
---|
212 | 0 => array('
|
---|
213 | <table class="lined" style="width: 550px;">
|
---|
214 | <tr>
|
---|
215 | <th colspan="3" align="left">
|
---|
216 | <div id="divi13" onclick="expand(\'i13\', this, \'Unknown\')">[-] Unknown</div>
|
---|
217 | </th>
|
---|
218 | </tr>
|
---|
219 | <tr>
|
---|
220 | <td>
|
---|
221 | <table id="i13" class="lined" style="width: 535px; display: table;">',0),
|
---|
222 | );
|
---|
223 |
|
---|
224 | $sqlm = new SQL;
|
---|
225 | $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
|
---|
226 |
|
---|
227 | if ($sqlc->num_rows($result))
|
---|
228 | {
|
---|
229 | while ($fact = $sqlc->fetch_assoc($result))
|
---|
230 | {
|
---|
231 | $faction = $fact['faction'];
|
---|
232 | $standing = $fact['standing'];
|
---|
233 |
|
---|
234 | $rep_rank = fact_get_reputation_rank($faction, $standing, $char['race'], $sqlm);
|
---|
235 | $rep_rank_name = $reputation_rank[$rep_rank];
|
---|
236 | $rep_cap = $reputation_rank_length[$rep_rank];
|
---|
237 | $rep = fact_get_reputation_at_rank($faction, $standing, $char['race'], $sqlm);
|
---|
238 | $faction_name = fact_get_faction_name($faction, $sqlm);
|
---|
239 | $ft = fact_get_faction_tree($faction);
|
---|
240 |
|
---|
241 | // not show alliance rep for horde and vice versa:
|
---|
242 | if ((((1 << ($char['race'] - 1)) & 690) && ($ft == 1 || $ft == 3))
|
---|
243 | || ( ((1 << ($char['race'] - 1)) & 1101) && ($ft == 2 || $ft == 4)));
|
---|
244 | else
|
---|
245 | {
|
---|
246 | $temp_out[$ft][0] .= '
|
---|
247 | <tr>
|
---|
248 | <td width="30%" align="left">'.$faction_name.'</td>
|
---|
249 | <td width="55%" valign="top">
|
---|
250 | <div class="faction-bar">
|
---|
251 | <div class="rep'.$rep_rank.'">
|
---|
252 | <span class="rep-data">'.$rep.'/'.$rep_cap.'</span>
|
---|
253 | <div class="bar-color" style="width:'.(100*$rep/$rep_cap).'%"></div>
|
---|
254 | </div>
|
---|
255 | </div>
|
---|
256 | </td>
|
---|
257 | <td width="15%" align="left" class="rep'.$rep_rank.'">'.$rep_rank_name.'</td>
|
---|
258 | </tr>';
|
---|
259 | $temp_out[$ft][1] = 1;
|
---|
260 | }
|
---|
261 | }
|
---|
262 | }
|
---|
263 | else
|
---|
264 | $output .= '
|
---|
265 | <tr>
|
---|
266 | <td colspan="2"><br /><br />'.$lang_global['err_no_records_found'].'<br /><br /></td>
|
---|
267 | </tr>';
|
---|
268 |
|
---|
269 | foreach ($temp_out as $out)
|
---|
270 | if ($out[1])
|
---|
271 | $output .= $out[0].'
|
---|
272 | </table>
|
---|
273 | </td>
|
---|
274 | </tr>
|
---|
275 | </table>';
|
---|
276 | $output .= '
|
---|
277 | <br />
|
---|
278 | </div>
|
---|
279 | <br />
|
---|
280 | </div>
|
---|
281 | <br />
|
---|
282 | <table class="hidden">
|
---|
283 | <tr>
|
---|
284 | <td>';
|
---|
285 | // button to user account page, user account page has own security
|
---|
286 | makebutton($lang_char['chars_acc'], 'user.php?action=edit_user&id='.$owner_acc_id.'', 130);
|
---|
287 | $output .= '
|
---|
288 | </td>
|
---|
289 | <td>';
|
---|
290 |
|
---|
291 | // only higher level GM with delete access can edit character
|
---|
292 | // character edit allows removal of character items, so delete permission is needed
|
---|
293 | if ( ($user_lvl > $owner_gmlvl) && ($user_lvl >= $action_permission['delete']) )
|
---|
294 | {
|
---|
295 | makebutton($lang_char['edit_button'], 'char_edit.php?id='.$id.'&realm='.$realmid.'', 130);
|
---|
296 | $output .= '
|
---|
297 | </td>
|
---|
298 | <td>';
|
---|
299 | }
|
---|
300 | // only higher level GM with delete access, or character owner can delete character
|
---|
301 | if ( ( ($user_lvl > $owner_gmlvl) && ($user_lvl >= $action_permission['delete']) ) || ($owner_name === $user_name) )
|
---|
302 | {
|
---|
303 | makebutton($lang_char['del_char'], 'char_list.php?action=del_char_form&check%5B%5D='.$id.'" type="wrn', 130);
|
---|
304 | $output .= '
|
---|
305 | </td>
|
---|
306 | <td>';
|
---|
307 | }
|
---|
308 | // only GM with update permission can send mail, mail can send items, so update permission is needed
|
---|
309 | if ($user_lvl >= $action_permission['update'])
|
---|
310 | {
|
---|
311 | makebutton($lang_char['send_mail'], 'mail.php?type=ingame_mail&to='.$char['name'].'', 130);
|
---|
312 | $output .= '
|
---|
313 | </td>
|
---|
314 | <td>';
|
---|
315 | }
|
---|
316 | makebutton($lang_global['back'], 'javascript:window.history.back()" type="def', 130);
|
---|
317 | $output .= '
|
---|
318 | </td>
|
---|
319 | </tr>
|
---|
320 | </table>
|
---|
321 | <br />
|
---|
322 | </center>
|
---|
323 | <!-- end of char_achieve.php -->';
|
---|
324 | }
|
---|
325 | else
|
---|
326 | error($lang_char['no_permission']);
|
---|
327 | }
|
---|
328 | else
|
---|
329 | error($lang_char['no_char_found']);
|
---|
330 |
|
---|
331 | }
|
---|
332 |
|
---|
333 |
|
---|
334 | //########################################################################################################################
|
---|
335 | // MAIN
|
---|
336 | //########################################################################################################################
|
---|
337 |
|
---|
338 | //$action = (isset($_GET['action'])) ? $_GET['action'] : NULL;
|
---|
339 |
|
---|
340 | $lang_char = lang_char();
|
---|
341 |
|
---|
342 | char_rep($sqlr, $sqlc);
|
---|
343 |
|
---|
344 | //unset($action);
|
---|
345 | unset($action_permission);
|
---|
346 | unset($lang_char);
|
---|
347 |
|
---|
348 | require_once 'footer.php';
|
---|
349 |
|
---|
350 |
|
---|
351 | ?>
|
---|