diff options
Diffstat (limited to 'includes/datas.php')
-rw-r--r-- | includes/datas.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/includes/datas.php b/includes/datas.php index 5dcbe1e..41456a1 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -481,6 +481,20 @@ function hasChallengeBeenCompleted($challenge, $solution, $moves, $paths) { } /** + * Returns the datetime of the next weekly map + */ +function getNextWeeklyMapDateTime() +{ + $sql = "SELECT MAX(mapExpireTime) AS mapExpireTime + FROM mapOfTheDay + WHERE mapType = " . MapType::Weekly; + + $result = mysql_query($sql); + $row = mysql_fetch_row($result); + return $row[0]; +} + +/** * Hack, due to positions being stored as x,y in some places and y,x in others */ function swapXandYCoordinates($position) @@ -512,10 +526,7 @@ function isChallengeMap($mapID) { ID = '$mapID' AND `isChallenge` = true; "; $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); } function applyAchievements($userID, $aType) { |