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
This commit is contained in:
2025-02-13 10:07:21 +01:00
parent 55bedea648
commit b35196fdb8
21 changed files with 317 additions and 158 deletions

View File

@@ -204,7 +204,7 @@ function create_thumb($thumb_w, $thumb_h, $image) {
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("../photos/img", "../photos/thumb", $image);
if ($origin_w != null && $origin_h != null) {
if ($thumb_w / $thumb_h > $origin_ratio) {
@@ -229,7 +229,7 @@ if ($origin_w != null && $origin_h != null) {
function in_bdd($image) {
try {
$conn3 = new PDO('sqlite:db_photo.sqlite3');
$conn3 = new PDO('sqlite:../db_photo.sqlite3');
#$query3 = "SELECT filename FROM photos WHERE instr(filename, '". $file . "') > 0;";
$query3 = "SELECT filename FROM photos WHERE filename = :filename";
$stmt = $conn3->prepare($query3);
@@ -373,6 +373,7 @@ 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'];
@@ -420,16 +421,20 @@ 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>';
}
else {
$map = '';
}
$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>';
}
else {
$map = '';
}
$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'];