summaryrefslogtreecommitdiffstats
path: root/ajax/maps.ajax.php
blob: a5d72f218ce269cc2a4e8223658f2bdde18a0b5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?
ob_start("ob_gzhandler");

//CACHE HEADERS
include('../includes/mapclass.php');
include('../includes/maps.php');

//RETURN MAP w/ CACHE HEADERS
$tmp = explode(".", $_GET['mapid']);
$mapID = $tmp[0] * 1;
if (!is_int($mapID)) exit;

$map = new map(getMapCode($mapID), $mapID);

//62 days
$expires = 62*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");
echo json_encode($map);

?>