Переделка отображения иконок инстов. Вывод новых.
[cswow.git] / module / userpage / user_kabinet.php
blob78755f5c2d41a983ae96b18ca5db00390827c932
1 <?php
2 if (@$config == NULL) die ("");
4 include_once("include/player_data.php");
5 include_once("include/functions.php");
6 include_once("include/map_data.php");
7 include_once("include/info_table_generator.php");
9 if (isset($_SESSION['account_id']))
11 echo '
12 <table class="report" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
13 <tr>
14 <td class="alt2" valign="top" nowrap="nowrap">
15 <div class="smallfont"><A href="#"><strong>Добро пожаловать, '.$_SESSION['username'].'</strong><br></A>
16 <A href="?user">Мой кабинет</A> | <A href="?user=logout">Выход</A>
17 </div>
18 </td>
19 </tr>
20 </table>';
21 $id = $_SESSION['account_id'];
22 $rows = $cDB->select("SELECT * FROM `characters` WHERE `account` = ?d", $id);
24 echo "<TABLE class=report width=500>";
25 echo "<TBODY>";
26 if($rows)
28 echo "<tr>";
29 echo "<th>$lang[player_level]</th>";
30 echo "<th width=1%></TH>";
31 echo "<th width=100%>$lang[player_name]</th>";
32 echo "<th>$lang[player_race]</th>";
33 echo "<th>$lang[player_class]</th>";
34 echo "<th>$lang[player_zone]</TH>";
35 echo "</tr>\n";
36 foreach ($rows as $player)
38 $imgsize=32;
39 $char_data = explode(' ',$player['data']);
40 $powerType =($char_data[UNIT_FIELD_BYTES_0]>>24)&255;
41 $gender =($char_data[UNIT_FIELD_BYTES_0]>>16)&255;
42 $class =($char_data[UNIT_FIELD_BYTES_0]>> 8)&255;
43 $race =($char_data[UNIT_FIELD_BYTES_0]>> 0)&255;
44 $level = $char_data[UNIT_FIELD_LEVEL];
46 $map_name = getMapNameFromPoint($player['map'], $player['position_x'], $player['position_y'], $player['position_z']);
47 $area_name = getAreaNameFromPoint($player['map'], $player['position_x'], $player['position_y'], $player['position_z']);
48 $extra_name = "";
49 if ($area_name)
51 $extra_name = "<br><font size=-2>".$map_name."</font>";
52 $map_name = "&bdquo;".str_replace(' ','&nbsp;', $area_name)."&ldquo;";
54 else
55 $map_name = "&bdquo;".str_replace(' ','&nbsp;',$map_name)."&ldquo;";
57 $map_name = "<a href=\"map/map.php?x=$player[position_x]&y=$player[position_y]&map=$player[map]\">".$map_name."</a>".$extra_name;
58 echo "<TR>";
59 echo "<TD align=center>$level</TD>";
60 echo "<TD class=pfaction><img width=$imgsize src=\"".getFactionImage($race)."\"></TD>";
61 echo "<TD class=player><A href=?player=$player[guid]>$player[name]</a></TD>";
62 echo "<TD class=prace><img width=$imgsize src=\"".getRaceImage($race,$gender)."\"></TD>";
63 echo "<TD class=pclass><img width=$imgsize src=\"".getClassImage($class)."\"></TD>";
64 echo "<TD class=zone>$map_name</TD>";
65 echo "</TR>\n";
68 else
69 echo "<tr><td colSpan=6 align=center>".$lang['user_no_char_present']."</td></tr>";
70 echo "</TBODY></TABLE>";