diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-01-24 19:55:55 -0600 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-01-24 19:55:55 -0600 |
commit | 41ee7f7185ed4bf6081fa30aeb62cc5128f97877 (patch) | |
tree | 93de5c96292fa23c22c5b00c7013fa828e6cfcd5 /includes | |
parent | 0dcddd8c08227e5f49345fee37d21a5c3424452a (diff) | |
download | pathery-41ee7f7185ed4bf6081fa30aeb62cc5128f97877.tar.xz |
Countdown now shows time to next weekly map as well
Diffstat (limited to 'includes')
-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) { |