]> dev.renevier.net Git - syp.git/blobdiff - inc/templates_index.php
create thumbnails of photos
[syp.git] / inc / templates_index.php
index 7fd2bb457744ecb3005e9446aa90760070a13bfa..3b70e7c7ddd40f9c95b6c56ff51b2eecb2062b92 100644 (file)
@@ -11,6 +11,11 @@ try {
 }
 
 $bbox = $connection->mbr ();
+if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
+    $thumbsmaxsize = THUMBSMAXSIZE;
+} else {
+    $thumbsmaxsize = 400; // default value;
+}
 ?>
 <html>
 <head>
@@ -19,6 +24,21 @@ $bbox = $connection->mbr ();
     <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news.php">
     <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
     <link rel="stylesheet" href="./media/syp.css" type="text/css">
+    <style type="text/css">
+        .olPopup p {
+            <?php printf("width: %dpx;\n", $thumbsmaxsize)?>
+        }
+        .olPopup img {
+            <?php printf("max-height: %dpx;\n", $thumbsmaxsize)?>
+            <?php printf("max-width: %dpx;\n", $thumbsmaxsize)?>
+
+            /* for IE (does not understand max-heigth max-width) */
+            <?php printf("_height: expression((this.scrollHeight>this.scrollWidth) ? 
+                 Math.min(parseInt(this.scrollHeight), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
+            <?php printf("_width: expression((this.scrollWidth>this.scrollHeight) ? 
+                 Math.min(parseInt(this.scrollWidth), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
+        }
+    </style>
 
     <script type="text/javascript">
         var SypStrings = {