diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 16:43:25 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 16:43:25 -0800 |
commit | d51b87d9a31f5914fe8509e6ac47eace1872d0ba (patch) | |
tree | 5221e63d08af6e7b6ec3cd278d691ea65cab259c /ajax | |
parent | e12ea632b28d9a0cba7c002fe37edc42bf291777 (diff) | |
download | pathery-d51b87d9a31f5914fe8509e6ac47eace1872d0ba.tar.xz |
Active maps now have a different color in the scoreboard.
Diffstat (limited to 'ajax')
-rw-r--r-- | ajax/maps.ajax.php | 17 |
1 files changed, 8 insertions, 9 deletions
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 |