31-03-2022

index.php
maps.php
photo-du-mois.php
insert_bdd.php
functions.php (localize($domain), data_for_lightbox($data)
This commit is contained in:
2022-03-31 10:21:02 +02:00
parent 6ebef5c974
commit e66bc829cd
7 changed files with 687 additions and 86 deletions

248
css/minimal.css Normal file
View File

@@ -0,0 +1,248 @@
.lcl_minimal #lcl_window,
.lcl_minimal.lcl_txt_under #lcl_txt,
.lcl_minimal.lcl_txt_rside:not(.lcl_force_txt_over) #lcl_txt,
.lcl_minimal.lcl_txt_lside:not(.lcl_force_txt_over) #lcl_txt {
background-color: #3d3d3d;
}
.lcl_minimal #lcl_subj {
background-color: #474747;
}
.lcl_minimal.lcl_fullscreen_mode #lcl_subj {
background-color: #252525;
}
.lcl_minimal #lcl_loader > span {
border-color: #999 #999 transparent;
}
.lcl_minimal.lcl_txt_rside:not(.lcl_force_txt_over) #lcl_txt:after,
.lcl_minimal.lcl_txt_lside:not(.lcl_force_txt_over) #lcl_txt:after {
width: 1px;
}
/* COMMANDS */
.lcl_minimal #lcl_nav_cmd,
.lcl_minimal .lcl_outer_cmd #lcl_nav_cmd,
.lcl_minimal .lcl_forced_outer_cmd #lcl_nav_cmd {
padding: 4px !important;
}
.lcl_minimal #lcl_nav_cmd:before {
content: "";
background: rgba(0, 0, 0, 0.4);
height: 42px;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.lcl_minimal.lcl_fullscreen_mode[lcl-type=iframe] #lcl_nav_cmd:before {
background: #3d3d3d;
}
.lcl_minimal.lcl_fullscreen_mode[lcl-type=iframe] #lcl_subj {
top: 42px;
}
.lcl_minimal .lcl_close {
margin-left: 14px !important;
}
.lcl_minimal .lcl_zoom_in {
margin-right: 14px !important;
}
@media screen and (min-width:450px) {
.lcl_minimal .lcl_close {
margin-left: 28px !important;
}
.lcl_minimal .lcl_zoom_in {
margin-right: 28px !important;
}
.lcl_minimal.lcl_inner_cmd:not(.lcl_on_mobile) #lcl_nav_cmd:before,
.lcl_minimal.lcl_fullscreen_mode.lcl_outer_cmd:not(.lcl_on_mobile):not([lcl-type=iframe]):not([lcl-type=html]) #lcl_nav_cmd:before {
opacity: 0;
-webkit-transition: opacity .2s ease-in .5s;
transition: opacity .2s ease-in .5s;
}
.lcl_minimal:not(.lcl_on_mobile) #lcl_window:hover #lcl_nav_cmd:before,
.lcl_minimal.lcl_fullscreen_mode.lcl_outer_cmd:not(.lcl_on_mobile):not([lcl-type=iframe]):not([lcl-type=html]):hover #lcl_nav_cmd:before {
opacity: 1;
-webkit-transition: all .2s ease-in 0s;
transition: all .2s ease-in 0s;
}
}
.lcl_minimal #lcl_nav_cmd .lcl_icon {
color: #fafafa;
background: transparent;
border-radius: 0 !important;
border: none !important;
box-shadow: none !important;
margin: 3px;
}
@media screen and (max-width:475px) {
.lcl_minimal #lcl_nav_cmd .lcl_icon {
margin: 3px 0;
}
.lcl_minimal .lcl_counter {
letter-spacing: -1px;
}
}
@media screen and (max-width:400px) {
.lcl_minimal #lcl_nav_cmd .lcl_icon {
width: 24px;
}
}
.lcl_minimal #lcl_nav_cmd .lcl_icon:before,
.lcl_minimal #lcl_nav_cmd .lcl_icon * {
text-shadow: 0 0 2px rgba(0, 0, 0, .6);
}
.lcl_minimal .lcl_icon:not(.lcl_counter):after {
background: #cfcfcf;
}
.lcl_minimal#lcl_wrap:not(.lcl_on_mobile) .lcl_icon:not(.lcl_counter):not(a):hover:before {
color: #fff;
text-shadow: none;
}
.lcl_minimal:not(.lcl_on_mobile) .lcl_icon:not(.lcl_counter):after,
.lcl_minimal:not(.lcl_on_mobile) .lcl_icon:not(.lcl_counter):hover:after {
border-radius: 0;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.15) !important;
box-shadow: 0 0 0 7px rgba(0, 0, 0, 0.15);
}
.lcl_minimal.lcl_nav_btn_middle .lcl_prev:before,
.lcl_minimal.lcl_nav_btn_middle .lcl_next:before {
font-size: 28px !important;
}
.lcl_minimal.lcl_nav_btn_middle .lcl_prev:after,
.lcl_minimal.lcl_nav_btn_middle .lcl_next:after {
box-shadow: none !important;
}
.lcl_minimal.lcl_nav_btn_middle .lcl_next:after, .lcl_minimal.lcl_nav_btn_middle .lcl_prev:after,
.lcl_minimal.lcl_nav_btn_middle:not(.lcl_on_mobile) .lcl_next:hover:after, .lcl_minimal.lcl_nav_btn_middle .lcl_prev:hover:after {
background: rgba(0, 0, 0, 0.3) !important;
}
.lcl_minimal .lcl_counter {
font-size: 13px;
line-height: 28px;
}
/* alternative inner close button */
.lcl_minimal #lcl_corner_close {
background: #303030;
border-color: transparent !important;
border-radius: 0 !important;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.lcl_minimal #lcl_corner_close:before {
color: #eee;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.lcl_minimal:not(.lcl_on_mobile) #lcl_corner_close:hover:before {
-webkit-transform: rotate(225deg);
-ms-transform: rotate(225deg);
transform: rotate(225deg);
}
/* TEXTS */
.lcl_minimal #lcl_txt * {
font-family: Arial, 'sans-serif';
color: #ddd;
}
.lcl_minimal #lcl_title {
color: #eee;
}
.lcl_minimal #lcl_author {
color: #bfbfbf;
}
.lcl_minimal .lcl_txt_border {
border-bottom: 1px dotted #666 !important;
}
/* text over */
.lcl_minimal.lcl_force_txt_over #lcl_txt,
.lcl_minimal.lcl_txt_over #lcl_txt {
background: rgba(26, 26, 26, 0.2);
}
.lcl_minimal.lcl_force_txt_over #lcl_txt:before,
.lcl_minimal.lcl_txt_over #lcl_txt:before {
background: #444;
}
.lcl_minimal.lcl_force_txt_over #lcl_txt:after,
.lcl_minimal.lcl_txt_over #lcl_txt:after {
border-color: #3e3e3e;
}
/* text block shadow */
.lcl_minimal.lcl_txt_rside:not(.lcl_force_txt_over) #lcl_txt:after {
content: "";
background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
left: 0;
}
.lcl_minimal.lcl_txt_lside:not(.lcl_force_txt_over) #lcl_txt:after {
content: "";
background: linear-gradient(to left, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
right: 0;
}
.lcl_minimal.lcl_txt_under:not(.lcl_force_txt_over) #lcl_txt::after {
content: "";
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
height: 2px;
}
/* TOOLTIP */
.lcl_minimal .lcl_tooltip {
background: rgba(0,0,0, 0.5);
}
.lcl_minimal .lcl_tooltip.lcl_tt_bottom:before {
border-color: transparent transparent #000;
opacity: .5;
}
.lcl_minimal .lcl_tooltip.lcl_tt_top:before {
border-color: #000 transparent transparent;
opacity: .5;
}
/* SOCIALS VISIBILITY */
.lcl_minimal .lcl_socials_tt a {
border-color: #666;
}
/* THUMBS NAVIGATOR */
.lcl_minimal .lcl_tn_inner li {
border-radius: 0;
}
.lcl_minimal #lcl_thumbs_nav span {
color: #dfdfdf;
}
.lcl_minimal .lcl_tn_mixed_types li::before {
background: rgba(0, 0, 0, 0.25);
}
.lcl_minimal .lcl_tn_mixed_types li:after {
color: #fff;
}
/* PROGRESSBAR */
.lcl_minimal #lcl_progressbar {
background: #eee;
}
/* ADDED */
.lcl_fullscreen_mode.lcl_force_txt_over #lcl_txt, .lcl_fullscreen_mode.lcl_txt_over #lcl_txt {
max-width: 40%;
}

