]> dev.renevier.net Git - syp.git/blobdiff - inc/html/index.php
allow custom css rules
[syp.git] / inc / html / index.php
index 8382159b0686a9f5ff0c04c50b7e20c84e381e3f..550ee48564cde59b8e2503a3ee14afb9f6557405 100644 (file)
@@ -16,10 +16,10 @@ if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
     $thumbsmaxsize = 400; // default value;
 }
 
-if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
-    $popupnearfeature = true;
+if (defined ("POPUPPOS")) {
+    $popuppos = POPUPPOS;
 } else {
-    $popupnearfeature = false;
+    $popuppos = 3;
 }
 ?>
 <html lang="<?php echo $lang?>">
@@ -29,9 +29,14 @@ if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
     <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 {
-            <?php printf("_width: %dpx;\n", ($thumbsmaxsize + 40))?>
+            <?php printf("_width: expression(Math.min(parseInt(this.scrollWidth) + 7, %d) + 'px');\n", ($thumbsmaxsize + 30))?>
+        }
+        .olPopup p {
+            <?php printf("max-width: %dpx;\n", $thumbsmaxsize - 20)?>
+
         }
         .olPopup img {
             <?php printf("max-height: %dpx;\n", $thumbsmaxsize)?>
@@ -45,14 +50,20 @@ if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
         }
     </style>
 
+<?php
+    if (file_exists ("./media/syp_custom.css")) {
+        printf("    <link rel=\"stylesheet\" href=\"./media/syp_custom.css\" type=\"text/css\">\n");
+    }
+?>
+
     <script type="text/javascript">
         var SypStrings = {
             language: "<?php echo $lang ?>",
-            propulsedByLink: "<?php ptrans('propulsed by <a href=\"http://syp.renevier.net\">syp</a>')?>",
+            poweredByLink: "<?php ptrans('powered by <a href=\"http://syp.renevier.net\">syp</a>')?>",
             noImageRegistered: "<?php ptrans('There is no image registered on this site.')?>"
         };
         var sypSettings =  {
-            popupNearfeature: <?php printf ($popupnearfeature ? "true": "false")?>
+            popupPos: <?php printf ($popuppos)?>
         };
     </script>
     <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>