-correction mauvais chemin des vignettes
-correction affichage desciption dans la lightbox
This commit is contained in:
2025-02-14 08:14:11 +01:00
parent 356c1885df
commit f1f8a85189
2 changed files with 55 additions and 20 deletions

View File

@@ -268,8 +268,10 @@ function create_thumb($thumb_w, $thumb_h, $image) {
*/ */
function in_bdd($image) { function in_bdd($image) {
global $base;
try { 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 instr(filename, '". $file . "') > 0;";
$query3 = "SELECT filename FROM photos WHERE filename = :filename"; $query3 = "SELECT filename FROM photos WHERE filename = :filename";
$stmt = $conn3->prepare($query3); $stmt = $conn3->prepare($query3);

View File

@@ -6,6 +6,10 @@ $domain = 'sentier';
localize($domain); localize($domain);
*/ */
include 'functions.php'; include 'functions.php';
$base = 'db_photo.sqlite3';
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@@ -54,7 +58,7 @@ include 'functions.php';
<?php <?php
try { 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"; $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); $stmt = $conn4->prepare($query4);
@@ -119,7 +123,8 @@ include 'functions.php';
$lb = data_for_lightbox($result[$i]); $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); $b = substr_replace($b, '', -3, 1);
echo $b; echo $b;
@@ -174,23 +179,51 @@ include 'functions.php';
$(document).ready(function() { $(document).ready(function() {
var $obj = lc_lightbox('.gm_thumb a', { var $obj = lc_lightbox('.gm_thumb a', {
img_zoom : true,
open_close_time : 200, img_zoom : true, // whether to enable zooming system
ol_time_diff : 100, author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
wrap_class : 'lcl_zoomin_oc',
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 skin : 'minimal', // minimal | light | dark
data_position : 'over', 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', cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
txt_hidden : false, ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
//shox_title : true, // s'il faut afficher les titres nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
show_descr : false, // s'il faut afficher les descriptions
//show_author : true, // s'il faut afficher les auteurs txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
fullscreen : true, shox_title : true, // s'il faut afficher les titres
fs_img_behavior : 'smart', show_descr : true, // s'il faut afficher les descriptions
fs_only : 500, show_author : true, // s'il faut afficher les auteurs
browser_fs_mode : true,
txt_toggle_cmd : true, thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
rclick_prevent : true,
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
}); });
}); });