summaryrefslogtreecommitdiffstats
path: root/do.php
diff options
context:
space:
mode:
Diffstat (limited to 'do.php')
-rw-r--r--do.php26
1 files changed, 6 insertions, 20 deletions
diff --git a/do.php b/do.php
index 1009a91..a43b4ee 100644
--- a/do.php
+++ b/do.php
@@ -372,30 +372,16 @@ die(json_encode($json));
function isCurrentMap($mapID) {
- // TODO: change methodology
include_once('./includes/sqlEmbedded.php');
- $sql = "SELECT maps.ID
+ $sql = "SELECT mapID
FROM `mapOfTheDay`
- LEFT JOIN `maps` ON maps.ID = `mapID`
- WHERE
- `mapID` = '$mapID' AND
- (
- (
- DATEDIFF(CURDATE(), mapOfTheDay.mapDate) < 1 AND
- `mapType` IN (1, 2, 3, 4)
- )
- OR
- (
- DATEDIFF(CURDATE(), mapOfTheDay.mapDate) < 2 AND
- `mapType` IN (5)
- )
- )
+ WHERE `mapID` = '$mapID'
+ AND mapExpireTime > NOW()
+ LIMIT 1
";
+
$result = mysql_query($sql) or die(mysql_error());
- if (mysql_num_rows($result) == 0)
- return false;
- else
- return true;
+ return (mysql_num_rows($result) != 0);
}
//Very simple, confirm that all targets are reachable.