]> dev.renevier.net Git - syp.git/blobdiff - items.php
create thumbnails of photos
[syp.git] / items.php
index bcf5f1fc9757c50b33097c72bec649a0c9f738f4..c36318379964d0790564a47587ccf7b4416ef27a 100644 (file)
--- a/items.php
+++ b/items.php
@@ -8,6 +8,8 @@ require_once ("./inc/db/mysql.php");
 
 function main ($features) {
 
+    header ("Cache-control: no-cache");
+
     echo '<?xml version="1.0" encoding="UTF-8"?>
 <kml xmlns="http://www.opengis.net/kml/2.2">
   <Document>
@@ -21,7 +23,10 @@ function main ($features) {
         $title = htmlspecialchars ($feature->title, ENT_QUOTES);
         $description = htmlspecialchars ($feature->description, ENT_QUOTES);
         $imgurl = ($feature->imgpath ? 
-                    full_url_from_filename ($feature->imgpath)
+                    image_url_from_imgpath ($feature->imgpath)
+                    : "");
+        $thumburl = ($feature->imgpath ? 
+                    thumb_url_from_imgpath ($feature->imgpath)
                     : "");
         $lon = $feature->lon;
         $lat = $feature->lat;
@@ -30,7 +35,7 @@ function main ($features) {
                     $title;
 
         if ($imgurl) {
-            $imgurlHTML = sprintf ('<img alt="%s" src="%s">', $alt, $imgurl);
+            $imgurlHTML = sprintf ('<a href="%s"><img alt="%s" src="%s"></a>', $imgurl, $alt, $thumburl);
         } else {
             $imgurlHTML = "";
         }