$sql = "select gl.*, (gl.CenterGeoID >> 18) as terID,(gl.CenterGeoID & ((1 << 9) - 1)) as `x`, ((gl.CenterGeoID >> 9) & ((1 << (9)) - 1)) as `y`, g.Name as guild
from guild_lands as gl
left join guilds g on gl.GuildID=g.ID";
<?
$sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
$res = mysql_query($sql) or die("sql error: " . mysql_error());
$sum_players = mysql_num_rows($res);
$sum_players=0;
while( $row = mysql_fetch_array($res) ) {
$x=0;
$y=0;
$size = $_POST['size'];
$name = $row['Name']." ".$row['LastName'];
if ($row['terID'] == 442) {
$y=1533-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 443) {
$y=1533-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 444) {
$y=1533-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 445) {
$y=1022-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 446) {
$y=1022-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 447) {
$y=1022-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 448) {
$y=511-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 449) {
$y=511-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 450) {
$y=511-$row['y'];
$x=$row['x']+1022;
}
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
}
print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
?>
$sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
$res = mysqli_query($db_handle, $sql) or die("error: " . mysqli_error($db_handle));
$sum_players=0;
while( $row = mysqli_fetch_array($res) ) {
$x=0;
$y=0;
$size = $_POST['size'];
$name = $row['Name']." ".$row['LastName'];
if ($row['terID'] == 442) {
$y=1533-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 443) {
$y=1533-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 444) {
$y=1533-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 445) {
$y=1022-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 446) {
$y=1022-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 447) {
$y=1022-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 448) {
$y=511-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 449) {
$y=511-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 450) {
$y=511-$row['y'];
$x=$row['x']+1022;
}
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
}
print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
print "<div style='border: 1px solid yellow; background: yellow; left:".($x-(2))."px; top: ".($y-(2))."px; width: 2px; height: 2px; position: absolute;' class='player' title='player: $name' ></div>";