Dragon-Scourge/mapmini.php
Jamin Blount e1b9948505 Beta 2 Build 12
12.10.2005 - Build 12 (Eggs):
- Members can now leave the Guild without requiring an officer to demote
them to zero.
- Rank 5 members can now edit/update Guild settings.
- # of Members is now set to 1 when a Guild is created, and updated
correctly when an application is approved.
- The Guild founder is now notified via the Post Office when someone
applies to join.
- Members can now arbitrarily deposit money to the Guild bank.
- You can no longer send guild money to yourself. Checks and balances,
man!
- Fixed image format selection so that it actually works.
- Removed Language selection from account registration/settings.
2017-02-05 11:51:02 -06:00

46 lines
1.7 KiB
PHP

<?php // mapmini.php :: minimap flash controller.
include("lib.php");
include("globals.php");
$perpix = 100 / ($worldrow["size"] * 2);
$text = "&";
// First do towns.
$towns = dorow(doquery("SELECT * FROM {{table}} WHERE world='".$worldrow["id"]."'", "towns"));
$text .= "towns=".sizeof($towns)."&";
$count = 0;
foreach($towns as $a=>$b) {
$lat = $b["latitude"];
$lon = $b["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "town".$count."_x=".$x."&";
$text .= "town".$count."_y=".$y."&";
$count++;
}
// Then do your character.
$lat = $userrow["latitude"];
$lon = $userrow["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "player_x=".$x."&";
$text .= "player_y=".$y."&";
$users = doquery("SELECT * FROM {{table}} WHERE world='".$worldrow["id"]."' AND UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' AND id != '".$userrow["id"]."'", "users");
$text .= "users=".mysql_num_rows($users)."&";
$count = 0;
while ($b = mysql_fetch_array($users)) {
$lat = $b["latitude"];
$lon = $b["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "user".$count."_x=".$x."&";
$text .= "user".$count."_y=".$y."&";
$count++;
}
echo($text);
?>