]> dev.renevier.net Git - syp.git/blob - inc/templates_index.php
8382159b0686a9f5ff0c04c50b7e20c84e381e3f
[syp.git] / inc / templates_index.php
1 <?php
2 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
3    license. */
4
5 @include_once ("./inc/settings.php");
6 require_once ("./inc/db/mysql.php");
7
8 try {
9     $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
10 } catch (Exception $e) {
11 }
12
13 if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
14     $thumbsmaxsize = THUMBSMAXSIZE;
15 } else {
16     $thumbsmaxsize = 400; // default value;
17 }
18
19 if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
20     $popupnearfeature = true;
21 } else {
22     $popupnearfeature = false;
23 }
24 ?>
25 <html lang="<?php echo $lang?>">
26 <head>
27     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
28     <title><?php echo defined ("SITETITLE") ? htmlspecialchars (SITETITLE) : "SYP"?></title>
29     <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news.php">
30     <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
31     <link rel="stylesheet" href="./media/syp.css" type="text/css">
32     <style type="text/css">
33         .olPopup {
34             <?php printf("_width: %dpx;\n", ($thumbsmaxsize + 40))?>
35         }
36         .olPopup img {
37             <?php printf("max-height: %dpx;\n", $thumbsmaxsize)?>
38             <?php printf("max-width: %dpx;\n", $thumbsmaxsize)?>
39
40             /* for IE (does not understand max-heigth max-width) */
41             <?php printf("_height: expression((this.scrollHeight>this.scrollWidth) ? 
42                  Math.min(parseInt(this.scrollHeight), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
43             <?php printf("_width: expression((this.scrollWidth>this.scrollHeight) ? 
44                  Math.min(parseInt(this.scrollWidth), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
45         }
46     </style>
47
48     <script type="text/javascript">
49         var SypStrings = {
50             language: "<?php echo $lang ?>",
51             propulsedByLink: "<?php ptrans('propulsed by <a href=\"http://syp.renevier.net\">syp</a>')?>",
52             noImageRegistered: "<?php ptrans('There is no image registered on this site.')?>"
53         };
54         var sypSettings =  {
55             popupNearfeature: <?php printf ($popupnearfeature ? "true": "false")?>
56         };
57     </script>
58     <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
59     <script src="./js/syp.js" type="text/javascript"></script>
60
61     <noscript>
62     <style type="text/css">
63         #map {
64             display: none;
65         }
66     </style>
67     </noscript>
68
69     </head>
70
71     <body onload="SYP.init();">
72
73         <noscript>
74             <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
75         </noscript>
76
77         <div id="map"></div>
78         <div id="message"></div>
79
80     <div id="bigimg_container">
81     <div id="bigimg_transparency"></div>
82         <div id="bigimg_content">
83             <img id="bigimg" onclick="SYP.closeBigImage()">
84             <img id="bigimg_close" alt="<?php ptrans('close')?>" 
85                     src="openlayers/theme/default/img/close.gif" 
86                     onclick="SYP.closeBigImage()">
87         </div>
88     </div>
89
90 </body>
91 </html>