isFile() == false || !in_array($file->getExtension(), $allowed_extensions)) {
continue;
}
$t = $file->getFilename();
echo $t;
$ts = basename($t, ".jpg");
$pieces = explode("_", $ts);
$d = $pieces[1] . "-" . $pieces[0] . "-01";
$date = new DateTime($d);
$ts = strtotime($date->format('Y-m-d H:i:s'));
$photos[] = array(
'filename' => $file->getFilename(),
'timestamp' => $ts
);
}
$filename = array_column($photos, 'filename');
$timestamp = array_column($photos, 'timestamp');
array_multisort($timestamp, SORT_DESC, $filename, SORT_ASC,$photos);
$i = 0;
while ($i < 13) {
$file = '../zenphoto/albums/photos-du-mois/' . $photos[$i]['filename'];
if (file_exists($file)) {
//echo $file;
// ../zenphoto/albums/photos-du-mois/4_2014.jpg
// 4_2014_800_watermark.jpg, 4_2014_FULL_watermark.jpg
$photo_du_mois = $file;
$title = $tableau[$i];
$size = getimagesize($photo_du_mois, $info);
if ($size[0] > 1000) {
// HD
$hd = '../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_FULL_watermark.jpg";
if (file_exists($hd)) {
$size_hd = getimagesize($hd, $info_hd);
$imgs['img_hd'] = array(
'url' => $hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
);
}
else {
$imgs['img_hd'] = array(
'url' => $photo_du_mois,
'width' => $size[0],
'height' => $size[1]
);
}
// SD
$sd = '../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
if (file_exists($sd)) {
$size_sd = getimagesize($sd, $info_sd);
$imgs['img_sd'] = array(
'url' => $sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
}
else {
// SD
$sd = '../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
if (file_exists($sd)) {
$size_sd = getimagesize($sd, $info_sd);
$imgs['img_sd'] = array(
'url' => $sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
$imgs['img_hd'] = array(
'url' => "",
'width' => "",
'height' => ""
);
} // if ($size[0] > 1000)
$title = explode('.',$title);
$title = explode('_',$title[0]);
$title = mois2($title[0]) . ' ' . $title[1];
$imgs['img_sd']['title'] = $title;
if (isset($info["APP13"])) {
$iptc = iptcparse($info["APP13"]);
if (isset($iptc['2#120'][0])) $legende = $iptc['2#120'][0];
else $legende = "";
if (isset($iptc['2#005'][0])) $titre = $iptc['2#005'][0];
else $titre = "";
$keyword = "";
if (isset($iptc['2#025'])) {
foreach ($iptc['2#025'] as $key => $val) {
$keyword .= '' . $val . '';
$keyword .= ', ';
}
$keyword = substr($keyword, 0, -2);
}
$imgs['img_sd']['legende'] = $legende;
$imgs['img_sd']['titre'] = $titre;
$imgs['img_sd']['keyword'] = $keyword;
}
$exifInfo = "";
$exif_array = read_exif_data_raw($file,0);
//$exifInfo = 'Le '.date('d.m.Y à H:i',strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
$exifInfo = gettext("The") . " " .date(gettext("F j, Y, g:i a"),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
//$exifInfo .= $exif_array['SubIFD']['ExposureTime'].' à '.$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - Focale '.$exif_array['SubIFD']['FocalLength'];
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. gettext(" at ") .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. gettext("Focal ") .$exif_array['SubIFD']['FocalLength'];
//preprint($exif_array);
$imgs['img_sd']['exif'] = $exifInfo;
break;
}
$i++;
}
//preprint($imgs);
?>
';
?>
"; $aide .= " -sur ordinateur: naviguer avec les touches flèches droite et gauche, quitter avec ESC.
"; $aide .= " -sur tablettes et smartphones: balayer l'écran avec un doigt vers la droite ou vers la gauche, ou naviguer avec les touches flèches droite et gauche. Cliquer sur la X pour quitter."; ?>
"; echo $fin . "
"; echo $page . "
"; */ for ($j=$debut; $j<=$fin; $j++) { /* if ($j <= count($fichier)-1) echo display($fichier[$j],$album); if ($j+1 <= count($fichier)-1) echo display($fichier[$j+1],$album); if ($j+2 <= count($fichier)-1) echo display($fichier[$j+2],$album); */ if ($j <= count($fichier)-1) echo displayRetina($fichier[$j],$album); if ($j+1 <= count($fichier)-1) echo displayRetina($fichier[$j+1],$album); if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album); //echo $fichier[$j]; $j = $j + 2; } ?> = 2) echo '« '.gettext("prev").' '; for ($i = 1; $i <= $nbpages; $i++) { if ($i != $page) { echo ''.$i.' '; } else { echo "".$i." "; } } if ($page < $nbpages) echo ''.gettext("next").' » '; ?>
Titre
Légende
Titre
Légende
connect_error) { trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR); exit(); } $conn->set_charset("utf8"); $excquery = "SELECT `id` FROM `" . $table['albums'] . "` WHERE `folder` = '" . $album . "'"; if ($result = $conn->query($excquery)) { $result->data_seek(0); $row = $result->fetch_row(); $id_album = $row[0]; $result->close(); } $conn->close(); // Récupérer toutes les fichiers de l'album 'photos-du-mois' $conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable); if ($conn->connect_error) { trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR); exit(); } $conn->set_charset("utf8"); $pictquery = "SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC"; $stmt = $conn->prepare($pictquery); //echo $pictquery; if($stmt === false) { trigger_error('Wrong SQL: ' . $pictquery . ' Error: ' . $conn->error, E_USER_ERROR); } else { $stmt->bind_param('i', $id_album); $stmt->execute(); $stmt->bind_result($filename); while ($stmt->fetch()) { $fichier[] = $filename; $i++; //echo $filename; } } $stmt->close(); // ?> ? Utilisation: cliquer sur une vignette, puis...."; $aide .= " -sur ordinateur: naviguer avec les touches flèches droite et gauche, quitter avec ESC.
"; $aide .= " -sur tablettes et smartphones: balayer l'écran avec un doigt vers la droite ou vers la gauche, ou naviguer avec les touches flèches droite et gauche. Cliquer sur la X pour quitter."; ?>
( ? )
"; echo $debut . ""; echo $fin . "
"; echo $page . "
"; */ for ($j=$debut; $j<=$fin; $j++) { /* if ($j <= count($fichier)-1) echo display($fichier[$j],$album); if ($j+1 <= count($fichier)-1) echo display($fichier[$j+1],$album); if ($j+2 <= count($fichier)-1) echo display($fichier[$j+2],$album); */ if ($j <= count($fichier)-1) echo displayRetina($fichier[$j],$album); if ($j+1 <= count($fichier)-1) echo displayRetina($fichier[$j+1],$album); if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album); //echo $fichier[$j]; $j = $j + 2; } ?> = 2) echo '« '.gettext("prev").' '; for ($i = 1; $i <= $nbpages; $i++) { if ($i != $page) { echo ''.$i.' '; } else { echo "".$i." "; } } if ($page < $nbpages) echo ''.gettext("next").' » '; ?>