From 36eb1fadf966c827b222b29ae0121631e6d90fa1 Mon Sep 17 00:00:00 2001 From: Bruno21 Date: Thu, 31 Mar 2022 15:30:11 +0200 Subject: [PATCH] Clean code --- functions.php | 15 +++++++++- insert_bdd.php | 13 +++++++- photo-du-mois.php | 75 ++++++++--------------------------------------- 3 files changed, 39 insertions(+), 64 deletions(-) diff --git a/functions.php b/functions.php index b12607f..3add7b1 100644 --- a/functions.php +++ b/functions.php @@ -325,7 +325,20 @@ function data_for_lightbox($data) { $lightbox['big'] = $big; $lightbox['keywords'] = $keywords; $lightbox['creator'] = $creator; - + + /* + Array + ( + [title_thumb] => 12_2021 + [exif] => Canon EOS 90D ・ EF500mm f/4L IS USM III ・ 1/3200 ・ f/5.6 ・ 1600ISO + [title] => 12_2021.jpg + [legende] => + [thumb] => https://airbook.local/sls/photos/thumb/12_2021.jpg + [big] => https://airbook.local/sls/photos/img/12_2021.jpg + [keywords] => Carduelis carduelis ・ chardonneret élégant + [creator] => @Bruno Pesenti + ) + */ return $lightbox; } diff --git a/insert_bdd.php b/insert_bdd.php index 2a7da4f..c606958 100644 --- a/insert_bdd.php +++ b/insert_bdd.php @@ -12,7 +12,13 @@ + + gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') ); include 'functions.php'; + */ ?> @@ -366,6 +373,8 @@ foreach($dir as $file){ $z = count($photos); if ($z == 0) { echo '

' . gettext('No new image files to add') . '...

'; + echo ''; + die(); } @@ -515,7 +524,9 @@ try { }); -

">

+ + +

sur-le-sentier.fr@ 2022

diff --git a/photo-du-mois.php b/photo-du-mois.php index 83c617d..7cd2908 100644 --- a/photo-du-mois.php +++ b/photo-du-mois.php @@ -8,44 +8,16 @@ <?= _("Picture of the month");?> - - - + + + - gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') ); -*/ - -?> - - + @@ -77,48 +49,27 @@ try { catch(PDOException $e) { echo $e->getMessage(); } - - $photo_du_mois = $result[0]; - $z = $photo_du_mois['date']; - - $photo_du_mois['title'] = "Titre"; - $photo_du_mois['legende'] = "Légende"; - - if (!empty($photo_du_mois['title'])) { - $x = $photo_du_mois['title']; - $y = $photo_du_mois['legende']; - } - elseif (!empty($photo_du_mois['legende'])) { - $x = $photo_du_mois['legende']; - } - else { - $x = basename($photo_du_mois['filename']); - $y = ""; - } - - $month_exif = $photo_du_mois['model'] . " \u{30FB} " . $photo_du_mois['lens'] . " \u{30FB} " . $photo_du_mois['speed'] . " \u{30FB} " . $photo_du_mois['aperture'] . " \u{30FB} " . $photo_du_mois['iso'] . " ISO"; ?> -

+

'; - echo ''; - echo ''; + echo ''; + echo ''; echo ""; echo ''; - if (!empty($photo_du_mois['titre']) || !empty($photo_du_mois['legende'])) { + if (!empty($lb['title']) || !empty($lb['legende'])) { ?> -

-

+

+

'; - //echo $photo_du_mois['model'] . " \u{30FB} " . $photo_du_mois['lens'] . " \u{30FB} "; - //echo $photo_du_mois['exposure'] . " \u{30FB} " . $photo_du_mois['aperture'] . " \u{30FB} " . $photo_du_mois['iso'] . " ISO"; - echo $month_exif; + echo $lb['exif']; echo ''; ?> @@ -248,7 +199,7 @@ if ($page < $nbpages) echo ''; ?> - +

sur-le-sentier.fr@ 2022