]> dev.renevier.net Git - syp.git/blob - inc/html/index.php
16409aa7ff22580ae0c35bcda24da57ac462e8f6
[syp.git] / inc / html / 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 ("POPUPPOS")) {
20     $popuppos = POPUPPOS;
21 } else {
22     $popuppos = 3;
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: expression(Math.min(parseInt(this.scrollWidth) + 7, %d) + 'px');\n", $thumbsmaxsize)?>
35         }
36         .olPopup p {
37             <?php printf("max-width: %dpx;\n", $thumbsmaxsize - 20)?>
38
39         }
40         .olPopup img {
41             <?php printf("max-height: %dpx;\n", $thumbsmaxsize)?>
42             <?php printf("max-width: %dpx;\n", $thumbsmaxsize)?>
43
44             /* for IE (does not understand max-heigth max-width) */
45             <?php printf("_height: expression((this.scrollHeight>this.scrollWidth) ? 
46                  Math.min(parseInt(this.scrollHeight), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
47             <?php printf("_width: expression((this.scrollWidth>this.scrollHeight) ? 
48                  Math.min(parseInt(this.scrollWidth), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
49         }
50     </style>
51
52     <script type="text/javascript">
53         var SypStrings = {
54             language: "<?php echo $lang ?>",
55             propulsedByLink: "<?php ptrans('propulsed by <a href=\"http://syp.renevier.net\">syp</a>')?>",
56             noImageRegistered: "<?php ptrans('There is no image registered on this site.')?>"
57         };
58         var sypSettings =  {
59             popupPos: <?php printf ($popuppos)?>
60         };
61     </script>
62     <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
63     <script src="./js/syp.js" type="text/javascript"></script>
64
65     <noscript>
66     <style type="text/css">
67         #map {
68             display: none;
69         }
70     </style>
71     </noscript>
72
73     </head>
74
75     <body onload="SYP.init();">
76
77         <noscript>
78             <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
79         </noscript>
80
81         <div id="map"></div>
82         <div id="message"></div>
83
84     <div id="bigimg_container">
85     <div id="bigimg_transparency"></div>
86         <div id="bigimg_content">
87             <img id="bigimg" onclick="SYP.closeBigImage()">
88             <img id="bigimg_close" alt="<?php ptrans('close')?>" 
89                     src="openlayers/theme/default/img/close.gif" 
90                     onclick="SYP.closeBigImage()">
91         </div>
92     </div>
93
94 </body>
95 </html>