From d51b87d9a31f5914fe8509e6ac47eace1872d0ba Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sun, 17 Feb 2013 16:43:25 -0800 Subject: Active maps now have a different color in the scoreboard. --- ajax/maps.ajax.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ajax') diff --git a/ajax/maps.ajax.php b/ajax/maps.ajax.php index 31c041c..bd060fe 100644 --- a/ajax/maps.ajax.php +++ b/ajax/maps.ajax.php @@ -9,11 +9,11 @@ $tmp = explode(".", $_GET['mapid']); $mapID = $tmp[0] * 1; if (!is_int($mapID)) exit; -//$map = new map(getMapCode($mapID), $mapID); $map = getMapObjectByID($mapID); -//62 days -$expires = 62*24*60*60; +$expires = 365*24*60*60; +//TODO: Remove this line once we're confident in data in the mapObject. +$expires = 1*24*60*60; header("Cache-Control: public, maxage=".$expires); header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT'); header("Content-type: text/javascript"); @@ -22,21 +22,20 @@ echo json_encode($map); function getMapObjectByID($mapID) { include_once('../includes/sqlEmbedded.php'); include_once('../includes/maps.php'); - $sql = "SELECT `code`, `name` + $sql = "SELECT `code`, `name`, `mapExpireTime` FROM `maps` - WHERE `ID` = '$mapID' + INNER JOIN `mapOfTheDay` ON mapID = maps.ID + WHERE maps.ID = '$mapID' "; $result = mysql_query($sql); if (mysql_num_rows($result) > 0) { - list($code, $name) = mysql_fetch_row($result); + list($code, $name, $mapExpireTime) = mysql_fetch_row($result); $map = new map($code, $mapID); $map->name = $name; - //$map->name = "bobs"; + $map->dateExpires = $mapExpireTime; return $map; } } - - ?> \ No newline at end of file -- cgit v1.2.3