From 41ee7f7185ed4bf6081fa30aeb62cc5128f97877 Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Thu, 24 Jan 2013 19:55:55 -0600 Subject: Countdown now shows time to next weekly map as well --- includes/datas.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'includes/datas.php') diff --git a/includes/datas.php b/includes/datas.php index 5dcbe1e..41456a1 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -480,6 +480,20 @@ function hasChallengeBeenCompleted($challenge, $solution, $moves, $paths) { return true; } +/** + * 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 */ @@ -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) { -- cgit v1.2.3