12-04-2022

mise en place de $_SESSION pour la localisation
This commit is contained in:
2022-04-12 12:22:54 +02:00
parent 629d9fd711
commit 053598bf47
5 changed files with 43 additions and 68 deletions

View File

@@ -5,7 +5,7 @@
<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 gettext('Insert photos in Sqlite base'; ?></title>
<title><?php gettext('Insert photos in Sqlite base'); ?></title>
<link rel="stylesheet" href="css/sls.css" />
<link rel='stylesheet' href='css/lc_lightbox.min.css' />
@@ -13,35 +13,11 @@
<link rel='stylesheet' href='css/minimal.css' />
<?php include 'functions.php';
session_start();
$domain = 'sentier';
localize($domain);
?>
<?php
/*
//if ($_SERVER['SERVER_NAME'] == 'airbook.local')
$root = $_SERVER['DOCUMENT_ROOT'];
//$root = dirname($_SERVER['SCRIPT_FILENAME']); // /Users/bruno/Sites/sls
include($root.'/lib2/localize.php');
$dir_locales = $root . '/Locale';
$liste_locale = list_dir($dir_locales);
if ((!isset($_POST['lang'])) and (!isset($_GET['lang']))) $langue = locale_language_from_browser($myLanguages);
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') );
include 'functions.php';
*/
?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
@@ -111,8 +87,7 @@ foreach($dir as $file){
if ($x == false) { //false
if ($exif = @exif_read_data($file, 0, true )) {
//_pr($exif);
//if (($file == 'photos/img/12_2007.jpg') || ($file == 'photos/img/11_2007.jpg') || ($file == 'photos/img/10_2020.jpg')) {
if (($file == 'photos/img/4_2008.jpg') || ($file == 'photos/img/10_2020.jpg')) {
_pr($exif);
}
@@ -292,8 +267,6 @@ foreach($dir as $file){
$ep = '';
}
///echo "File: " . basename($file) . " - Objectif: " . $obj . " - Model: " . $mod . " - Metering: " . $mm . " - Flash: " . $fla. " - Focal: " . $fl. " - Exposure: " . " - Balance: " . $wb. " - Program: " . $ep . "<br>";
$wi = isset($exif['COMPUTED']['Width']) ? $exif['COMPUTED']['Width'] : '';
$he = isset($exif['COMPUTED']['Height']) ? $exif['COMPUTED']['Height'] : '';
$ht = isset($exif['COMPUTED']['html']) ? $exif['COMPUTED']['html'] : '';
@@ -329,9 +302,6 @@ foreach($dir as $file){
);
}
//$qq = getimagesize($file, $info);
//_pr($qq);
if ($iptc = @getimagesize($file, $info)) {
//_pr($iptc);
if (isset($info["APP13"])) {
@@ -368,7 +338,6 @@ foreach($dir as $file){
$i++;
}
//_pr($photos);
$z = count($photos);
if ($z == 0) {
echo '<h3>' . gettext('No new image files to add') . '...</h3>';
@@ -423,8 +392,6 @@ try {
$stmt->bindParam(':wb', $wb);
$stmt->bindParam(':program', $ep);
//echo count($photos);
//_pr($photos);
if (isset($photos)) {
foreach ($photos as $item) {