Clean code
This commit is contained in:
@@ -326,6 +326,19 @@ function data_for_lightbox($data) {
|
|||||||
$lightbox['keywords'] = $keywords;
|
$lightbox['keywords'] = $keywords;
|
||||||
$lightbox['creator'] = $creator;
|
$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;
|
return $lightbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,13 @@
|
|||||||
<link rel='stylesheet' href='css/open_close_fx.css' />
|
<link rel='stylesheet' href='css/open_close_fx.css' />
|
||||||
<link rel='stylesheet' href='css/minimal.css' />
|
<link rel='stylesheet' href='css/minimal.css' />
|
||||||
|
|
||||||
|
<?php include 'functions.php';
|
||||||
|
$domain = 'sentier';
|
||||||
|
localize($domain);
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
//if ($_SERVER['SERVER_NAME'] == 'airbook.local')
|
//if ($_SERVER['SERVER_NAME'] == 'airbook.local')
|
||||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||||
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
|
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
|
||||||
@@ -34,6 +40,7 @@
|
|||||||
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
|
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
|
||||||
|
|
||||||
include 'functions.php';
|
include 'functions.php';
|
||||||
|
*/
|
||||||
?>
|
?>
|
||||||
<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.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
@@ -366,6 +373,8 @@ foreach($dir as $file){
|
|||||||
$z = count($photos);
|
$z = count($photos);
|
||||||
if ($z == 0) {
|
if ($z == 0) {
|
||||||
echo '<h3>' . gettext('No new image files to add') . '...</h3>';
|
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>';
|
||||||
|
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,7 +524,9 @@ try {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h4><a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a></h4>
|
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a></p>
|
||||||
|
|
||||||
|
<p><em><small>sur-le-sentier.fr@ 2022</small></em></p>
|
||||||
|
|
||||||
<script src='js/lc_lightbox.min.js' type='text/javascript'></script>
|
<script src='js/lc_lightbox.min.js' type='text/javascript'></script>
|
||||||
<script src='js/alloy_finger.min.js' type='text/javascript'></script>
|
<script src='js/alloy_finger.min.js' type='text/javascript'></script>
|
||||||
|
|||||||
@@ -17,34 +17,6 @@
|
|||||||
localize($domain);
|
localize($domain);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
//if ($_SERVER['SERVER_NAME'] == 'airbook.local')
|
|
||||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
|
||||||
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
|
|
||||||
include 'functions.php';
|
|
||||||
include($root.'/lib2/localize.php');
|
|
||||||
$dir_locales = $root . '/Locale';
|
|
||||||
|
|
||||||
$liste_locale = list_dir($dir_locales);
|
|
||||||
_pr($liste_locale);
|
|
||||||
//if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($myLanguages);
|
|
||||||
if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($liste_locale);
|
|
||||||
else $langue = $_REQUEST['lang'];
|
|
||||||
|
|
||||||
$domain = 'sentier';
|
|
||||||
putenv('LC_ALL=' . $langue);
|
|
||||||
$loc = setlocale(LC_ALL, $langue);
|
|
||||||
|
|
||||||
bindtextdomain($domain, $root . '/Locale/');
|
|
||||||
bind_textdomain_codeset($domain, 'UTF-8');
|
|
||||||
textdomain($domain);
|
|
||||||
|
|
||||||
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<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.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -77,48 +49,27 @@ try {
|
|||||||
catch(PDOException $e) {
|
catch(PDOException $e) {
|
||||||
echo $e->getMessage();
|
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";
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p class="month"><?php echo month($z); ?></p>
|
<p class="month"><?php echo month($result[0]['date']); ?></p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$lb = data_for_lightbox($result[0]);
|
||||||
|
|
||||||
echo '<div class="cadre" id="lcl_month">';
|
echo '<div class="cadre" id="lcl_month">';
|
||||||
echo '<a href ="' . host() . $photo_du_mois['filename'] . '" title="' . $x . '" data-lcl-txt="' . $y .'" data-lcl-author="' . $month_exif . '">';
|
echo '<a href ="' . $lb['big'] . '" title="' . $lb['title'] . '" data-lcl-txt="' . $lb['title'] .'" data-lcl-author="' . $lb['exif'] . '">';
|
||||||
echo '<img src="' . host() . $photo_du_mois['filename'] . '" class="trois" />';
|
echo '<img src="' . $lb['big'] . '" class="trois" />';
|
||||||
echo "</a>";
|
echo "</a>";
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
if (!empty($photo_du_mois['titre']) || !empty($photo_du_mois['legende'])) {
|
if (!empty($lb['title']) || !empty($lb['legende'])) {
|
||||||
?>
|
?>
|
||||||
<p class="titrePhoto"><?php echo $photo_du_mois['title']; ?></p>
|
<p class="titrePhoto"><?php echo $lb['title']; ?></p>
|
||||||
<p class="legendePhoto"><?php echo $photo_du_mois['legende']; ?></p>
|
<p class="legendePhoto"><?php echo $lb['legende']; ?></p>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
echo '<div class="exif">';
|
echo '<div class="exif">';
|
||||||
//echo $photo_du_mois['model'] . " \u{30FB} " . $photo_du_mois['lens'] . " \u{30FB} ";
|
echo $lb['exif'];
|
||||||
//echo $photo_du_mois['exposure'] . " \u{30FB} " . $photo_du_mois['aperture'] . " \u{30FB} " . $photo_du_mois['iso'] . " ISO";
|
|
||||||
echo $month_exif;
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -248,7 +199,7 @@ if ($page < $nbpages) echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$suiv.'" ti
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p class="navPage"><a href="index.php"><?php echo gettext("Home"); ?></a> | <a href="maps.php"><?php echo gettext("Maps"); ?></a></p>
|
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a></p>
|
||||||
|
|
||||||
<p><em><small>sur-le-sentier.fr@ 2022</small></em></p>
|
<p><em><small>sur-le-sentier.fr@ 2022</small></em></p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user