diff options
Diffstat (limited to 'do.php')
-rw-r--r-- | do.php | 26 |
1 files changed, 6 insertions, 20 deletions
@@ -371,30 +371,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.
|