Get worldwide chat messages by default when no radius specified
This commit is contained in:
parent
9697235891
commit
600fe917e5
@ -19,22 +19,24 @@ $database->update("players", [
|
||||
"accountid" => getRequestUser()->getUID()
|
||||
]);
|
||||
|
||||
$radius = 2;
|
||||
if (!empty($VARS["radius"])) {
|
||||
$radius = min(10.0, $VARS["radius"] * 1.0);
|
||||
}
|
||||
$searchbounds = $userlocation->boundingCoordinates($radius, "miles");
|
||||
|
||||
$where = [
|
||||
"LIMIT" => 100,
|
||||
"ORDER" => "time"
|
||||
];
|
||||
|
||||
if (!empty($VARS["latitude"]) && !empty($VARS["longitude"])) {
|
||||
$where["AND"] = [
|
||||
'lat[<>]' => [$searchbounds[0]->getLatitudeInDegrees(), $searchbounds[1]->getLatitudeInDegrees()],
|
||||
'long[<>]' => [$searchbounds[0]->getLongitudeInDegrees(), $searchbounds[1]->getLongitudeInDegrees()],
|
||||
];
|
||||
$radius = false;
|
||||
if (!empty($VARS["radius"])) {
|
||||
$radius = min(10.0, $VARS["radius"] * 1.0);
|
||||
}
|
||||
if ($radius != false) {
|
||||
$searchbounds = $userlocation->boundingCoordinates($radius, "miles");
|
||||
|
||||
if (!empty($VARS["latitude"]) && !empty($VARS["longitude"])) {
|
||||
$where["AND"] = [
|
||||
'lat[<>]' => [$searchbounds[0]->getLatitudeInDegrees(), $searchbounds[1]->getLatitudeInDegrees()],
|
||||
'long[<>]' => [$searchbounds[0]->getLongitudeInDegrees(), $searchbounds[1]->getLongitudeInDegrees()],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
ob_flush();
|
||||
|
Loading…
x
Reference in New Issue
Block a user