X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=items.php;h=e7a97231572a689dc0d4185706e66d2a7aab7b33;hp=f816cfbeb25f1f8b060779ea105bef8afed77095;hb=7c5d2d3098b2c4e42f924b6e3d1afec9b5e0b742;hpb=7282fabcfef34ef95b8c6bd414f34d77037451e1
diff --git a/items.php b/items.php
index f816cfb..e7a9723 100644
--- a/items.php
+++ b/items.php
@@ -2,9 +2,24 @@
/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require ("./inc/settings.php");
-require ("./inc/errors.php");
-require ("./inc/db/mysql.php");
+require_once ("./inc/settings.php");
+require_once ("./inc/utils.php");
+require_once ("./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");
+ header ("Cache-control: must-revalidate");
+ header (sprintf ("ETag: %s", $etag));
+
+ return $output;
+}
function main ($features) {
@@ -17,34 +32,45 @@ function main ($features) {
printf (' ', $imgurl, $alt, $thumburl);
+ } else {
+ $imgurlHTML = "";
+ }
+
+ if ($description) {
+ $descriptionHTML = sprintf ('
%s
', $description) ; + } else { + $descriptionHTML = ""; + } + printf (' -