]> dev.renevier.net Git - syp.git/blobdiff - inc/templates_index.php
better w3 standard support
[syp.git] / inc / templates_index.php
index 722daa9479bbdbe7a1ec1d087c4d2d558d162260..8382159b0686a9f5ff0c04c50b7e20c84e381e3f 100644 (file)
@@ -2,7 +2,7 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
-require_once ("./inc/settings.php");
+@include_once ("./inc/settings.php");
 require_once ("./inc/db/mysql.php");
 
 try {
@@ -10,17 +10,22 @@ try {
 } catch (Exception $e) {
 }
 
-$bbox = $connection->mbr ();
 if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
     $thumbsmaxsize = THUMBSMAXSIZE;
 } else {
     $thumbsmaxsize = 400; // default value;
 }
+
+if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
+    $popupnearfeature = true;
+} else {
+    $popupnearfeature = false;
+}
 ?>
 <html lang="<?php echo $lang?>">
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
-    <title><?php echo defined ("SITETITLE") ? SITETITLE : "SYP"?></title>
+    <title><?php echo defined ("SITETITLE") ? htmlspecialchars (SITETITLE) : "SYP"?></title>
     <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">
@@ -46,10 +51,9 @@ if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
             propulsedByLink: "<?php ptrans('propulsed by <a href=\"http://syp.renevier.net\">syp</a>')?>",
             noImageRegistered: "<?php ptrans('There is no image registered on this site.')?>"
         };
-        <?php
-            printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
-                    $bbox [0], $bbox [1], $bbox [2], $bbox [3]);
-        ?>
+        var sypSettings =  {
+            popupNearfeature: <?php printf ($popupnearfeature ? "true": "false")?>
+        };
     </script>
     <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
     <script src="./js/syp.js" type="text/javascript"></script>