Example #1
0
function onlineMapRenderCallback($data, $x, $y)
{
    $imgX = 16;
    $imgY = 16;
    $x = round($x - $imgX / 2, 0);
    $y = round($y - $imgY / 2, 0);
    $gender = $data['gender'];
    $class = $data['class'];
    $race = $data['race'];
    $level = $data['level'];
    $faction = getPlayerFaction($race);
    $map_name = getMapName($data['map']);
    $area_name = getAreaNameFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    $img = $faction == 0 ? "gps_icon1.png" : "gps_icon.png";
    $text = "<table class=online_map>";
    $text .= "<tr><td class=" . ($faction == 0 ? "aname" : "hname") . ">" . $data['name'] . "</td></<tr>";
    if ($area_name) {
        $text .= "<tr><td align=center>{$area_name}<br>";
    }
    $text .= "<tr><td align=center>";
    $text .= "<img width=20 src=" . getRaceImage($race, $gender) . "> <img width=20 src=" . getClassImage($class) . "><br>";
    $text .= getRace($race) . "<br>";
    $text .= getClass($class) . "<br>";
    $text .= "Level - {$level}<br>";
    $text .= "</td></tr>";
    $text .= "</table>";
    return '<img src="images/map_points/' . $img . '" class=point style="left: ' . $x . '; top: ' . $y . ';" ' . addTooltip($text) . '>' . "\n";
}
 echo "<th width=1%></TH>";
 echo "<th width=100%>{$lang['player_name']}</th>";
 echo "<th>{$lang['player_race']}</th>";
 echo "<th>{$lang['player_class']}</th>";
 echo "<th>{$lang['player_zone']}</TH>";
 echo "</tr>\n";
 foreach ($rows as $player) {
     $imgsize = 32;
     $char_data = explode(' ', $player['data']);
     $powerType = $char_data[UNIT_FIELD_BYTES_0] >> 24 & 255;
     $gender = $char_data[UNIT_FIELD_BYTES_0] >> 16 & 255;
     $class = $char_data[UNIT_FIELD_BYTES_0] >> 8 & 255;
     $race = $char_data[UNIT_FIELD_BYTES_0] >> 0 & 255;
     $level = $char_data[UNIT_FIELD_LEVEL];
     $map_name = getMapNameFromPoint($player['map'], $player['position_x'], $player['position_y'], $player['position_z']);
     $area_name = getAreaNameFromPoint($player['map'], $player['position_x'], $player['position_y'], $player['position_z']);
     $extra_name = "";
     if ($area_name) {
         $extra_name = "<br><font size=-2>" . $map_name . "</font>";
         $map_name = "&bdquo;" . str_replace(' ', '&nbsp;', $area_name) . "&ldquo;";
     } else {
         $map_name = "&bdquo;" . str_replace(' ', '&nbsp;', $map_name) . "&ldquo;";
     }
     $map_name = "<a href=\"map/map.php?x={$player['position_x']}&y={$player['position_y']}&map={$player['map']}\">" . $map_name . "</a>" . $extra_name;
     echo "<TR>";
     echo "<TD align=center>{$level}</TD>";
     echo "<TD class=pfaction><img width={$imgsize} src=\"" . getFactionImage($race) . "\"></TD>";
     echo "<TD class=player><A href=?player={$player['guid']}>{$player['name']}</a></TD>";
     echo "<TD class=prace><img width={$imgsize} src=\"" . getRaceImage($race, $gender) . "\"></TD>";
     echo "<TD class=pclass><img width={$imgsize} src=\"" . getClassImage($class) . "\"></TD>";
     echo "<TD class=zone>{$map_name}</TD>";
function r_plPos($data)
{
    global $config;
    $map_name = getMapNameFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    $area_name = getAreaNameFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    $extra_name = "";
    if ($area_name) {
        $extra_name = "<br><font size=-2>" . $map_name . "</font>";
        $map_name = "&bdquo;" . str_replace(' ', '&nbsp;', $area_name) . "&ldquo;";
    } else {
        $map_name = "&bdquo;" . str_replace(' ', '&nbsp;', $map_name) . "&ldquo;";
    }
    if ($config['show_map_ptr']) {
        $map_name = "<a href=\"?map&point={$data['map']}:{$data['position_x']}:{$data['position_y']}:{$data['position_z']}\">" . $map_name . "</a>";
    }
    echo $map_name . $extra_name;
}