-require ("./inc/settings.php");
-require ("./inc/errors.php");
-require ("./inc/db/mysql.php");
+function headers_callback ($output) {
+ $etag = md5 ($output);
+ if ((isset ($_SERVER ["HTTP_IF_NONE_MATCH"])) &&
+ ($_SERVER ["HTTP_IF_NONE_MATCH"] == $etag)) {
+ header ("HTTP/1.1 304 Not Modified");
+ exit ();
+ }
+
+ header ("Content-type: application/vnd.google-earth.kml+xml");
+ // no-cache is needed otherwise IE does not try to get new version.
+ header ("Cache-control: no-cache, must-revalidate");
+ header (sprintf ("ETag: %s", $etag));
+
+ return $output;
+}