View File

@@ -208,3 +208,63 @@ body {
width: 150px width: 150px
} }
/*
Select lang
index.php
*/
select.mySelect{
background: #9ccebb;
color: #000;
padding: 0 5px;
font-size: 12px;
border: 0px;
opacity: 0.3 !important;
}
select.mySelect option{
color: rgba(0, 0, 0, 0.6);
padding: 0px;
opacity: 0.7 !important;
}
button.myButton{
/*
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
background-color: transparent;
opacity: 0.4 !important;
*/
}
.myForm {
position: absolute;
bottom: 0px;
left: 10px;
/*
color: #fff;
font: 12px "Lucida Grande", Lucida, Verdana, sans-serif;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter:alpha(opacity=60);
-moz-opacity:0.6;
opacity: 0.6;
*/
}
/*
maps2.php
*/
.info_content h3 {
text-align: center;
}
.gm_thumb {
}
.gm_thumb_img {
width: 50%;
height: auto;
}
/*
.nav_bar {
text-align: center;
}
*/

View File

@@ -268,4 +268,212 @@ class AdvancedFilesystemIterator extends ArrayIterator
} }
} }
/*
Suppress keywords like _vert_, _violet_...
*/
function clean_keywords($keywords) {
$v = preg_replace( "/_\w+_/", "", $keywords );
$v = str_replace(",,", ",", $v);
//$v= (substr($v, strlen($v)-1) == ",") ? substr($v, 0, -1) : $v;
$v= rtrim($v, ",");
$v= ltrim($v, ",");
return $v;
}
function data_for_lightbox($data) {
$filename = $data['filename'];
$title_thumb = pathinfo($filename, PATHINFO_FILENAME);
$aperture = $data['aperture'];
$model = $data['model'];
$objectif = $data['lens'];
$speed = $data['speed'];
$iso = $data['iso'];
$exif = $model . " \u{30FB} " . $objectif . " \u{30FB} " . $speed . " \u{30FB} " . $aperture . " \u{30FB} " . $iso . "ISO";
$title = $data['title'];
$legende = $data['legende'];
$file = basename($filename);
if (!empty($title)) {
$x = $title;
$y = ($legende != "") ? $legende : "";
}
elseif (!empty($legende)) {
$x= $legende;
$y = "";
}
else {
$x = $file;
$y = "";
}
$creator = $data['creator'];
$big = host() . $data['filename'];
$thumb = host() . str_replace("photos/img", "photos/thumb", $data['filename']);
$keywords = str_replace(',', " \u{30FB} ", clean_keywords($data['keywords']));
$lightbox = array();
$lightbox['title_thumb'] = $title_thumb;
$lightbox['exif'] = $exif;
$lightbox['title'] = $x;
$lightbox['legende'] = $y;
$lightbox['thumb'] = $thumb;
$lightbox['big'] = $big;
$lightbox['keywords'] = $keywords;
$lightbox['creator'] = $creator;
return $lightbox;
}
/* ----------------------------------------------------
Localization:
-list_dir($dir) : liste le dossier des locales (Locale)
-locale_language_from_browser($languages) : Identify language from the Accept-language HTTP header
-localize() : fonction à ajouter sur chaque page
-----------------------------------------------------*/
function list_dir($dir) {
if ($handle = opendir($dir)) {
$files = array();
while(false!==($file = readdir($handle))) {
if (is_dir($dir . '/' . $file)) {
$files[] = $file;
}
}
closedir($handle);
sort($files);
$i = 0;
global $myLanguages;
$myLanguages = array();
foreach($files as $f) {
if (strstr($f,'.') == false) {
$myLanguages[$i] = $f;
$i++;
}
//$myLanguages[] = $f;
}
}
else {
echo 'error: missing language files';
exit;
}
//print_r($myLanguages);
return $myLanguages;
}
function locale_language_from_browser($languages) {
if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
return FALSE;
}
// The Accept-Language header contains information about the language
// preferences configured in the user's browser / operating system.
// RFC 2616 (section 14.4) defines the Accept-Language header as follows:
// Accept-Language = "Accept-Language" ":"
// 1#( language-range [ ";" "q" "=" qvalue ] )
// language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
// Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5"
$browser_langcodes = array();
if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\\*)(?:;q=([0-9.]+))?(?:$|\\s*,\\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
// We can safely use strtolower() here, tags are ASCII.
// RFC2616 mandates that the decimal part is no more than three digits,
// so we multiply the qvalue by 1000 to avoid floating point comparisons.
$langcode = strtolower($match[1]);
$qvalue = isset($match[2]) ? (double) $match[2] : 1;
$browser_langcodes[$langcode] = (int) ($qvalue * 1000);
}
}
// We should take pristine values from the HTTP headers, but Internet Explorer
// from version 7 sends only specific language tags (eg. fr-CA) without the
// corresponding generic tag (fr) unless explicitly configured. In that case,
// we assume that the lowest value of the specific tags is the value of the
// generic language to be as close to the HTTP 1.1 spec as possible.
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 and
// http://blogs.msdn.com/b/ie/archive/2006/10/17/accept-language-header-for-internet-explorer-7.aspx
asort($browser_langcodes);
foreach ($browser_langcodes as $langcode => $qvalue) {
$generic_tag = strtok($langcode, '-');
if (!isset($browser_langcodes[$generic_tag])) {
$browser_langcodes[$generic_tag] = $qvalue;
}
}
// Find the enabled language with the greatest qvalue, following the rules
// of RFC 2616 (section 14.4). If several languages have the same qvalue,
// prefer the one with the greatest weight.
$best_match_langcode = FALSE;
$max_qvalue = 0;
foreach ($languages as $langcode => $language) {
// Language tags are case insensitive (RFC2616, sec 3.10).
$langcode = strtolower($langcode);
// If nothing matches below, the default qvalue is the one of the wildcard
// language, if set, or is 0 (which will never match).
$qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0;
// Find the longest possible prefix of the browser-supplied language
// ('the language-range') that matches this site language ('the language tag').
$prefix = $langcode;
do {
if (isset($browser_langcodes[$prefix])) {
$qvalue = $browser_langcodes[$prefix];
break;
}
} while ($prefix = substr($prefix, 0, strrpos($prefix, '-')));
// Find the best match.
if ($qvalue > $max_qvalue) {
$best_match_langcode = $language->language;
$max_qvalue = $qvalue;
}
}
return $best_match_langcode;
}
function localize($domain) {
//if ($_SERVER['SERVER_NAME'] == 'airbook.local')
$root = $_SERVER['DOCUMENT_ROOT'];
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
//include($root.'/lib2/localize.php');
$dir_locales = $root . '/Locale';
$liste_locale = list_dir($dir_locales);
if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($liste_locale);
else $langue = $_REQUEST['lang'];
//$domain = 'sentier';
putenv('LC_ALL=' . $langue);
$loc = setlocale(LC_ALL, $langue);
bindtextdomain($domain, $root . '/Locale/');
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
}
function _host() {
if (isset($_SERVER['HTTPS'])) {
if ($_SERVER['HTTPS'] == 'on') $secure = 1;
else $secure = 0;
}
else $secure = 0;
$host = (($secure == 1) ? 'https' : "http") . '://' . $_SERVER['HTTP_HOST'];
return $host;
}
?> ?>

