12 Commits

Author SHA1 Message Date
e627a8e3ff maps.php
Nouveautés:
- AJAX pour récupérer les données depuis la base
- Leaflet pour l’API
- Openstreetmap pour les cartes
2025-02-18 15:38:23 +01:00
cab19ef683 maps_osm.php
Version OpenStreetMap de maps.php
2025-02-14 16:21:48 +01:00
4d256fbcfc maps.php
-correction mauvais chemin des vignettes
-correction affichage desciption dans la lightbox
2025-02-14 08:14:11 +01:00
356c1885df Mise-à-jour des traductions FR et ES 2025-02-13 18:05:47 +01:00
5638476d71 Suppression d’image 2025-02-13 18:03:25 +01:00
1ddd50ec90 Le dossier /thumb n’est plus suivi 2025-02-13 18:00:40 +01:00
f0fa8b6efc Version 1.1
-réécriture de la fonction create_thumb: pour les images format portrait, les vignettes sont redimensionner à 300px de large, puis cropées à 300x200. Toutes les vignettes sont au format paysage.
-quelques corrections de bugs
2025-02-13 17:38:01 +01:00
b35196fdb8 Version 1.0
-déplacement des fichiers d’admin dans un dossier admin
-corrections dans la fonction data_for_lightbox($data). Celle-ci est maintenant toujours utilisé pour l’affichage des vignettes et des images dans la lightbox
-les chemins sont nettoyés avec 2 variables: $chemin pour les images, $base pour la base Sqlite
-corrections diverses
2025-02-13 10:07:21 +01:00
55bedea648 Minor correction
clean_bdd.php
2024-12-14 13:42:38 +01:00
ec0ab53cb2 Validation HTML 2024-12-14 11:54:27 +01:00
bfda660a2f Nouvelle gestion des langues
i18n_setup.php remplace localize.php
2024-12-14 11:53:25 +01:00
59de54758d Mise-à-jour des traductions
-exclusion du dossier vendor
2024-12-14 11:51:55 +01:00
276 changed files with 3301 additions and 1586 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-12 15:15+0100\n"
"PO-Revision-Date: 2024-12-12 15:15+0100\n"
"PO-Revision-Date: 2024-12-14 11:50+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en_US\n"
@@ -20,6 +20,7 @@ msgstr ""
"X-Poedit-Basepath: ../../..\n"
"X-Poedit-KeywordsList: gettext;ngettext;_;__\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: vendor\n"
#: 1-login.php:15
msgid "Login Page"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,74 +0,0 @@
<?php require ("3-protect.php");
include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo gettext('Logged in'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<!--link rel='stylesheet' href='css/lc_lightbox.min.css' />
<link rel='stylesheet' href='css/open_close_fx.css' />
<link rel='stylesheet' href='css/minimal.css' /-->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!--link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script-->
</head>
<body>
<h1><?php echo gettext('Status: ') . $_SESSION["user"] . gettext(' logged in'); ?></h1>
<!--div class="center-flex"-->
<div class="center-flex">
<?php
$base = 'db_photo.sqlite3';
if (file_exists($base)) {
//echo '<div class="base">Base SQLite: ' . $base . ' !</div>';
echo '<h3>Base SQLite: ' . __DIR__ . '/' . $base . ' !</h3>';
}
?>
<nav>
<a class="kaki" href="../edit_bdd.php">Edit</a>
<a class="kaki" href="../insert_bdd.php">Insert</a>
<a class="kaki" href="../modify_bdd.php">Modify</a>
<a class="kaki" href="../view_bdd.php">View (Ajax)</a>
<a class="kaki" href="../view_bdd2.php">View</a>
<a class="kaki" href="../clean_bdd.php">Clean</a>
</nav>
<!-- (B1) LOGOUT FORM -->
<p></p>
<nav><a class="red" href="4-logout.php" role="button">Log out</a></nav>
</div>
<!--form method="post">
<input type="hidden" name="logout" value="1">
<input type="submit" value="Log Out">
</form-->
<?php
//$_SESSION["user"] != ""
?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
</body>
</html>

View File

@@ -3,10 +3,10 @@
// (A) LOGIN CHECKS
require "2-check.php";
include 'localize.php';
include '../localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
include '../functions.php';
// (B) LOGIN PAGE HTML ?>
<!DOCTYPE html>
@@ -14,7 +14,7 @@
<head>
<title><?php echo gettext("Login Page"); ?></title>
<link rel="stylesheet" href="1-login.css" />
<link rel="stylesheet" href="css/sls.css" />
<link rel="stylesheet" href="../css/sls.css" />
</head>
<body>
<?php if (isset($failed)) { ?>
@@ -30,7 +30,7 @@
<input type="submit" value="<?php echo gettext("Sign In"); ?>">
</form>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>

88
admin/admin.php Normal file
View File

@@ -0,0 +1,88 @@
<?php require ("3-protect.php");
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include '../functions.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sur le sentier: pages administration">
<title><?php echo gettext('Logged in'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="../css/sls.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<h1><?php echo gettext('Status: ') . $_SESSION["user"] . gettext(' logged in'); ?></h1>
<!--div class="center-flex"-->
<div class="center-flex">
<?php
$base = 'db_photo.sqlite3';
if (file_exists($base)) {
echo '<h3>Base SQLite: ' . __DIR__ . '/' . $base . ' !</h3>';
}
?>
<nav>
<a class="kaki" href="edit_bdd.php"><?php echo gettext("Edit"); ?></a>
<a class="kaki" href="insert_bdd.php"><?php echo gettext("Insert"); ?></a>
<a class="kaki" href="modify_bdd.php"><?php echo gettext("Modify"); ?></a>
<a class="kaki" href="view_bdd.php"><?php echo gettext("View (Ajax)"); ?></a>
<a class="kaki" href="view_bdd2.php"><?php echo gettext("View"); ?></a>
<a class="kaki" href="clean_bdd.php"><?php echo gettext("Clean"); ?></a>
</nav>
<!-- (B1) LOGOUT FORM -->
<p></p>
<nav><a class="red" href="4-logout.php" role="button"><?php echo gettext("Log out"); ?></a></nav>
</div>
<!--form method="post">
<input type="hidden" name="logout" value="1">
<input type="submit" value="Log Out">
</form-->
<div class="indexForm">
<form name="langSelect" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" >
<select name="lang" id="lang" class="mySelect">
<option value="">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>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
</body>
</html>

View File

@@ -1,8 +1,12 @@
<?php require ("3-protect.php");
include 'localize.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
?>
<!DOCTYPE html>
<html lang="en">
@@ -11,12 +15,18 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sur le sentier: admin">
<title><?php echo gettext('Clean photos in Sqlite base'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="../css/sls.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
@@ -24,24 +34,24 @@
<body>
<h1><?php echo gettext('Clean / repare database'); ?></h1><br />
<h1><?php echo gettext('Clean / repare database'); ?></h1><br>
<?php
$base = 'db_photo.sqlite3';
$chemin = '../photos/img/';
$base = '../db_photo.sqlite3';
// Taille des vignettes
$th_w = 300;
$th_h = 300;
// Chemins
$img_path = "photos/img/";
$thumb_path = "photos/thumb/";
$img_path = $chemin;
$thumb_path = str_replace("img", "thumb", $chemin);
echo '<h3>' . gettext('Clean folder img...') . '</h3>';
$originals = array_map('basename', glob('photos/img/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}', GLOB_BRACE));
$thumbs = array_map('basename', glob('photos/thumb/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}', GLOB_BRACE));
$originals = array_map('basename', glob("$img_path/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}", GLOB_BRACE));
$thumbs = array_map('basename', glob("$thumb_path/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}", GLOB_BRACE));
// On recherche les vignettes manquantes
@@ -58,9 +68,8 @@ if ($a > 0) {
foreach($missing_thumbs as $img){
$file = $img_path . $img;
create_thumb($th_w, $th_h, $file);
echo gettext('Thumb for ') . $img . gettext(' was successfully created!') . '<br>';
echo '<h5>' . gettext('Thumb for ') . $img . gettext(' was successfully created!') . '</h5>';
}
}
@@ -79,9 +88,9 @@ if ($b > 0) {
foreach($extra_thumbs as $thumb){
$file = $thumb_path . $thumb;
if (unlink($file)) {
echo $thumb . gettext(' was deleted successfully!') . '<br>';
echo '<h5>' . $thumb . gettext(' was deleted successfully!') . '</h5>';
} else {
echo gettext('There was a error deleting the file ') . $thumb;
echo '<h5 class="redtext">' . gettext('There was a error deleting the file ') . $thumb . '</h5>';
}
}
}
@@ -92,7 +101,7 @@ if ($b > 0) {
echo '<h3>' . gettext('Compare folder img and database...') . '</h3>';
try {
$conn = new PDO("sqlite:db_photo.sqlite3");
$conn = new PDO("sqlite:$base");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = "SELECT filename FROM photos";
@@ -116,8 +125,8 @@ foreach($result as $file) {
}
$base = array_map('basename', $bdd);
echo '<h4>' . count($base) . " entries in database". "</h4>";
echo '<h4>' . count($originals) . " files on disk" . "</h4>";
echo '<h4>' . count($base) . gettext(" entries in database"). "</h4>";
echo '<h4>' . count($originals) . gettext(" files on disk") . "</h4>";
$extra_in_bdd= array_diff($base, $originals);
$c = count($extra_in_bdd);
@@ -137,7 +146,7 @@ if ($c > 0) {
$stmt->bindParam(':filename', $file);
$result = $stmt->execute();
if ($result) {
echo $img . gettext(' has been deleted from database !') . "<br />";
echo '<h5>' . $img . gettext(' has been deleted from database !') . "</h5>";
}
}
}
@@ -695,10 +704,12 @@ if ($d > 0) {
echo '</thead>';
echo '<tbody>';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
//$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
//$full = host() . $row['filename'];
echo '<tr><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td><td>' . $row['filename'] . '</td><td>' . $row['filesize'] . '</td><td>' . $row['dateoriginal'] . '</td><td>' . $row['lens'] . '</td><td>' . $row['speed'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['model'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['flash'] . '</td><td>' . $row['focal'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td><td>' . $row['mode'] . '</td><td>' . $row['software'] . '</td><td>' . $row['lat'] . '</td><td>' . $row['long'] . '</td><td>' . $row['alt'] . '</td><td>' . $row['keywords'] . '</td><td>' . $row['title'] . '</td><td>' . $row['creator'] . '</td><td>' . $row['city'] . '</td><td>' . $row['department'] . '</td><td>' . $row['code'] . '</td><td>' . $row['country'] . '</td><td>' . $row['copyright'] . '</td><td>' . $row['legende'] . '</td></tr>';
$lb = data_for_lightbox($row);
echo '<tr><td>' . '<a href="' . $lb['big'] . '"><img src="' . $lb['thumb'] . '" /></a>' . '</td><td>' . $row['filename'] . '</td><td>' . $row['filesize'] . '</td><td>' . $row['dateoriginal'] . '</td><td>' . $row['lens'] . '</td><td>' . $row['speed'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['model'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['flash'] . '</td><td>' . $row['focal'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td><td>' . $row['mode'] . '</td><td>' . $row['software'] . '</td><td>' . $row['lat'] . '</td><td>' . $row['long'] . '</td><td>' . $row['alt'] . '</td><td>' . $row['keywords'] . '</td><td>' . $row['title'] . '</td><td>' . $row['creator'] . '</td><td>' . $row['city'] . '</td><td>' . $row['department'] . '</td><td>' . $row['code'] . '</td><td>' . $row['country'] . '</td><td>' . $row['copyright'] . '</td><td>' . $row['legende'] . '</td></tr>';
}
echo '</tbody></table>';
echo '</div>';
@@ -712,19 +723,14 @@ if ($d > 0) {
$conn = null;
}
//echo '<h3>' . gettext('Find duplicate images in database: ') . '</h3>';
?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>
</html>

View File

@@ -1,10 +1,16 @@
<?php require ("3-protect.php");
include 'localize.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
$chemin = '../photos/img/';
$base = "../db_photo.sqlite3";
$base = 'db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$conn2 = new PDO("sqlite:$base");
$msg = "";
@@ -114,13 +120,23 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sur le sentier: admin">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="../css/sls.css">
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
@@ -141,7 +157,7 @@ if (($req_suppress != "") and ($req_delete == "")) {
try {
$conn3 = new PDO('sqlite:db_photo.sqlite3');
$conn3 = new PDO("sqlite:$base");
$stmt3 = $conn3->prepare($req_suppress);
$stmt3->execute();
@@ -157,17 +173,16 @@ if (($req_suppress != "") and ($req_delete == "")) {
$nRows = 0;
while ($row = $stmt3->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td>';
$lb = data_for_lightbox($row);
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a>' . '</td>';
echo '<td>' . $row['filename'] . '</td><td>' . $row['dateoriginal'] . '</td>';
echo '<td>' . $row['speed'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td>';
echo '<td>' . $row['model'] . '</td>';
echo '<td><input type="text" id="lens" name="lens[]" value="' . $row['lens'] . '" size=""></td>';
echo '<td>' . $row['focal'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td>';
echo '<td>' . $row['flash'] . '</td><td>' . $row['software'] . '</td>';
//echo '<td><input type="text" id="keywords" name="keywords[]" value="' . $row['keywords'] . '" size=""></td>';
echo "<td><input type='text' id='keywords' name='keywords[]' value='" . $row['keywords'] . "' size=''></td>";
echo '<td><input type="text" id="title" name="title[]" value="' . $row['title'] . '" size=""></td>';
echo '<td><input type="text" id="creator" name="creator[]" value="' . $row['creator'] . '" size=""></td>';
@@ -211,12 +226,68 @@ if ($req_delete != "") {
}
?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<script>
$(document).ready(function() {
var $obj = lc_lightbox('td a', {
img_zoom : true, // whether to enable zooming system
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
slideshow : true, // whether to enable slideshow
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
fading_time : 50, // durée de l'animation de fondu des éléments
animation_time : 100,
slideshow_time : 4000, // durée de l'intervalle du diaporama
autoplay : false, // autoplay slideshow - bool
counter : false, // s'il faut afficher le compteur d'éléments
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
max_width : '95%', // largeur maximale de la lightbox
max_height : '95%', // hauteur maximale de la lightbox
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
ol_color : '#111', // background color of the overlay
ol_pattern : false, // overlay patterns - insert the pattern name or false
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_oc)
skin : 'minimal', // minimal | light | dark
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
shox_title : true, // s'il faut afficher les titres
show_descr : true, // s'il faut afficher les descriptions
show_author : true, // s'il faut afficher les auteurs
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
fullscreen : true, // Autoriser ou non le mode plein écran
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
download : true, // whether to show element's file download button
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
});
});
</script>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>

206
admin/edit_bdd.php Normal file
View File

@@ -0,0 +1,206 @@
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include '../functions.php';
$chemin = '../photos/img/';
$base = '../db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
$req_edit = "";
if (isset($_SESSION["user"])) {
if ((isset($_POST["edit"])) && ($_POST["edit"] == "edit")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = '" . $value . "' OR ";
$rr .= $r;
}
$req = substr($rr, 0, -4);
$req_edit = "SELECT * FROM photos WHERE " . $req . " ORDER BY id";
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "admin.php?message=" . urlencode(gettext("Please log in !"));
header("location: $url");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="../css/sls.css" />
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<?php
//debug_to_console($_GET);
//debug_to_console($req_edit);
//$base = '../db_photo.sqlite3';
echo '<h1>' . gettext('Edit database') . ': ' . $base . '</h1><br />';
echo '<h3>' . $msg . '</h3>';
try {
$conn = new PDO("sqlite:$base");
$stmt = $conn->prepare($req_edit);
$stmt->execute();
?>
<?php
echo '<form id="editImage" name="editImage" action="modify_bdd.php" method="post" class="myForm" >';
echo '<table class="styled-table">';
echo '<thead>';
echo '<th>' . gettext('Id') . '</th><th>' . gettext('Thumb') . '</th><th>' . gettext('Filename') . '</th><th>' . gettext('Date') . ' </th><th>' . gettext('Speed') . '</th><th>' . gettext('Iso') . '</th><th>' . gettext('Aperture') . '</th><th>' . gettext('Expo. correct') . '</th>';
echo '<th>' . gettext('Model') . '</th><th>' . gettext('Lens') . '</th><th>' . gettext('Focal') . '</th><th>' . gettext('Metering') . '</th><th>' . gettext('Program') . '</th><th>' . gettext('Wb') . '</th>';
echo '<th>' . gettext('Flash') . '</th><th>' . gettext('Software') . '</th><th>' . gettext('Keywords') . '</th><th>' . gettext('Title') . '</th><th>' . gettext('Creator') . '</th><th>' . gettext('City') . '</th><th>' . gettext('Department') . '</th><th>' . gettext('Code') . '</th><th>' . gettext('Country') . '</th><th>' . gettext('Copyright') . '</th><th>' . gettext('Legende') . '</th>';
echo '</thead>';
echo '<tbody>';
$nRows = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$lb = data_for_lightbox($row);
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a>' . '</td>';
echo '<td>' . $row['filename'] . '</td><td>' . $row['dateoriginal'] . '</td>';
echo '<td>' . $row['speed'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td>';
echo '<td>' . $row['model'] . '</td>';
echo '<td><input type="text" id="lens" name="lens[]" value="' . $row['lens'] . '" size=""></td>';
echo '<td>' . $row['focal'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td>';
echo '<td>' . $row['flash'] . '</td><td>' . $row['software'] . '</td>';
echo "<td><input type='text' id='keywords' name='keywords[]' value='" . $row['keywords'] . "' size=''></td>";
echo '<td><input type="text" id="title" name="title[]" value="' . $row['title'] . '" size=""></td>';
echo '<td><input type="text" id="creator" name="creator[]" value="' . $row['creator'] . '" size=""></td>';
echo '<td><input type="text" id="city" name="city[]" value="' . $row['city'] . '" size=""></td>';
echo '<td><input type="text" id="department" name="department[]" value="' . $row['department'] . '" size=""></td>';
echo '<td><input type="text" id="code" name="code[]" value="' . $row['code'] . '" size=""></td>';
echo '<td><input type="text" id="country" name="country[]" value="' . $row['country'] . '" size=""></td>';
echo '<td><input type="text" id="copyright" name="copyright[]" value="' . $row['copyright'] . '" size=""></td>';
echo '<td><input type="text" id="legende" name="legende[]" value="' . $row['legende'] . '" size=""></td></tr>';
echo '<input type="hidden" id="id" name="id[]" value="' . $row['id'] . '">';
$nRows++;
}
echo '</tbody></table>';
echo '<button type="submit" name="update" value="update" class="myButton all">' . gettext('Update') . '</button>';
echo '</form>';
$conn = null;
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
<script>
$(document).ready(function() {
var $obj = lc_lightbox('td a', {
img_zoom : true, // whether to enable zooming system
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
slideshow : true, // whether to enable slideshow
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
fading_time : 50, // durée de l'animation de fondu des éléments
animation_time : 100,
slideshow_time : 4000, // durée de l'intervalle du diaporama
autoplay : false, // autoplay slideshow - bool
counter : false, // s'il faut afficher le compteur d'éléments
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
max_width : '95%', // largeur maximale de la lightbox
max_height : '95%', // hauteur maximale de la lightbox
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
ol_color : '#111', // background color of the overlay
ol_pattern : false, // overlay patterns - insert the pattern name or false
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_oc)
skin : 'minimal', // minimal | light | dark
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
shox_title : true, // s'il faut afficher les titres
show_descr : true, // s'il faut afficher les descriptions
show_author : true, // s'il faut afficher les auteurs
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
fullscreen : true, // Autoriser ou non le mode plein écran
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
download : true, // whether to show element's file download button
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
});
});
</script>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='../lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>
</html>

View File

@@ -1,8 +1,12 @@
<?php require ("3-protect.php");
include 'localize.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
?>
<!DOCTYPE html>
<html lang="en">
@@ -13,10 +17,10 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo gettext('Insert photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="../css/sls.css" />
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css' />
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
@@ -24,8 +28,11 @@
<body>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<?php
$base = 'db_photo.sqlite3';
$base = '../db_photo.sqlite3';
$chemin = '../photos/img/';
echo '<h1>' . gettext("Insert images in " . $base . " database.") . '</h1><br />';
@@ -38,16 +45,17 @@ if (file_exists($base)) {
$th_w = 300;
$th_h = 300;
$dir = (new AdvancedFilesystemIterator('photos/img/'))->match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP|avif|AVIF$/');
//$dir = (new AdvancedFilesystemIterator('../photos/img/'))->match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP|avif|AVIF$/');
$dir = (new AdvancedFilesystemIterator($chemin))->match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP|avif|AVIF$/');
echo '<h3>' . count($dir) . gettext(' images found in folder') . ' <i><a href="photos/img/">photos/img/</a></i> ...</h3>';
echo '<h3>' . count($dir) . gettext(' images found in folder') . ' <i><a href="' . $chemin . '">photos/img/</a></i> ...</h3>';
echo '<h3>' . gettext("Creation of the database") . ' <i>' . $base . '</i> ' . gettext("and the table") . ' <i>photo</i> (' . gettext("if necessary") . ')...</h3>';
try {
// Création de la base et de la table photos
$conn = new PDO("sqlite:db_photo.sqlite3");
$conn = new PDO("sqlite:$base");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = "CREATE TABLE IF NOT EXISTS photos (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
@@ -94,19 +102,17 @@ try {
echo $e->getMessage();
}
echo '<h3>' . gettext('Read image files in the folder') . ' <i><a href="photos/img/">photos/img/</a></i>...</h3>';
echo '<h3>' . gettext('Read image files in the folder') . ' <i><a href="' . $chemin . '">photos/img/</a></i>...</h3>';
$i = 1;
$photos = array();
foreach($dir as $file){
/*
$file->getFilename()
pathName()
*/
$file = $file->getpathName();
$x = in_bdd($file);
$file = $file->getpathName();
//$file = $file->getFilename();
$x = in_bdd($file);
/*
if ($i > 5) {
break;
@@ -386,7 +392,7 @@ foreach($dir as $file){
$photos[$i] = array(
'filename' => $file,
'filename' => basename($file),
'filesize' => $fsize,
'dateoriginal' => $da,
@@ -524,7 +530,12 @@ foreach($dir as $file){
$z = count($photos);
if ($z == 0) {
echo '<h3>' . gettext('No new image files to add') . '...</h3>';
echo '<p class="navPage"><a href="index.php" title="' . gettext("Home") . '">' . gettext("Home") . '</a> | <a href="maps.php" title="' . gettext("Maps") .'">' . gettext("Maps") . '</a> | <a href="photo-du-mois.php" title="' . gettext("Picture of the month") . '">' . gettext("Picture of the month") . '</a></p>';
echo '<p class="navPage"><a href="../index.php" title="' . gettext("Home") . '">' . gettext("Home") . '</a>
| <a href="../photo-du-mois.php" title="' . gettext("Picture of the month") . '">' . gettext("Picture of the month") . '</a>
| <a href="../maps.php" title="' . gettext("Maps") .'">' . gettext("Maps") . '</a>
| <a href="admin.php" title="' . gettext("Admin page") . '">' . gettext("Admin page") . '</a>
| ' . $logout . '</p>';
die();
}
@@ -540,11 +551,12 @@ $avant = $resultat['MAX(id)'];
$nb_avant = (isset($avant)) ? $avant : 0;
echo '<h3>' . gettext('Creation of thumbnails') . ' ('. $th_w . 'px x ' . $th_h . 'px) ' . gettext('in the folder') . ' <i><a href="photos/img/">photos/thumb/</a></i>.</h3>';
echo '<h3>' . gettext('Creation of thumbnails') . ' ('. $th_w . 'px x ' . $th_h . 'px) ' . gettext('in the folder') . ' <i><a href="' . $chemin . '">photos/thumb/</a></i>.</h3>';
$b = ($z > 1) ? gettext('new images') : gettext('new image');
echo '<h3>' . gettext('Insertion of ') . $z . ' ' . $b . gettext(' in database') . '...</h3>';
$short = basename($file);
// Insertion des photos dans la base
// Création des vignettes
try {
@@ -636,7 +648,11 @@ try {
$titre = $item['title']; // ***
$legende = $item['legende']; // ***
create_thumb($th_w, $th_h, $file);
# Create Thumbnails (functions.php line 203)
$big = $chemin . $file;
create_thumb($th_w, $th_h, $big);
$stmt->execute();
}
@@ -707,12 +723,13 @@ try {
});
</script>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>

View File

@@ -1,14 +1,17 @@
<?php require ("3-protect.php");
include 'localize.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
$base = 'db_photo.sqlite3';
$base = '../db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
$conn = new PDO("sqlite:db_photo.sqlite3");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//echo "<a href='close.php'> close session </a><br />";
@@ -156,10 +159,10 @@ else {
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php gettext('View photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="../css/sls.css" />
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
@@ -184,7 +187,7 @@ else {
$req_edit = "SELECT * FROM photos WHERE " . $req . " ORDER BY id";
try {
$conn = new PDO('sqlite:db_photo.sqlite3');
$conn = new PDO("sqlite:../$base");
$stmt = $conn->prepare($req_edit);
$stmt->execute();
@@ -199,10 +202,12 @@ else {
$nRows = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
//$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
//$full = host() . $row['filename'];
$lb = data_for_lightbox($row);
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td>';
//echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td>';
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $lb['big'] . '"><img src="' . $lb['big'] . '" /></a>' . '</td>';
echo '<td>' . $row['filename'] . '</td><td>' . $row['dateoriginal'] . '</td>';
echo '<td>' . $row['speed'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td>';
echo '<td>' . $row['model'] . '</td>';
@@ -236,13 +241,14 @@ else {
}
?>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>

View File

@@ -1,9 +1,15 @@
<?php
require ("3-protect.php");
include 'localize.php';
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
$chemin = '../photos/img/';
$base = '../db_photo.sqlite3';
if (isset($_SERVER['HTTP_REFERER'])){
$id = $_GET['id'];
@@ -22,26 +28,34 @@ if (isset($_SERVER['HTTP_REFERER'])){
$software = $_GET['software'];
$column = $_GET['column'];
$order = $_GET['order'];
echo $filename;
/*
class MyDB extends SQLite3 {
function __construct() {
$this->open('db_photo.sqlite3');
$this->open('../db_photo.sqlite3');
//$this->open($base);
}
}
$db = new MyDB();
*/
$db = new SQLite3($base);
if(!$db){
echo $db->lastErrorMsg();
} else {
$ret = $db->query("SELECT * FROM photos WHERE id LIKE '$id%' AND filename LIKE '%$filename%' AND dateoriginal LIKE '%$dateoriginal%' AND speed LIKE '$speed%' AND iso LIKE '$iso%' AND aperture LIKE '$aperture%' AND correctexpo LIKE '$correctexpo%' AND model LIKE '%$model%' AND lens LIKE '%$lens%' AND focal LIKE '%$focal%' AND metering LIKE '%$metering%' AND program LIKE '%$program%' AND wb LIKE '%$wb%' AND software LIKE '%$software%' ORDER BY $column $order");
while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
//$thumbnail = host() . str_replace("img", "thumb", $chemin) . $row['filename'];
//$full = host() . $chemin . $row['filename'];
$lb = data_for_lightbox($row);
echo "<tr>";
echo (isset($_SESSION["user"])) ? '<td>' . '<input type="checkbox" id="edit" name="coche[]" value="' . $row['id'] . '" >' . '</td>' : '';
echo "<td class='priority-1 center'>".$row['id']."</td>";
echo "<td class='priority-1'>" . "<a href='" . $full . "' title='" . htmlspecialchars($lb['title']) . "' data-lcl-txt='" . htmlspecialchars($lb['description']) . "' data-lcl-author='" . htmlspecialchars($lb['creator']) . "' /><img src='" . $thumbnail . "' alt='" . htmlspecialchars($lb['title']) . "' /></a></td>";
//echo "<td class='priority-1'>" . "<a href='" . $full . "' title='" . htmlspecialchars($lb['title']) . "' data-lcl-txt='" . htmlspecialchars($lb['description']) . "' data-lcl-author='" . htmlspecialchars($lb['creator']) . "' /><img src='" . $thumbnail . "' alt='" . htmlspecialchars($lb['title']) . "'></a></td>";
echo "<td class='priority-1'>" . "<a href='" . $lb['big'] . "' title='" . htmlspecialchars($lb['title']) . "' data-lcl-txt='" . htmlspecialchars($lb['description']) . "' data-lcl-author='" . htmlspecialchars($lb['creator']) . "' /><img src='" . $lb['thumb'] . "' alt='" . htmlspecialchars($lb['title']) . "'></a></td>";
echo "<td class='priority-2'>".$row['filename']."</td>";
echo "<td class='priority-8'>".$row['dateoriginal']."</td>";
echo "<td class='priority-3'>".$row['speed']."</td>";

View File

@@ -1,8 +1,12 @@
<?php //require ("3-protect.php");
include 'functions.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include '../functions.php';
?>
<!DOCTYPE html>
<html lang="en">
@@ -13,10 +17,10 @@ localize($domain);
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="../css/sls.css" />
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
@@ -29,7 +33,7 @@ localize($domain);
<?php
$base = 'db_photo.sqlite3';
$base = '../db_photo.sqlite3';
_pr($_POST);
/*
@@ -50,7 +54,7 @@ if (! empty($_POST)){
$req = "SELECT * FROM photos WHERE " . $key . " = '" . $val . "'";
echo $req;
$conn2 = new PDO("sqlite:db_photo.sqlite3");
$conn2 = new PDO("sqlite:$base");
$conn2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$limit = 13;
@@ -74,7 +78,7 @@ _pr($_POST);
echo '<a href="requests.php">requests</a>';
$conn = new PDO("sqlite:db_photo.sqlite3");
$conn = new PDO("sqlite:$base");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$request = array(
@@ -227,12 +231,12 @@ https://www.csscodelab.com/pure-css-custom-select-box-dropdown-styling/
</form>
</div>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>

View File

@@ -1,50 +1,22 @@
<?php require ("3-protect.php");
include 'localize.php';
<?php
require ("3-protect.php");
//session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
$base = 'db_photo.sqlite3';
$chemin = '../photos/img/';
$base = '../db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
if(!empty($_GET['message'])) {
$msg = "<h3 class='redstyle'>" . $_GET['message'] . "</h3>";
}
/*
// Suppression d'images
if (isset($_SESSION["user"])) {
if ((isset($_POST["suppress"])) && ($_POST["suppress"] == "suppress")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = " . $value . " OR ";
$rr .= $r;
}
$req_delete = substr($rr, 0, strlen($rr)-4);
try {
$req = "DELETE FROM Photos WHERE (" . $req_delete . ")";
$stmt = $conn->prepare($req);
$stmt->execute();
$nb = $stmt->rowCount();
}
catch(PDOException $e) {
echo $e->getMessage();
}
$msg = (($nb > 0) ? "<h3 class='greenstyle'>" . $nb . gettext(' photos successfully deleted !') . "</h3>" : "");
$request_delete = $req;
}
else {
$msg = "<h3 class='redstyle'>" . gettext('Empty request !') . "</h3>" ;
}
}
}
*/
?>
<!DOCTYPE html>
<html lang="en">
@@ -52,13 +24,23 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sur le sentier: admin">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="../css/sls.css">
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
@@ -108,7 +90,7 @@ function showUser(column) {
<body onload="showUser('')">
<?php
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br />';
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br>';
echo $msg;
?>
@@ -177,7 +159,7 @@ function showUser(column) {
}
?>
<script type='text/javascript'>
<script>
$(document).ready(function() {
@@ -231,14 +213,14 @@ function showUser(column) {
</script>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a></p>' : ''; ?>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>
</html>

View File

@@ -1,57 +1,28 @@
<?php require ("3-protect.php");
<?php
require ("3-protect.php");
//session_start();
include 'localize.php';
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
*/
include '../functions.php';
$base = 'db_photo.sqlite3';
$chemin = '../photos/img/';
$base = '../db_photo.sqlite3';
$perpage = 20;
$conn = new PDO("sqlite:db_photo.sqlite3");
$conn = new PDO("sqlite:$base");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if (!isset($_GET['page'])) $page = 1;
else $page = intval($_GET['page']);
/*
// Suppression d'images
if (isset($_SESSION["user"])) {
if ((isset($_POST["suppress"])) && ($_POST["suppress"] == "suppress")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = " . $value . " OR ";
$rr .= $r;
}
$req_delete = substr($rr, 0, strlen($rr)-4);
try {
$req = "DELETE FROM Photos WHERE (" . $req_delete . ")";
$stmt = $conn->prepare($req);
$stmt->execute();
$nb = $stmt->rowCount();
}
catch(PDOException $e) {
echo $e->getMessage();
}
$msg = (($nb > 0) ? "<h3 class='greenstyle'>" . $nb . gettext(' photos successfully deleted !') . "</h3>" : "");
$request_delete = $req;
}
else {
$msg = "<h3 class='redstyle'>" . gettext('Empty request !') . "</h3>" ;
}
}
}
*/
$gps = (isset($_SESSION['query']['gps'])) ? $_SESSION['query']['gps'] : "off";
$dir = (new AdvancedFilesystemIterator('photos/img/'))->match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP$/');
$dir = (new AdvancedFilesystemIterator($chemin))->match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP$/');
$request = array(
@@ -95,13 +66,23 @@ foreach ($request as $key => $val){
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sur le sentier: admin">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="../css/sls.css">
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
@@ -110,7 +91,7 @@ foreach ($request as $key => $val){
<body>
<?php
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br />';
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br>';
// Affichage des photos
@@ -180,7 +161,7 @@ try {
if (empty($_POST)) {
echo '<h3 class="greenstyle">' . count($dir) . gettext(' images found in folder') . ' <i><a href="photos/img/">photos/img/</a></i> ...</h3>';
echo '<h3 class="greenstyle">' . count($dir) . gettext(' images found in folder') . ' <i><a href="' . $chemin . '">photos/img/</a></i> ...</h3>';
// Display request !!
echo '<pre><code>' . $query2 . '</code></pre>';
}
@@ -252,9 +233,9 @@ try {
</select>
<span class="operateur"><?php echo gettext('Operator:'); ?></span>
<input type="radio" id="operator1" name="operator" value="AND" checked>
<label for="ope1"><?php echo gettext('AND'); ?></label>
<label for="operator1"><?php echo gettext('AND'); ?></label>
<input type="radio" id="operator2" name="operator" value="OR">
<label for="ope1"><?php echo gettext('OR'); ?></label>
<label for="operator2"><?php echo gettext('OR'); ?></label>
<button type="submit" class="myButton">OK</button>
@@ -301,19 +282,18 @@ try {
echo '<table class="styled-table">';
echo '<thead>';
echo ((isset($_SESSION["user"])) ? '<th>' . gettext('Select') . '</th>' : '') . '<th>' . gettext('Id') . '</th><th>' . gettext('Thumb') . '</th><th>' . gettext('Filename') . ' (' . gettext('Size') . ')</th><th><a class="sort" href="view_bdd.php?column=date&order=' . $asc_or_desc . '">' . gettext('Date') . ' <i class="fas fa-sort' . ($column == 'date' ? '-' . $up_or_down : '') . '"></i></a></th><th><a href="view_bdd.php?column=lens&order=' . $asc_or_desc . '">' . gettext('Lens') . ' <i class="fas fa-sort' . ($column == 'lens' ? '-' . $up_or_down : '') . '"></i></a></th><th>' . gettext('Speed') . '</th><th>' . gettext('Aperture') . '</th><th>' . gettext('Exposure corr.') . '</th><th><a href="view_bdd.php?column=iso&order=' . $asc_or_desc . '">' . gettext('Iso') . ' <i class="fas fa-sort' . ($column == 'iso' ? '-' . $up_or_down : '') . '"></i></a></th><th>' . gettext('Width') . '</th><th>' . gettext('Height') . '</th>';
echo '<tr>' . ((isset($_SESSION["user"])) ? '<th>' . gettext('Select') . '</th>' : '') . '<th>' . gettext('Id') . '</th><th>' . gettext('Thumb') . '</th><th>' . gettext('Filename') . ' (' . gettext('Size') . ')</th><th><a class="sort" href="view_bdd.php?column=date&order=' . $asc_or_desc . '">' . gettext('Date') . ' <i class="fas fa-sort' . ($column == 'date' ? '-' . $up_or_down : '') . '"></i></a></th><th><a href="view_bdd.php?column=lens&order=' . $asc_or_desc . '">' . gettext('Lens') . ' <i class="fas fa-sort' . ($column == 'lens' ? '-' . $up_or_down : '') . '"></i></a></th><th>' . gettext('Speed') . '</th><th>' . gettext('Aperture') . '</th><th>' . gettext('Exposure corr.') . '</th><th><a href="view_bdd.php?column=iso&order=' . $asc_or_desc . '">' . gettext('Iso') . ' <i class="fas fa-sort' . ($column == 'iso' ? '-' . $up_or_down : '') . '"></i></a></th><th>' . gettext('Width') . '</th><th>' . gettext('Height') . '</th>';
echo '<th><a href="view_bdd.php?column=model&order=' . $asc_or_desc . '">' . gettext('Model') . ' <i class="fas fa-sort' . ($column == 'Model' ? '-' . $up_or_down : '') . '"></i></a></th><th><a href="view_bdd.php?column=lat&order=' . $asc_or_desc . '">' . gettext('Latitude') . ' <i class="fas fa-sort' . ($column == 'lat' ? '-' . $up_or_down : '') . '"></i></a></th><th>' . gettext('Longitude') . '</th><th>' . gettext('Alttitude') . '</th><th>' . gettext('Legende') . '</th><th>' . gettext('Copyright') . '</th><th>' . gettext('Title') . '</th>';
echo '<th>' . gettext('Creator') . '</th><th>' . gettext('Keywords') . '</th><th>' . gettext('Metering') . '</th><th>' . gettext('Flash') . '</th><th>' . gettext('Focal') . '</th><th>' . gettext('Wb') . '</th><th>' . gettext('Program') . '</th>';
echo '<th>' . gettext('Creator') . '</th><th>' . gettext('Keywords') . '</th><th>' . gettext('Metering') . '</th><th>' . gettext('Flash') . '</th><th>' . gettext('Focal') . '</th><th>' . gettext('Wb') . '</th><th>' . gettext('Program') . '</th></tr>';
echo '</thead>';
echo '<tbody>';
$nRows = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
$lb = data_for_lightbox($row);
echo '<tr>' . ((isset($_SESSION["user"])) ? '<td>' . '<input type="checkbox" id="edit" name="coche[]" value="' . $row['id'] . '" >' . '</td>' : '') . '<td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="'.$thumbnail.'" alt="' . htmlspecialchars($lb['title']) . '" /></a>' . '</td><td>' . $row['filename'] . '<br />(' . $row['filesize'] . ')</td><td>' . $row['dateoriginal'] . '</td><td>' . $row['lens'] . '</td><td>' . $row['speed'] . '</td><td>' . $row['aperture'] . '</td> <td>' . $row['correctexpo'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['width'] . '</td><td>' . $row['height'] . '</td><td>' . $row['model'] . '</td><td>' . $row['lat'] . '</td><td>' . $row['long'] . '</td><td>' . $row['alt'] . '</td><td>' . $row['legende'] . '</td><td>' . $row['copyright'] . '</td><td>' . $row['title'] . '</td><td>' . $row['creator'] . '</td><td>' . $row['keywords'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['flash'] . '</td><td>' . $row['focal'] . '</td><td>' . $row['wb'] . '</td><td>' . $row['program'] . '</td></tr>';
echo '<tr>' . ((isset($_SESSION["user"])) ? '<td>' . '<input type="checkbox" id="edit" name="coche[]" value="' . $row['id'] . '" >' . '</td>' : '') . '<td>' . $row['id'] . '</td><td>' . '<a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="' . $lb['thumb']. '" alt="' . htmlspecialchars($lb['title']) . '"></a>' . '</td><td>' . $row['filename'] . '<br>(' . $row['filesize'] . ')</td><td>' . $row['dateoriginal'] . '</td><td>' . $row['lens'] . '</td><td>' . $row['speed'] . '</td><td>' . $row['aperture'] . '</td> <td>' . $row['correctexpo'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['width'] . '</td><td>' . $row['height'] . '</td><td>' . $row['model'] . '</td><td>' . $row['lat'] . '</td><td>' . $row['long'] . '</td><td>' . $row['alt'] . '</td><td>' . $row['legende'] . '</td><td>' . $row['copyright'] . '</td><td>' . $row['title'] . '</td><td>' . $row['creator'] . '</td><td>' . $row['keywords'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['flash'] . '</td><td>' . $row['focal'] . '</td><td>' . $row['wb'] . '</td><td>' . $row['program'] . '</td></tr>';
$nRows++;
}
@@ -334,7 +314,7 @@ try {
}
?>
<script type='text/javascript'>
<script>
$(document).ready(function() {
@@ -429,14 +409,14 @@ try {
}
?>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a></p>' : ''; ?>
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='../lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>

View File

@@ -538,7 +538,7 @@
bottom: -1px;
z-index: 5;
border-radius: 3px;
opcity: 0;
opacity: 0;
background: #6f6f6f;
-webkit-transition: all .2s ease;

View File

@@ -9,7 +9,7 @@ h1 {
text-align: center;
}
h2, h3, h4 {
h2, h3, h4, h5 {
font-family: sans-serif;
}
h3 {
@@ -22,6 +22,11 @@ h4 {
text-align: center;
/*margin-bottom: 2em;*/
}
h5 {
font-weight: 200;
text-align: center;
margin-bottom: 0;
}
p {
text-align: center;
@@ -515,6 +520,9 @@ h3.greenstyle {
color: red;
text-align: left;
}
.redtext {
color: red;
}
input[type="text"], textarea {

View File

@@ -1,145 +0,0 @@
<?php require ("3-protect.php");
include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
$base = 'db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$msg = "";
$req_edit = "";
if (isset($_SESSION["user"])) {
if ((isset($_POST["edit"])) && ($_POST["edit"] == "edit")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = '" . $value . "' OR ";
$rr .= $r;
}
$req = substr($rr, 0, -4);
$req_edit = "SELECT * FROM photos WHERE " . $req . " ORDER BY id";
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "admin.php?message=" . urlencode(gettext("Please log in !"));
header("location: $url");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<?php
debug_to_console($_GET);
debug_to_console($req_edit);
$base = 'db_photo.sqlite3';
echo '<h1>' . gettext('Edit database') . ': ' . $base . '</h1><br />';
echo '<h3>' . $msg . '</h3>';
try {
$conn = new PDO('sqlite:db_photo.sqlite3');
$stmt = $conn->prepare($req_edit);
$stmt->execute();
?>
<?php
echo '<form id="editImage" name="editImage" action="modify_bdd.php" method="post" class="myForm" >';
echo '<table class="styled-table">';
echo '<thead>';
echo '<th>' . gettext('Id') . '</th><th>' . gettext('Thumb') . '</th><th>' . gettext('Filename') . '</th><th>' . gettext('Date') . ' </th><th>' . gettext('Speed') . '</th><th>' . gettext('Iso') . '</th><th>' . gettext('Aperture') . '</th><th>' . gettext('Expo. correct') . '</th>';
echo '<th>' . gettext('Model') . '</th><th>' . gettext('Lens') . '</th><th>' . gettext('Focal') . '</th><th>' . gettext('Metering') . '</th><th>' . gettext('Program') . '</th><th>' . gettext('Wb') . '</th>';
echo '<th>' . gettext('Flash') . '</th><th>' . gettext('Software') . '</th><th>' . gettext('Keywords') . '</th><th>' . gettext('Title') . '</th><th>' . gettext('Creator') . '</th><th>' . gettext('City') . '</th><th>' . gettext('Department') . '</th><th>' . gettext('Code') . '</th><th>' . gettext('Country') . '</th><th>' . gettext('Copyright') . '</th><th>' . gettext('Legende') . '</th>';
echo '</thead>';
echo '<tbody>';
$nRows = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td>';
echo '<td>' . $row['filename'] . '</td><td>' . $row['dateoriginal'] . '</td>';
echo '<td>' . $row['speed'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td>';
echo '<td>' . $row['model'] . '</td>';
echo '<td><input type="text" id="lens" name="lens[]" value="' . $row['lens'] . '" size=""></td>';
echo '<td>' . $row['focal'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td>';
echo '<td>' . $row['flash'] . '</td><td>' . $row['software'] . '</td>';
//echo '<td><input type="text" id="keywords" name="keywords[]" value="' . $row['keywords'] . '" size=""></td>';
echo "<td><input type='text' id='keywords' name='keywords[]' value='" . $row['keywords'] . "' size=''></td>";
echo '<td><input type="text" id="title" name="title[]" value="' . $row['title'] . '" size=""></td>';
echo '<td><input type="text" id="creator" name="creator[]" value="' . $row['creator'] . '" size=""></td>';
echo '<td><input type="text" id="city" name="city[]" value="' . $row['city'] . '" size=""></td>';
echo '<td><input type="text" id="department" name="department[]" value="' . $row['department'] . '" size=""></td>';
echo '<td><input type="text" id="code" name="code[]" value="' . $row['code'] . '" size=""></td>';
echo '<td><input type="text" id="country" name="country[]" value="' . $row['country'] . '" size=""></td>';
echo '<td><input type="text" id="copyright" name="copyright[]" value="' . $row['copyright'] . '" size=""></td>';
echo '<td><input type="text" id="legende" name="legende[]" value="' . $row['legende'] . '" size=""></td></tr>';
echo '<input type="hidden" id="id" name="id[]" value="' . $row['id'] . '">';
$nRows++;
}
echo '</tbody></table>';
echo '<button type="submit" name="update" value="update" class="myButton all">' . gettext('Update') . '</button>';
echo '</form>';
$conn = null;
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>
</html>

View File

@@ -201,12 +201,49 @@ function get_gps($exif) {
function create_thumb($thumb_w, $thumb_h, $image) {
global $chemin;
list($origin_w, $origin_h) = getimagesize($image);
$origin_ratio = round($origin_w / $origin_h, 1);
$outFile = str_replace("photos/img", "photos/thumb", $image);
$outFile = str_replace("img", "thumb", $chemin) . basename($image);
$new_w = 300;
$new_h = 200;
//$f = $chemin . $image;
$thumb = new Imagick($image);
if ($origin_w != null && $origin_h != null) {
if ($origin_w > $origin_h) {
$resize_w = $origin_w * $new_h / $origin_h;
$resize_h = $new_h;
//$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_LANCZOS, 0.9);
$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_CATROM, 0.9);
}
else {
$resize_w = $new_w;
$resize_h = $origin_h * $new_w / $origin_w; // 450
$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_CATROM, 0.9); // 300 x 300
$thumb->cropImage($new_w, $new_h, ($resize_w - $new_w) / 2, ($resize_h - $new_h) / 2); // (w, h, x ,y) (xy coin haut gauche) (300, 200, 0, 125)
}
//$image->sharpenimage($radius, $sigma, $channel); // 5, 1
$thumb->sharpenimage(5, 1);
$thumb->setImageCompression(Imagick::COMPRESSION_ZIP);
// Set compression level (1 lowest quality, 100 highest quality)
$thumb->setImageCompressionQuality(75);
// Strip out unneeded meta data
$thumb->stripImage();
$thumb->writeImage($outFile);
$thumb->destroy();
/*
if ($thumb_w / $thumb_h > $origin_ratio) {
$thumb_w = $thumb_h * $origin_ratio;
} else {
@@ -219,17 +256,22 @@ if ($origin_w != null && $origin_h != null) {
$image->writeImage($outFile);
$image->destroy();
}
*/
}
}
/* Fonction in_bdd(): test si la photo est déjà dans la bdd
insert_bdd.php
*/
function in_bdd($image) {
global $base;
try {
$conn3 = new PDO('sqlite:db_photo.sqlite3');
$conn3 = new PDO("sqlite:$base");
#$query3 = "SELECT filename FROM photos WHERE instr(filename, '". $file . "') > 0;";
$query3 = "SELECT filename FROM photos WHERE filename = :filename";
$stmt = $conn3->prepare($query3);
@@ -373,8 +415,11 @@ function conv_date($dateoriginal, $format) {
function data_for_lightbox($data) {
global $chemin;
//$query4 = "INSERT OR IGNORE INTO photos (filename, filesize, dateoriginal, lens, speed, correctexpo, iso, usercomment, comment, model, metering, flash, focal, program, wb, mode, width, height, html, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende);
/*
*/
$filename = $data['filename'];
$title_thumb = pathinfo($filename, PATHINFO_FILENAME);
@@ -399,6 +444,11 @@ function data_for_lightbox($data) {
$longitude = $data['long'];
$altitude = $data['alt'];
$width = $data['width'];
$height = $data['height'];
//echo $width . "-" . $height;
$gps = (!empty($longitude) && !empty($latitude)) ? $latitude . "," . $longitude : "";
//$gps = $longitude . "," . $latitude;
@@ -421,6 +471,7 @@ function data_for_lightbox($data) {
if (!empty($gps)) {
$map = '<a href = "https://maps.google.com/maps?q=' . $gps . '&t=&z=9&ie=UTF8&iwloc=&output=embed" title="' . $title . '" data-lcl-txt="' . $legende . '">' . " \u{30FB} \u{2693} " . '</a>';
$map = htmlspecialchars($map, ENT_QUOTES);
}
else {
$map = '';
@@ -428,8 +479,12 @@ function data_for_lightbox($data) {
$creator = $data['creator'];
$big = host() . $data['filename'];
$thumb = host() . str_replace("photos/img", "photos/thumb", $data['filename']);
$big = host() . $chemin . $data['filename'];
$thumb = host() . str_replace("img", "thumb", $chemin) . $data['filename'];
// origine
//$big = host() . $data['filename'];
//$thumb = host() . str_replace("../photos/img", "../photos/thumb", $data['filename']);
$keywords = str_replace(',', " \u{30FB} ", clean_keywords($data['keywords']));
$copyright = $data['copyright'];
@@ -447,6 +502,7 @@ function data_for_lightbox($data) {
$description .= "<tr><td>" . gettext("Speed") . "</td><td>" . $speed . "</td></tr>";
$description .= "<tr><td>" . gettext("Aperture") . "</td><td>" . $aperture . "</td></tr>";
$description .= "<tr><td>" . gettext("Iso") . "</td><td>" . $iso . "</td></tr>";
$description .= "<tr><td>" . gettext("Model") . "</td><td>". $model . "</td></tr>";
$description .= "<tr><td>" . gettext("Lens") . "</td><td>" . $objectif . "</td></tr>";
$description .= "<tr><td>" . gettext("Focal") . "</td><td>" . $focal . "</td></tr>";
@@ -465,11 +521,14 @@ function data_for_lightbox($data) {
(!empty($city)) && $description .= "<tr><td>" . gettext("City") . "</td><td>" . $city . "</td></tr>";
(!empty($department)) && $description .= "<tr><td>" . gettext("Department") . "</td><td>" . $department . "</td></tr>";
$code = (!empty($code)) ? " (" . $code . ")" : "";
(!empty($country)) && $description .= "<tr><td>" . gettext("Country") . "</td><td>" . $country . $code . "</td></tr>";
(!empty($map)) && $description .= "<tr><td>GPS</td><td>" . $map . "</td></tr>";
((!empty($comment)) || (!empty($usercomment))) && $description .= "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";
(!empty($comment)) && $description .= "<tr><td>" . gettext("Comment") . "</td><td>" . $comment . "</td></tr>";
(!empty($usercomment)) && $description .= "<tr><td>" . gettext("User comment") . "</td><td>" . $usercomment . "</td></tr>";
/**/
$description .= "</table>";
$lightbox = array();
@@ -482,8 +541,16 @@ function data_for_lightbox($data) {
$lightbox['keywords'] = $keywords;
$lightbox['creator'] = $creator;
$lightbox['gps'] = $gps;
$lightbox['lat'] = $latitude;
$lightbox['long'] = $longitude;
$lightbox['description'] = $description;
$lightbox['width'] = $width;
$lightbox['height'] = $height;
//_pr($lightbox);
//$lightbox = array();
/*
Array
(

97
i18n_setup.php Normal file
View File

@@ -0,0 +1,97 @@
<?php
/**
* Verifies if the given $locale is supported in the project
* @param string $locale
* @return bool
*/
function list_locale_server($dir) {
$lange = array();
$iterator = new DirectoryIterator($dir);
foreach ($iterator as $ff) {
if ($ff->isDot() OR $ff->isFile()) { continue; }
if ($ff->isDir()) {
$d = $ff->getFilename();
if (($d != "nocache") AND (strpos($d, "_"))) {
$e = strtok($d, "_");
$lange[] = $d;
$lange[] = $e;
}
}
}
//print_r($lange);
return $lange;
}
function valid($locale) {
//return in_array($locale, ['en_US', 'en', 'fr_FR', 'fr', 'de_DE', 'de', 'es_ES', 'es']);
global $dir_locales;
$l = list_locale_server($dir_locales);
return in_array($locale, $l);
}
/* ------------------------------------*/
/* Settings */
/* ------------------------------------*/
$dir_locales = __DIR__ . '/Locale';
//setting the source/default locale, for informational purposes
$lang = 'en_US';
/*
if (isset($_GET['lang']) && valid($_GET['lang'])) {
// the locale can be changed through the query-string
$lang = $_GET['lang']; //you should sanitize this!
//setcookie('lang', $lang); //it's stored in a cookie so it can be reused
setcookie('lang', $lang, time() + (86400 * 30), "/"); //it's stored in a cookie so it can be reused
*/
if (isset($_POST['lang']) && valid($_POST['lang'])) {
// the locale can be changed through the query-string
$lang = $_POST['lang']; //you should sanitize this!
//setcookie('lang', $lang); //it's stored in a cookie so it can be reused
setcookie('lang', $lang, time() + (86400 * 30), "/"); //it's stored in a cookie so it can be reused
} elseif (isset($_SESSION['language']) && valid($_SESSION['language'])) {
// if the cookie is present instead, let's just keep it
$lang = $_SESSION['language']; //you should sanitize this!
} elseif (isset($_COOKIE['lang']) && valid($_COOKIE['lang'])) {
// if the cookie is present instead, let's just keep it
$lang = $_COOKIE['lang']; //you should sanitize this!
} elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
// default: look for the languages the browser says the user accepts
$langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
array_walk($langs, function (&$lang) { $lang = strtr(strtok($lang, ';'), ['-' => '_']); });
foreach ($langs as $browser_lang) {
if (valid($browser_lang)) {
$lang = $browser_lang;
break;
}
}
}
// here we define the global system locale given the found language
putenv("LANG=$lang");
// this might be useful for date functions (LC_TIME) or money formatting (LC_MONETARY), for instance
setlocale(LC_ALL, $lang);
// this will make Gettext look for ../locales/<lang>/LC_MESSAGES/main.mo
bindtextdomain('sentier', __DIR__ . '/Locale/');
// indicates in what encoding the file should be read
bind_textdomain_codeset('sentier', 'UTF-8');
// if your application has additional domains, as cited before, you should bind them here as well
//bindtextdomain('forum', '../locales');
//bind_textdomain_codeset('forum', 'UTF-8');
// here we indicate the default domain the gettext() calls will respond to
textdomain('sentier');
// this would look for the string in forum.mo instead of main.mo
// echo dgettext('forum', 'Welcome back!');
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

View File

@@ -1,16 +1,25 @@
<?php include 'localize.php';
<?php
session_start();
include 'i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include 'functions.php';
/*
_pr($_REQUEST); // [lang] => es_ES
_pr($_SESSION); // [language] => es_ES
_pr($_POST);
_pr($_GET); // [lang] => es_ES
*/
?>
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sur le sentier: photos prises au cours de mes ballades" />
<meta name="description" content="Sur le sentier: <?php echo gettext('photos taken during my walks'); ?>...">
<title>Sur le sentier...</title>
<meta name="msapplication-TileColor" content="#2b5797">
@@ -22,34 +31,25 @@ include 'functions.php';
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="vegas/js/vegas.min.js"></script>
<script src="js/matomo-sls.js"></script>
<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 -->
<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.min.css">
<link rel="stylesheet" type="text/css" href="vegas/js/vegas-style.css">
<link rel="stylesheet" type="text/css" href="css/sls.css" />
<link rel="stylesheet" type="text/css" href="css/sls.css">
<?php
//Get a list of file paths using the glob function.
$fileList = glob('vegas/img/*.{jpg,jpeg,JPG,JPEG,heic,HEIC,webp,WEBP}', GLOB_BRACE);
$pv_sslport=443;
$pv_serverport=80;
$pv_servername="sur-le-sentier.fr";
$pv_URIprotocol = isset($_SERVER["HTTPS"]) ? (($_SERVER["HTTPS"]==="on" || $_SERVER["HTTPS"]===1 || $_SERVER["SERVER_PORT"]===$pv_sslport) ? "https://" : "http://") : (($_SERVER["SERVER_PORT"]===$pv_sslport) ? "https://" : "http://");
$host = $pv_URIprotocol . $_SERVER['HTTP_HOST'];
$wp = (($_SERVER['SERVER_NAME'] == "sur-le-sentier.fr") ? "blog" : "wordpress");
?>
</head>
<body>
<?php //echo "Session language: " . $_SESSION['language']; ?>
<script>
$("#exemple, body").vegas({
@@ -99,7 +99,7 @@ $("#exemple, body").vegas({
</div>
<div class="icn">
<!--a title="mail" href="mailto:contact.clicclac.info?subject=[Contact] sur-le-sentier.fr"-->
<!--a title="mail" href="mailto:contact.clicclac.info?subject=[Contact] sur-le-sentier.fr"-->host()
<a title="mail" href="/<?php echo $wp; ?>/contact/">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
@@ -109,7 +109,8 @@ $("#exemple, body").vegas({
</div>
<div class="icn">
<a title="rss" href="<?php echo $host . "/" . $wp; ?>/feed/">
<?php //echo $host . "/" . $wp; ?>
<a title="rss" href="<?php host() . "/" . $wp; ?>/feed/">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><path d="M143.6,722.7c-37.1,0-68.7,13-94.7,39c-26,26-39,57.5-39,94.6c0,37.1,13,68.7,39,94.7c26,26,57.5,39,94.7,39s68.7-13,94.6-39c26-26,39-57.5,39-94.7c0-37.1-13-68.7-39-94.6C212.3,735.7,180.7,722.7,143.6,722.7z"/><path d="M451.2,548.7c-52.4-52.9-112.5-95-180.3-126.3c-67.7-31.3-138.7-50-213-56h-3.5c-12.1,0-22,3.9-29.9,11.8c-9.7,8.3-14.6,19.3-14.6,32.7v94c0,11.6,3.8,21.6,11.5,29.9c7.7,8.4,17.3,13,28.9,13.9c106.2,10.2,197.1,53,272.5,128.4c75.4,75.4,118.2,166.2,128.4,272.5c0.9,11.6,5.6,21.2,13.9,28.9c8.4,7.7,18.3,11.5,29.9,11.5h94c13.5,0,24.4-4.9,32.7-14.6c8.8-9.3,12.8-20.4,11.8-33.4c-6-74.2-24.7-145.2-56-212.9C546.2,661.2,504.1,601.1,451.2,548.7z"/><path d="M906.4,594.3c-49.6-111.1-117.8-209.8-204.6-296.1c-86.3-86.8-185-155-296.1-204.6C294.5,43.9,178.2,16.1,56.6,10h-2.1c-12.1,0-22.3,4.2-30.6,12.5c-9.3,8.3-13.9,19-13.9,32v99.5c0,11.6,4.1,21.7,12.2,30.3c8.1,8.6,18,13.1,29.6,13.6c99.8,6,194.5,29.7,284.3,71c89.8,41.3,167.7,95,233.8,161.1C636,496.2,689.7,574.1,731,663.9c41.3,89.8,64.7,184.5,70.3,284.3c0.5,11.6,5,21.5,13.6,29.6c8.6,8.1,18.9,12.2,31,12.2h99.5c13,0,23.6-4.6,32-13.9c9.3-9.3,13.4-20.2,12.5-32.7C983.9,821.8,956,705.4,906.4,594.3z"/></g>
@@ -136,7 +137,7 @@ $("#exemple, body").vegas({
<div class="indexForm">
<form name="langSelect" action="index.php" method="get" >
<form name="langSelect" action="index.php" method="post" >
<select name="lang" id="lang" class="mySelect">
<option value="">Language</option>
<option value="de_DE">German</option>
@@ -150,8 +151,7 @@ $("#exemple, body").vegas({
</div>
<div class="vegas-info">
<!-- close sesssion -->
<!--a href="close.php">close</a--><?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>. &copy; 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>. &copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr
</div>
</body>

100
maps.php
View File

@@ -1,22 +1,39 @@
<?php session_start();
include 'localize.php';
<?php
session_start();
include 'i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include 'functions.php';
$base = 'db_photo.sqlite3';
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sur le sentier: la photos du mois">
<title><?php echo gettext("Maps"); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css">
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css'>
<style>
#map{
width: 100%;
@@ -41,7 +58,7 @@
<?php
try {
$conn4 = new PDO('sqlite:db_photo.sqlite3');
$conn4 = new PDO("sqlite:$base");
$query4 = "SELECT filename, filesize, dateoriginal, lens, speed, correctexpo, iso, usercomment, comment, model, metering, flash, focal, program, wb, mode, width, height, html, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende FROM photos WHERE lat != '' ORDER BY dateoriginal DESC";
$stmt = $conn4->prepare($query4);
@@ -106,7 +123,8 @@
$lb = data_for_lightbox($result[$i]);
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-txt="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-author="' . htmlspecialchars($lb['exif'], ENT_QUOTES) . '"><img src="' . $lb['thumb'] . '" /></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
//$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-txt="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-author="' . htmlspecialchars($lb['exif'], ENT_QUOTES) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
}
$b = substr_replace($b, '', -3, 1);
echo $b;
@@ -157,27 +175,55 @@
<div id="mapCanvas"></div>
<script type='text/javascript'>
<script>
$(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',
img_zoom : true, // whether to enable zooming system
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
slideshow : true, // whether to enable slideshow
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
fading_time : 50, // durée de l'animation de fondu des éléments
animation_time : 100,
slideshow_time : 4000, // durée de l'intervalle du diaporama
autoplay : false, // autoplay slideshow - bool
counter : false, // s'il faut afficher le compteur d'éléments
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
max_width : '95%', // largeur maximale de la lightbox
max_height : '95%', // hauteur maximale de la lightbox
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
ol_color : '#111', // background color of the overlay
ol_pattern : false, // overlay patterns - insert the pattern name or false
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_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,
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
shox_title : true, // s'il faut afficher les titres
show_descr : true, // s'il faut afficher les descriptions
show_author : true, // s'il faut afficher les auteurs
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
fullscreen : true, // Autoriser ou non le mode plein écran
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
download : true, // whether to show element's file download button
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
});
});
@@ -187,8 +233,8 @@
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>

62
maps/api/liste.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
// Headers
/**/
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=UTF-8');
header('Access-Control-Allow-Methods: GET');
header('Access-Control-Max-Age: 3600');
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
if($_SERVER['REQUEST_METHOD'] !== 'GET'){
http_response_code(405);
echo json_encode(['error' => 'Method unauthorized']);
exit;
}
include '../../i18n_setup.php';
$base = '../../db_photo.sqlite3';
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
include '../../functions.php';
try {
$conn4 = new PDO("sqlite:$base");
$query4 = "SELECT filename, filesize, dateoriginal, lens, speed, correctexpo, iso, usercomment, comment, model, metering, flash, focal, program, wb, mode, width, height, html, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende FROM photos WHERE lat != '' ORDER BY dateoriginal DESC";
#$query4 = "SELECT filename, filesize, dateoriginal, lens, speed, correctexpo, iso, model, metering, flash, focal, program, wb, mode, width, height, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende FROM photos WHERE lat != '' ORDER BY dateoriginal DESC";
$stmt = $conn4->prepare($query4);
$stmt->execute();
/*
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
//$rowcount = count($result);
*/
$for_map=array();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$f=array();
$f = data_for_lightbox($row);
//debug_to_console($f['description']);
$for_map[]=$f;
}
$conn4 = null;
}
catch(PDOException $e) {
echo $e->getMessage();
}
//_pr($result);
//_pr($for_map);
/**/
//_pr($for_map['description']);
//debug_to_console($for_map['description']);
//echo json_encode($result);
echo json_encode($for_map);

View File

@@ -0,0 +1,60 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}

View File

@@ -0,0 +1,14 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
maps/css/images/layers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

661
maps/css/leaflet.css Normal file
View File

@@ -0,0 +1,661 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}
.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
svg.leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
white-space: nowrap;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
pointer-events: auto;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
border: none;
text-align: center;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
-ms-zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}
/* Printing */
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}

19
maps/css/styles.css Normal file
View File

@@ -0,0 +1,19 @@
#map{
height: 600px;
}
.popup{
display: flex;
align-items: center;
gap: 10px
}
.popup h2{
text-align: center;
}
.popup img{
display: block;
margin-left: auto;
margin-right: auto;
}

BIN
maps/images/pin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
maps/images/poi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

BIN
maps/images/poi2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

120
maps/index.php Normal file
View File

@@ -0,0 +1,120 @@
<?php
session_start();
include '../i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include '../functions.php';
$base = 'db_photo.sqlite3';
$chemin = '../photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sur le sentier: la photos du mois">
<title><?php echo gettext("Maps"); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<!-- Nous chargeons les fichiers CDN de Leaflet. Le CSS AVANT le JS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css" />
<link rel="stylesheet" href="../css/sls.css">
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css'>
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css'>
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css'>
<!-- Fichiers Javascript -->
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin="" defer></script>
<script type='text/javascript' src='https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js' defer></script>
<script src="js/scripts.js" defer></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
</head>
<body>
<h1><?php echo gettext("Maps"); ?></h1>
<div id="map">
<!-- Ici s'affichera la carte -->
</div>
<script>
$(document).ready(function() {
var $obj = lc_lightbox('.popup a', {
img_zoom : true, // whether to enable zooming system
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
slideshow : true, // whether to enable slideshow
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
fading_time : 50, // durée de l'animation de fondu des éléments
animation_time : 100,
slideshow_time : 4000, // durée de l'intervalle du diaporama
autoplay : false, // autoplay slideshow - bool
counter : false, // s'il faut afficher le compteur d'éléments
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
max_width : '95%', // largeur maximale de la lightbox
max_height : '95%', // hauteur maximale de la lightbox
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
ol_color : '#111', // background color of the overlay
ol_pattern : false, // overlay patterns - insert the pattern name or false
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_oc)
skin : 'minimal', // minimal | light | dark
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
shox_title : true, // s'il faut afficher les titres
show_descr : true, // s'il faut afficher les descriptions
show_author : true, // s'il faut afficher les auteurs
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
fullscreen : true, // Autoriser ou non le mode plein écran
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
download : true, // whether to show element's file download button
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
});
});
</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>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='../lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>
</html>

39
maps/js/Control.FullScreen.css vendored Normal file
View File

@@ -0,0 +1,39 @@
.fullscreen-icon {
background-image: url('icon-fullscreen.svg');
background-size: 26px 52px;
}
.fullscreen-icon.leaflet-fullscreen-on {
background-position: 0 -26px;
}
.leaflet-touch .fullscreen-icon {
background-position: 2px 2px;
}
.leaflet-touch .fullscreen-icon.leaflet-fullscreen-on {
background-position: 2px -24px;
}
/* Safari still needs this vendor-prefix: https://caniuse.com/mdn-css_selectors_fullscreen */
/* stylelint-disable-next-line selector-no-vendor-prefix */
.leaflet-container:-webkit-full-screen {
width: 100% !important;
height: 100% !important;
z-index: 99999;
}
.leaflet-container:fullscreen {
width: 100% !important;
height: 100% !important;
z-index: 99999;
}
.leaflet-pseudo-fullscreen {
position: fixed !important;
width: 100% !important;
height: 100% !important;
top: 0 !important;
left: 0 !important;
z-index: 99999;
}

284
maps/js/Control.FullScreen.js vendored Normal file
View File

@@ -0,0 +1,284 @@
/*
* leaflet.fullscreen
* (c) Bruno B.; MIT License
* Uses fragments from the package 'screenfull'
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// define an AMD module that requires 'leaflet'
// and resolve to an object containing leaflet
define('leafletFullScreen', ['leaflet'], factory);
} else if (typeof module === 'object' && module.exports) {
// define a CommonJS module that requires 'leaflet'
module.exports = factory(require('leaflet'));
} else {
// Assume 'leaflet' are loaded into global variable already
factory(root.L);
}
}(typeof self !== 'undefined'
? self
: this, (leaflet) => {
'use strict';
if (typeof document === 'undefined') {
console.warn('"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM');
return false;
}
const nativeAPI = (() => {
const methodMap = [
// Standard
[
'requestFullscreen',
'exitFullscreen',
'fullscreenElement',
'fullscreenEnabled',
'fullscreenchange',
'fullscreenerror'
],
// New WebKit
[
'webkitRequestFullscreen',
'webkitExitFullscreen',
'webkitFullscreenElement',
'webkitFullscreenEnabled',
'webkitfullscreenchange',
'webkitfullscreenerror'
]
];
const baseList = methodMap[0];
const ret = {};
for (const methodList of methodMap) {
if (methodList[1] in document) {
for (let i = 0; i < methodList.length; i++) {
ret[baseList[i]] = methodList[i];
}
return ret;
}
}
return false;
})();
const eventNameMap = {
change: nativeAPI.fullscreenchange,
error: nativeAPI.fullscreenerror,
};
const fullscreenAPI = {
request(element, options) {
return new Promise((resolve, reject) => {
const onFullScreenEntered = function() {
this.off('change', onFullScreenEntered);
resolve();
}.bind(this);
this.on('change', onFullScreenEntered);
element = element || document.documentElement;
const returnPromise = element[nativeAPI.requestFullscreen](options);
if (returnPromise instanceof Promise) {
returnPromise.then(onFullScreenEntered).catch(reject);
}
});
},
exit() {
return new Promise((resolve, reject) => {
if (!this.isFullscreen) {
resolve();
return;
}
const onFullScreenExit = function() {
this.off('change', onFullScreenExit);
resolve();
}.bind(this);
this.on('change', onFullScreenExit);
const returnPromise = document[nativeAPI.exitFullscreen]();
if (returnPromise instanceof Promise) {
returnPromise.then(onFullScreenExit).catch(reject);
}
});
},
on(event, callback) {
const eventName = eventNameMap[event];
if (eventName) {
document.addEventListener(eventName, callback, false);
}
},
off(event, callback) {
const eventName = eventNameMap[event];
if (eventName) {
document.removeEventListener(eventName, callback, false);
}
},
nativeAPI: nativeAPI
};
Object.defineProperties(fullscreenAPI, {
isFullscreen: {
get() {
return Boolean(document[nativeAPI.fullscreenElement]);
}
},
isEnabled: {
enumerable: true,
get() {
// Coerce to boolean in case of old WebKit
return Boolean(document[nativeAPI.fullscreenEnabled]);
}
}
});
leaflet.Control.FullScreen = leaflet.Control.extend({
options: {
position: 'topleft',
title: 'Full Screen',
titleCancel: 'Exit Full Screen',
forceSeparateButton: false,
forcePseudoFullscreen: false,
fullscreenElement: false
},
_screenfull: fullscreenAPI,
onAdd(map) {
let className = 'leaflet-control-zoom-fullscreen';
let container;
let content = '';
if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
} else {
container = leaflet.DomUtil.create('div', 'leaflet-bar');
}
if (this.options.content) {
content = this.options.content;
} else {
className += ' fullscreen-icon';
}
this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
this._map.fullscreenControl = this;
this._map.on('enterFullscreen exitFullscreen', this._toggleState, this);
return container;
},
onRemove() {
leaflet.DomEvent
.off(this.link, 'click', leaflet.DomEvent.stop)
.off(this.link, 'click', this.toggleFullScreen, this);
if (this._screenfull.isEnabled) {
leaflet.DomEvent
.off(this._container, this._screenfull.nativeAPI.fullscreenchange, leaflet.DomEvent.stop)
.off(this._container, this._screenfull.nativeAPI.fullscreenchange, this._handleFullscreenChange, this);
leaflet.DomEvent
.off(document, this._screenfull.nativeAPI.fullscreenchange, leaflet.DomEvent.stop)
.off(document, this._screenfull.nativeAPI.fullscreenchange, this._handleFullscreenChange, this);
}
},
_createButton(title, className, content, container, fn, context) {
this.link = leaflet.DomUtil.create('a', className, container);
this.link.href = '#';
this.link.title = title;
this.link.innerHTML = content;
this.link.setAttribute('role', 'button');
this.link.setAttribute('aria-label', title);
L.DomEvent.disableClickPropagation(container);
leaflet.DomEvent
.on(this.link, 'click', leaflet.DomEvent.stop)
.on(this.link, 'click', fn, context);
if (this._screenfull.isEnabled) {
leaflet.DomEvent
.on(container, this._screenfull.nativeAPI.fullscreenchange, leaflet.DomEvent.stop)
.on(container, this._screenfull.nativeAPI.fullscreenchange, this._handleFullscreenChange, context);
leaflet.DomEvent
.on(document, this._screenfull.nativeAPI.fullscreenchange, leaflet.DomEvent.stop)
.on(document, this._screenfull.nativeAPI.fullscreenchange, this._handleFullscreenChange, context);
}
return this.link;
},
toggleFullScreen() {
const map = this._map;
map._exitFired = false;
if (map._isFullscreen) {
if (this._screenfull.isEnabled && !this.options.forcePseudoFullscreen) {
this._screenfull.exit().then(() => map.invalidateSize());
} else {
leaflet.DomUtil.removeClass(this.options.fullscreenElement
? this.options.fullscreenElement
: map._container, 'leaflet-pseudo-fullscreen');
map.invalidateSize();
}
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
} else {
if (this._screenfull.isEnabled && !this.options.forcePseudoFullscreen) {
this._screenfull.request(this.options.fullscreenElement
? this.options.fullscreenElement
: map._container).then(() => map.invalidateSize());
} else {
leaflet.DomUtil.addClass(this.options.fullscreenElement
? this.options.fullscreenElement
: map._container, 'leaflet-pseudo-fullscreen');
map.invalidateSize();
}
map.fire('enterFullscreen');
map._isFullscreen = true;
}
},
_toggleState() {
this.link.title = this._map._isFullscreen
? this.options.title
: this.options.titleCancel;
this._map._isFullscreen
? L.DomUtil.removeClass(this.link, 'leaflet-fullscreen-on')
: L.DomUtil.addClass(this.link, 'leaflet-fullscreen-on');
},
_handleFullscreenChange(ev) {
const map = this._map;
if (ev.target === map.getContainer() && !this._screenfull.isFullscreen && !map._exitFired) {
this._screenfull.exit().then(() => map.invalidateSize());
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
}
}
});
leaflet.Map.include({
toggleFullscreen() {
this.fullscreenControl.toggleFullScreen();
}
});
leaflet.Map.addInitHook(function() {
if (this.options.fullscreenControl) {
this.addControl(leaflet.control.fullscreen(this.options.fullscreenControlOptions));
}
});
leaflet.control.fullscreen = function(options) {
return new leaflet.Control.FullScreen(options);
};
return { leaflet };
}));

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 26 52" xmlns="http://www.w3.org/2000/svg"><path d="M20.6 36.7H16a.9.9 0 0 1-.8-.8v-4.5c0-.2.2-.4.4-.4h1.4c.3 0 .5.2.5.4v3h3c.2 0 .4.2.4.5v1.4c0 .2-.2.4-.4.4zm-9.9-.8v-4.5c0-.2-.2-.4-.4-.4H8.9c-.3 0-.5.2-.5.4v3h-3c-.2 0-.4.2-.4.5v1.4c0 .2.2.4.4.4H9.9c.4 0 .8-.4.8-.8zm0 10.7V42c0-.4-.4-.8-.8-.8H5.4c-.2 0-.4.2-.4.4v1.4c0 .3.2.5.4.5h3v3c0 .2.2.4.5.4h1.4c.2 0 .4-.2.4-.4zm6.9 0v-3h3c.2 0 .4-.2.4-.5v-1.4c0-.2-.2-.4-.4-.4H16c-.4 0-.8.4-.8.8v4.5c0 .2.2.4.4.4h1.5c.3 0 .5-.2.5-.4zM5 10.3V5.9c0-.5.4-.9.9-.9h4.4c.2 0 .4.2.4.4V7c0 .2-.2.4-.4.4h-3v3c0 .2-.2.4-.4.4H5.4a.4.4 0 0 1-.4-.4zm10.3-4.9V7c0 .2.2.4.4.4h3v3c0 .2.2.4.4.4h1.5c.2 0 .4-.2.4-.4V5.9c0-.5-.4-.9-.9-.9h-4.4c-.2 0-.4.2-.4.4zm5.3 9.9H19c-.2 0-.4.2-.4.4v3h-3c-.2 0-.4.2-.4.4v1.5c0 .2.2.4.4.4h4.4c.5 0 .9-.4.9-.9v-4.4c0-.2-.2-.4-.4-.4zm-9.9 5.3V19c0-.2-.2-.4-.4-.4h-3v-3c0-.2-.2-.4-.4-.4H5.4c-.2 0-.4.2-.4.4v4.4c0 .5.4.9.9.9h4.4c.2 0 .4-.2.4-.4z" fill="currentColor"/></svg>

After

Width:  |  Height:  |  Size: 947 B

File diff suppressed because one or more lines are too long

6
maps/js/leaflet.js Normal file

File diff suppressed because one or more lines are too long

1
maps/js/leaflet.js.map Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

99
maps/js/scripts.js Normal file
View File

@@ -0,0 +1,99 @@
// On déclare les coordonnées de Paris
//let lat = 48.852969;
//let long = 2.349903;
// On déclare les coordonnées de Dijon
let lat = 47.316669;
let long = 5.01667;
let limites = [];
let markers = L.markerClusterGroup();
let map = L.map("map", {
zoom: 13,
center: [lat, long]
});
L.tileLayer("https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
minZoom: 1,
maxZoom: 20,
attribution: 'données © <a href="//osm.org/copyright">OpenStreetMap</a>/ODbL - rendu <a href="//openstreetmap.fr">OSM France</a>'
}).addTo(map);
// On charge sites.json
fetch("/maps/api/liste.php")
.then(data => data.json())
.then(sites => {
// On boucle sur les sites
for(let site of sites){
let coords = [site.lat, site.long];
// On charge l'icône du marqueur
let icone = L.icon({
iconUrl: "/maps/images/poi.png",
iconSize: [41,41],
iconAnchor: [12.5, 41],
popupAnchor: [0, -41]
/*
iconUrl: "/maps/images/pin.png",
iconSize: [25,41],
*/
});
// On crée le marqueur pour chaque site
let marker = L.marker(coords, {
icon: icone
});
/*
$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;
$lightbox['gps'] = $gps;
$lightbox['lat'] = $latitude;
$lightbox['long'] = $longitude;
$lightbox['description'] = $description;
$lightbox['width'] = $width;
$lightbox['height'] = $height;
<img src="${site.thumb}" alt="${site.filename}" width="300" height="300">
<img src="${site.thumb}" alt="${site.filename}" width="`+largeur+`" height="`+hauteur+`">
*/
if ( parseInt(site.width) <= parseInt(site.height) ) {
largeur = 200;
hauteur = 300;
}
else
{
largeur = 300;
hauteur = 200;
}
let popup = `<div class="popup">
<div>
<a href="${site.big}" title="${site.title_thumb}" data-lcl-txt="${site.description}" data-lcl-author="${site.creator}">
<img src="${site.thumb}" alt="${site.filename}" width="`+largeur+`" height="`+hauteur+`">
</a>
<h2>${site.title_thumb}</h2>
<p>${site.exif}</p>
</div>
</div>`;
marker.bindPopup(popup);
limites.push(coords);
// On ajoute le marqueur au cluster
markers.addLayer(marker);
}
// On ajoute les clusters à la carte
map.addLayer(markers);
map.fitBounds(limites);
});

1
maps/test.php Normal file
View File

@@ -0,0 +1 @@
<?php echo "Yop !"; ?>

26
maps/villes.json Normal file
View File

@@ -0,0 +1,26 @@
{
"Paris": {
"lat": 48.852969,
"lon": 2.349903,
"description": "Paris est la capitale de la France et une collectivité à statut particulier. Divisée en vingt arrondissements, elle est le chef-lieu de la région Île-de-France et le siège de la métropole du Grand Paris.",
"image": "paris.webp"
},
"Brest": {
"lat": 48.383,
"lon": -4.5,
"description": "Brest est une commune française, chef-lieu darrondissement du département du Finistère dans la région Bretagne. C'est un port important, deuxième port militaire en France après Toulon, situé à l'extrémité ouest de la Bretagne.",
"image": "brest.webp"
},
"Quimper": {
"lat": 48.0,
"lon": -4.1,
"description": "Quimper est une commune française de la région Bretagne située dans le nord-ouest de la France. Préfecture du département du Finistère et siège du Conseil départemental, elle est composée de deux cantons. Elle est également la capitale traditionnelle de la Cornouaille, du Pays Glazik et du Pays de Cornouaille (331 300 habitants en 2009), le siège de l'intercommunalité de Quimper Bretagne occidentale (100 187 habitants en 2014), le siège de l'arrondissement de Quimper et enfin le siège du diocèse de Quimper et Léon. Ses habitants sont appelés les Quimpérois.",
"image": "quimper.webp"
},
"Bayonne": {
"lat": 43.5,
"lon": -1.467,
"description": "Bayonne, Baiona en basque et en gascon, est une commune française et lune des deux sous-préfectures du département des Pyrénées-Atlantiques, en région Nouvelle-Aquitaine.",
"image": "bayonne.webp"
}
}

View File

@@ -1,24 +1,45 @@
<?php session_start(); ?>
<?php
session_start();
include 'i18n_setup.php';
/*include 'localize.php';
$domain = 'sentier';
localize($domain);
*/
include 'functions.php';
/*
_pr($_REQUEST); //
_pr($_SESSION); // [language] => de_DE
_pr($_POST); //
_pr($_GET); //
_pr($_COOKIE);
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); // fr_FR
echo $locale;
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php //echo gettext("Picture of the month"); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sur le sentier: la photos du mois">
<title><?php echo gettext("Picture of the month"); ?></title>
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="stylesheet" href="css/sls.css">
<link rel='stylesheet' href='lc-lightbox/css/lc_lightbox.min.css' />
<link rel='stylesheet' href='lc-lightbox/css/open_close_fx.css' />
<link rel='stylesheet' href='lc-lightbox/skins/minimal.css' />
<?php
include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
?>
<link rel="stylesheet" href="lc-lightbox/css/lc_lightbox.min.css">
<link rel="stylesheet" href="lc-lightbox/css/open_close_fx.css">
<link rel="stylesheet" href="lc-lightbox/skins/minimal.css">
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
@@ -34,13 +55,14 @@ else $page = intval($_GET['page']);
?>
<?php
//$base = $_SERVER['DOCUMENT_ROOT'] . '/db_photo.sqlite3';
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
$base = 'db_photo.sqlite3';
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $base)) {
try {
//$conn4 = new PDO('sqlite:db_photo.sqlite3');
$conn4 = new PDO('sqlite:db_photo.sqlite3');
$conn4 = new PDO("sqlite:$base");
// WHERE id='26'
$query4 = "SELECT filename, filesize, dateoriginal, lens, speed, correctexpo, iso, usercomment, comment, model, metering, flash, focal, program, wb, mode, width, height, html, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende FROM photos ORDER BY dateoriginal DESC LIMIT ? OFFSET ?";
//nb d'archive par page
@@ -67,6 +89,11 @@ else exit("Database " . $base . " does not exist !");
<p class="month"><?php echo month($result[0]['dateoriginal']); ?></p>
<?php
//_pr($result[0]);
//$thumbnail = host() . str_replace("img", "thumb", $chemin) . $result[0]['filename'];
//$full = host() . $chemin . $result[0]['filename'];
$lb = data_for_lightbox($result[0]);
//_pr($lb);
@@ -84,8 +111,10 @@ else exit("Database " . $base . " does not exist !");
*/
echo '<div class="cadre" id="lcl_month">';
//echo '<a href ="' . $full . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) .'" data-lcl-author="' . htmlspecialchars($lb['creator']) . '">';
//echo '<img src="' . $full . '" alt="' . htmlspecialchars($lb['title']) . '" class="trois">';
echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) .'" data-lcl-author="' . htmlspecialchars($lb['creator']) . '">';
echo '<img src="' . $lb['big'] . '" alt="' . htmlspecialchars($lb['title']) . '" class="trois" />';
echo '<img src="' . $lb['big'] . '" alt="' . htmlspecialchars($lb['title']) . '" class="trois">';
echo "</a>";
echo '</div>';
@@ -146,9 +175,13 @@ else exit("Database " . $base . " does not exist !");
//_pr($result[$i]);
//debug_to_console($result[$i]);
//$thumbnail = host() . str_replace("img", "thumb", $chemin) . $result[$i]['filename'];
//$full = host() . $chemin . $result[$i]['filename'];
$lb = data_for_lightbox($result[$i]);
//
//_pr($lb);
if (!empty($lb['gps'])) {
$map = '<a href = "https://maps.google.com/maps?q=' . $lb['gps'] . '&t=&z=9&ie=UTF8&iwloc=&output=embed" title="' . $lb['title'] . '" data-lcl-txt="' . $lb['legende'] . '">' . " \u{30FB} \u{2693} " . '</a>';
@@ -157,17 +190,33 @@ else exit("Database " . $base . " does not exist !");
$meta = '';
}
// data-lcl-author="' . htmlspecialchars($lb['exif']) . '"
//
echo '<div class="item">';
//echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['title']) .'" data-lcl-author="' . htmlspecialchars($meta) . '">';
//echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['exif']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '">';
// '" by="par' .
echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '">';
/*
if ($lb['width'] > $lb['height']) {
echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '">';
}
else {
$f = $chemin . $result[$i]['filename'];
$image = new Imagick($f);
echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '" />';
$new_w = 300;
$new_h = 200;
$resize_w = $new_w;
$resize_h = $lb['height'] * $new_w / $lb['width']; // 450
$image->resizeImage($resize_w, $resize_h, Imagick::FILTER_LANCZOS, 0.9); // 300 x 300
$image->cropImage($new_w, $new_h, ($resize_w - $new_w) / 2, ($resize_h - $new_h) / 2); // (w, h, x ,y) (xy coin haut gauche) (300, 200, 0, 125)
$thu = $chemin_thumb ."_" . $result[$i]['filename'];;
$image->writeImage($thu);
echo '<img src="' . $thu . '" alt="' . htmlspecialchars($lb['title']) . '">';
}
*/
echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '">';
echo "</a>";
echo '<span class="caption">' . month($date) . '</span>';
echo '</div>';
@@ -194,7 +243,7 @@ else exit("Database " . $base . " does not exist !");
</div>
<script type='text/javascript'>
<script>
$(document).ready(function() {
var $obj = lc_lightbox('#lcl_gallery a', {
img_zoom : true, // whether to enable zooming system
@@ -322,8 +371,8 @@ echo '</div>';
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
<script src='lc-lightbox/js/lc_lightbox.min.js'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 KiB

After

Width:  |  Height:  |  Size: 894 KiB

BIN
photos/img/12_2024.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 KiB

BIN
photos/img/1_2025.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More