View File

@@ -16,20 +16,20 @@
<link rel="manifest" href="/icons/site.webmanifest"> <link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico"> <link rel="shortcut icon" href="/icons/favicon.ico">
<!--script src="https://zeptojs.com/zepto.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script src="vegas/js/vegas.min.js"></script> <script src="vegas/js/vegas.min.js"></script>
<script src="js/matomo-sls.js"></script> <script src="js/matomo-sls.js"></script>
<link href='https://fonts.googleapis.com/css?family=Coming+Soon' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Coming+Soon' rel='stylesheet' type='text/css'>
<!-- Patrick+Hand|Josefin+Sans|Coming+Soon|Comfortaa|Pontano+Sans|Rock+Salt --> <!-- Patrick+Hand|Josefin+Sans|Coming+Soon|Comfortaa|Pontano+Sans|Rock+Salt -->
<link rel="stylesheet" type="text/css" href="vegas/js/vegas.min.css" /> <link rel="stylesheet" type="text/css" href="vegas/js/vegas.min.css" />
<link rel="stylesheet" type="text/css" href="vegas/js/vegas-style.css" /> <link rel="stylesheet" type="text/css" href="vegas/js/vegas-style.css" />
<link rel="stylesheet" type="text/css" href="css/sls.css" />
<?php <?php
//Get a list of file paths using the glob function. //Get a list of file paths using the glob function.
$fileList = glob('vegas/img/*'); $fileList = glob('vegas/img/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}', GLOB_BRACE);
$pv_sslport=443; $pv_sslport=443;
$pv_serverport=80; $pv_serverport=80;
@@ -150,10 +150,23 @@ foreach($fileList as $filename){
</div> </div>
<div class="myForm">
<form name="langSelect" action="" method="get" >
<select name="lang" id="lang" class="mySelect">
<option>Language</option>
<option value="de_DE">German</option>
<option value="en_US">English</option>
<option value="es_ES">Spanish</option>
<option value="fr_FR">French</option>
</select>
<button type="submit" class="myButton">Ok</button>
</form>
</div>
<div class="vegas-info"> <div class="vegas-info">
<?php echo gettext('Powered by'); ?> <a href="https://wordpress.org">WordPress</a> - <a href="https://www.zenphoto.org">Zenphoto</a> - <a href="https://vegas.jaysalvat.com">Vegas Background Slideshow 2</a>. <a href="">License des photos</a>. (c) 2013-<?php echo date('Y'); ?> sur-le-sentier.fr <?php echo gettext('Powered by'); ?> <a href="https://wordpress.org">WordPress</a> - <a href="https://www.zenphoto.org">Zenphoto</a> - <a href="https://vegas.jaysalvat.com">Vegas Background Slideshow 2</a>. <a href="">License des photos</a>. (c) 2013-<?php echo date('Y'); ?> sur-le-sentier.fr
</div> </div>
</body> </body>
</html> </html>

View File

@@ -35,7 +35,7 @@
include 'functions.php'; include 'functions.php';
?> ?>
<script src='https://code.jquery.com/jquery-3.2.1.min.js' type='text/javascript'></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head> </head>

166
maps.php
View File

@@ -5,7 +5,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Photo du mois</title> <title><?php echo gettext("Maps"); ?></title>
<link rel="stylesheet" href="css/sls.css"> <link rel="stylesheet" href="css/sls.css">
<link rel='stylesheet' href='css/lc_lightbox.min.css' /> <link rel='stylesheet' href='css/lc_lightbox.min.css' />
@@ -16,9 +16,16 @@
width: 100%; width: 100%;
height: 400px; height: 400px;
} }
#mapCanvas {
width: 100%;
height: 650px;
}
</style> </style>
<?php include 'functions.php'; ?> <?php include 'functions.php';
$domain = 'sentier';
localize($domain);
?>
<script src='https://code.jquery.com/jquery-3.2.1.min.js'></script> <script src='https://code.jquery.com/jquery-3.2.1.min.js'></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk"></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk"></script>
@@ -28,21 +35,16 @@
<body> <body>
<h1 class="_h1"><?php echo gettext("Photo du mois"); ?></h1> <h1 class="_h1"><?php echo gettext("Maps"); ?></h1>
<?php <?php
$page = 1;
try { try {
$conn4 = new PDO('sqlite:db_photo.sqlite3'); $conn4 = new PDO('sqlite:db_photo.sqlite3');
$query4 = "SELECT filename, date, lens, exposure, iso, width, height, html, aperture, model, lat, long, alt, legende, copyright, titre, createur, keywords FROM photos WHERE lat != '' ORDER BY date DESC LIMIT ? OFFSET ?"; $query4 = "SELECT filename, date, lens, speed, iso, width, height, html, aperture, model, lat, long, alt, legende, copyright, title, creator, keywords, metering, flash, focal, wb, program FROM photos WHERE lat != '' ORDER BY date DESC";
//nb d'archive par page
$limit = 13;
$offset = $limit * ($page -1);
//echo "offset: " . $offset;
$stmt = $conn4->prepare($query4); $stmt = $conn4->prepare($query4);
$stmt->execute(array($limit, $offset)); $stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC); $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$rowcount = count($result); $rowcount = count($result);
@@ -52,38 +54,132 @@
catch(PDOException $e) { catch(PDOException $e) {
echo $e->getMessage(); echo $e->getMessage();
} }
_pr($result);
$imgLat = $result[0]['lat'];
$imgLng = $result[0]['long'];
?> ?>
<div id="mapCanvas"></div>
<script> <script>
var myCenter = new google.maps.LatLng(<?php echo $imgLat; ?>, <?php echo $imgLng; ?>); function initMap() {
function initialize(){ var map;
var mapProp = { var bounds = new google.maps.LatLngBounds();
center:myCenter, var mapOptions = {
zoom:10, mapTypeId: 'roadmap'
mapTypeId:google.maps.MapTypeId.ROADMAP };
};
// Display a map on the web page
map = new google.maps.Map(document.getElementById("mapCanvas"), mapOptions);
map.setTilt(100);
// Multiple markers location, latitude, and longitude
var markers = [
<?php
$a = "";
for( $i = 0; $i < $rowcount; $i++) {
$a .= '["'.$result[$i]['filename'].'", '.$result[$i]['lat'].', '.$result[$i]['long'].'],' . "\r\n";
}
$a = substr_replace($a, '', -3, 1);
echo $a;
?>
];
// Info window content
var infoWindowContent = [
<?php
$b = "";
for( $i = 0; $i < $rowcount; $i++) {
/*
$thumb = host() . str_replace("photos/img", "photos/thumb", $result[$i]['filename']);
$keywords = str_replace(',', " \u{30FB} ", clean_keywords($result[$i]['keywords']));
$title = $result[$i]['title'];
$legende = $result[$i]['legende'];
$file = basename($result[$i]['filename']);
if (!empty($title)) $x = $title;
elseif (!empty($legende)) $x= $legende;
else $x = $file;
$big = host() . $result[$i]['filename'];
*/
//$tab = array();
//$tab = $result[$i];
//_pr($result[$i]);
$lb = data_for_lightbox($result[$i]);
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb']) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['title']) . '" data-lcl-author="' . htmlspecialchars($lb['exif']) . '"><img src="' . $lb['thumb'] . '" /></a></div><p>' . htmlspecialchars($lb['title']) . '</p><p>' . htmlspecialchars($lb['legende']) . '</p><p>' . htmlspecialchars($lb['keywords']) . '</p></div>\'],' . "\r\n";
}
$b = substr_replace($b, '', -3, 1);
echo $b;
?>
];
// Add multiple markers to map
var infoWindow = new google.maps.InfoWindow(), marker, i;
var map = new google.maps.Map(document.getElementById("map"),mapProp); // Place each marker on the map
for( i = 0; i < markers.length; i++ ) {
var marker = new google.maps.Marker({
position:myCenter, var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
animation:google.maps.Animation.BOUNCE bounds.extend(position);
marker = new google.maps.Marker({
position: position,
map: map,
icon: markers[i][3],
title: markers[i][0]
}); });
marker.setMap(map); // Add info window to marker
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infoWindow.setContent(infoWindowContent[i][0]);
infoWindow.open(map, marker);
}
})(marker, i));
// Center the map to fit all markers on the screen
map.fitBounds(bounds);
} }
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map"></div>
<p><em><small>@ 2022</small></em></p> // Set zoom level
var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {
this.setZoom(6);
google.maps.event.removeListener(boundsListener);
});
}
// Load initialize function
google.maps.event.addDomListener(window, 'load', initMap);
</script>
<script type='text/javascript'>
$(document).ready(function() {
var $obj = lc_lightbox('.gm_thumb a', {
img_zoom : true,
open_close_time : 200,
ol_time_diff : 100,
wrap_class : 'lcl_zoomin_oc',
skin : 'minimal', // minimal | light | dark
data_position : 'over',
cmd_position : 'inner',
txt_hidden : false,
//shox_title : true, // s'il faut afficher les titres
show_descr : false, // s'il faut afficher les descriptions
//show_author : true, // s'il faut afficher les auteurs
fullscreen : true,
fs_img_behavior : 'smart',
fs_only : 500,
browser_fs_mode : true,
txt_toggle_cmd : true,
rclick_prevent : true,
});
});
</script>
<p class="navPage"><a href="index.php"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php"><?php echo gettext("Picture of the month"); ?></a></p>
<p><em><small>@sur-le-sentier.fr 2022</small></em></p>
<script src='js/lc_lightbox.min.js'></script> <script src='js/lc_lightbox.min.js'></script>
<script src='js/alloy_finger.min.js'></script> <script src='js/alloy_finger.min.js'></script>

View File

@@ -11,15 +11,25 @@
<link rel='stylesheet' href='css/lc_lightbox.min.css' /> <link rel='stylesheet' href='css/lc_lightbox.min.css' />
<link rel='stylesheet' href='css/open_close_fx.css' /> <link rel='stylesheet' href='css/open_close_fx.css' />
<link rel='stylesheet' href='css/minimal.css' /> <link rel='stylesheet' href='css/minimal.css' />
<?php include 'functions.php';
$domain = 'sentier';
localize($domain);
?>
<?php <?php
/*
//if ($_SERVER['SERVER_NAME'] == 'airbook.local') //if ($_SERVER['SERVER_NAME'] == 'airbook.local')
$root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT'];
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls //$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
include 'functions.php';
include($root.'/lib2/localize.php'); include($root.'/lib2/localize.php');
$dir_locales = $root . '/Locale'; $dir_locales = $root . '/Locale';
$liste_locale = list_dir($dir_locales); $liste_locale = list_dir($dir_locales);
if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($myLanguages); _pr($liste_locale);
//if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($myLanguages);
if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($liste_locale);
else $langue = $_REQUEST['lang']; else $langue = $_REQUEST['lang'];
$domain = 'sentier'; $domain = 'sentier';
@@ -31,11 +41,11 @@
textdomain($domain); textdomain($domain);
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') ); $nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
*/
include 'functions.php';
?> ?>
<script src='https://code.jquery.com/jquery-3.2.1.min.js' type='text/javascript'></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head> </head>
@@ -118,47 +128,13 @@ try {
<?php <?php
for ($i = 1; $i <= ($rowcount -1); $i++) { for ($i = 1; $i <= ($rowcount -1); $i++) {
$file = $result[$i]['filename'];
$date = $result[$i]['date']; $date = $result[$i]['date'];
$objectif = $result[$i]['lens'];
$speed = $result[$i]['speed']; $lb = data_for_lightbox($result[$i]);
$iso = $result[$i]['iso'];
$width = $result[$i]['width'];
$height = $result[$i]['height'];
$html = $result[$i]['html'];
$aperture = $result[$i]['aperture'];
$model = $result[$i]['model'];
$lat = $result[$i]['lat'];
$long = $result[$i]['long'];
$alt = $result[$i]['alt'];
$legende = $result[$i]['legende'];
$copy = $result[$i]['copyright'];
$title = $result[$i]['title'];
$creator = $result[$i]['creator'];
$keywords = $result[$i]['keywords'];
//$keywords = str_replace(',', ' - ', $keywords);
$keywords = "\u{1F3F7} " . str_replace(',', " \u{30FB} ", $keywords);
if (!empty($title)) {
$x = $title;
$y = $legende;
}
elseif (!empty($legende)) {
$x = $legende;
}
else {
$x = basename($file);
$y = "";
}
$exif = $model . " \u{30FB} " . $objectif . " \u{30FB} " . $speed . " \u{30FB} " . $aperture . " \u{30FB} " . $iso . "ISO";
$thumb = str_replace("photos/img", "photos/thumb", $file);
echo '<div class="item">'; echo '<div class="item">';
echo '<a href ="' . host() . $file . '" title="' . $x . '" data-lcl-txt="' . $y .'" data-lcl-author="' . $exif . '">'; echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['title']) .'" data-lcl-author="' . htmlspecialchars($lb['exif']) . '">';
echo '<img src="' . host() . $thumb . '" alt="' . $x . '" />'; echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '" />';
echo "</a>"; echo "</a>";
echo '<span class="caption">' . month($date) . '</span>'; echo '<span class="caption">' . month($date) . '</span>';
echo '</div>'; echo '</div>';
@@ -269,11 +245,11 @@ for ($i = 1; $i <= $nbpages; $i++) {
} }
} }
if ($page < $nbpages) echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$suiv.'" title="'.gettext("Next Page").'">'.gettext("next").' &raquo;</a>&nbsp;'; if ($page < $nbpages) echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$suiv.'" title="'.gettext("Next Page").'">'.gettext("next").' &raquo;</a>&nbsp;';
echo '</div>'; echo '</div>';
?> ?>
<p class="navPage"><a href="index.php"><?php echo gettext("Home"); ?></a> | <a href="maps.php"><?php echo gettext("Maps"); ?></a></p>
<p><em><small>sur-le-sentier.fr@ 2022</small></em></p> <p><em><small>sur-le-sentier.fr@ 2022</small></em></p>
<script src='js/lc_lightbox.min.js' type='text/javascript'></script> <script src='js/lc_lightbox.min.js' type='text/javascript'></script>