-réécriture du code pour l’image du mois et les vignettes
-simplication: $images_du_mois est un tableau qui rassemble les chemins SD et HD, les exifs pour toutes des les images de l’album *photo-du-mois* -utilisation de PDO pour les requêtes MySQL -utilisation de kk-lightbox comme Lightbox
This commit is contained in:
263
functions.php
263
functions.php
@@ -113,9 +113,267 @@ function mois2 ($mois) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ce-mois-ci.php
|
Retourne la liste des images d'un album Zenphoto
|
||||||
|
page-ce-mois-ci.php:259
|
||||||
*/
|
*/
|
||||||
function displayRetina ($filename,$album) {
|
function imagesFromZPAlbum ($album, $connexion) {
|
||||||
|
|
||||||
|
$table = array();
|
||||||
|
$table['images'] = $connexion['zp_prefix'] . "images";
|
||||||
|
$table['albums'] = $connexion['zp_prefix'] . "albums";
|
||||||
|
|
||||||
|
// ****** Mysqli ****** //
|
||||||
|
/*
|
||||||
|
$conn = new mysqli($connexion['host'], $connexion['user'], $connexion['password'], $connexion['db_zenphoto']);
|
||||||
|
if ($conn->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();
|
||||||
|
}
|
||||||
|
|
||||||
|
$pictquery = "SELECT `filename`, `EXIFModel`, `EXIFDateTimeOriginal`, `EXIFExposureTime`, `EXIFFNumber`, `EXIFISOSpeedRatings`, `EXIFFocalLength`, `EXIFGPSLatitude`, `EXIFGPSLatitudeRef`, `EXIFGPSLongitude`, `EXIFGPSLongitudeRef`, `EXIFGPSAltitude`, `EXIFGPSAltitudeRef`, `desc`, `title` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC";
|
||||||
|
|
||||||
|
$stmt = $conn->prepare($pictquery);
|
||||||
|
if($stmt === false) {
|
||||||
|
trigger_error('Wrong SQL: ' . $pictquery . ' Error: ' . $conn->error, E_USER_ERROR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$stmt->bind_param('i', $id_album);
|
||||||
|
$stmt->execute();
|
||||||
|
$fichier = $stmt->get_result()->fetch_all();
|
||||||
|
}
|
||||||
|
$stmt->close();
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Array
|
||||||
|
(
|
||||||
|
[0] => Array
|
||||||
|
(
|
||||||
|
[0] => 11_2018.jpg
|
||||||
|
[1] => Canon EOS-1D Mark IV
|
||||||
|
[2] => 2018:11:04 11:05:09
|
||||||
|
[3] => 1/2000 sec
|
||||||
|
[4] => f/7,1
|
||||||
|
[5] => 500
|
||||||
|
[6] => 700 mm
|
||||||
|
[7] =>
|
||||||
|
[8] =>
|
||||||
|
[9] =>
|
||||||
|
[10] =>
|
||||||
|
[11] =>
|
||||||
|
[12] =>
|
||||||
|
[13] =>
|
||||||
|
[14] => 11_2018
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ****** /Mysqli ****** //
|
||||||
|
|
||||||
|
|
||||||
|
// ****** PDO ****** //
|
||||||
|
|
||||||
|
$charset = 'utf8';
|
||||||
|
$host = $connexion['host'];
|
||||||
|
$dbname = $connexion['db_zenphoto'];
|
||||||
|
|
||||||
|
$dsn = "mysql:host=$host;dbname=$dbname;charset=$charset";
|
||||||
|
$options = [
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
|
];
|
||||||
|
try {
|
||||||
|
$pdo = new PDO($dsn, $connexion['user'], $connexion['password'], $options);
|
||||||
|
} catch (\PDOException $e) {
|
||||||
|
throw new \PDOException($e->getMessage(), (int)$e->getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
$excquery = "SELECT `id` FROM `" . $table['albums'] . "` WHERE `folder` = '" . $album . "'";
|
||||||
|
$stmt = $pdo->query($excquery);
|
||||||
|
while ($row = $stmt->fetch()) {
|
||||||
|
//echo $row['id'] . "\n";
|
||||||
|
$id_album = $row['id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$pictquery = "SELECT `filename`, `EXIFModel`, `EXIFDateTimeOriginal`, `EXIFExposureTime`, `EXIFFNumber`, `EXIFISOSpeedRatings`, `EXIFFocalLength`, `EXIFLensInfo`, `EXIFGPSLatitude`, `EXIFGPSLatitudeRef`, `EXIFGPSLongitude`, `EXIFGPSLongitudeRef`, `EXIFGPSAltitude`, `EXIFGPSAltitudeRef`, `desc`, `title` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC";
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($pictquery);
|
||||||
|
$stmt->execute([$id_album]);
|
||||||
|
$fichier = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Ajouter: EXIFLensInfo
|
||||||
|
|
||||||
|
|
||||||
|
Array
|
||||||
|
(
|
||||||
|
[0] => Array
|
||||||
|
(
|
||||||
|
[filename] => 11_2018.jpg
|
||||||
|
[EXIFModel] => Canon EOS-1D Mark IV
|
||||||
|
[EXIFDateTimeOriginal] => 2018:11:04 11:05:09
|
||||||
|
[EXIFExposureTime] => 1/2000 sec
|
||||||
|
[EXIFFNumber] => f/7,1
|
||||||
|
[EXIFISOSpeedRatings] => 500
|
||||||
|
[EXIFFocalLength] => 700 mm
|
||||||
|
[EXIFGPSLatitude] =>
|
||||||
|
[EXIFGPSLatitudeRef] =>
|
||||||
|
[EXIFGPSLongitude] =>
|
||||||
|
[EXIFGPSLongitudeRef] =>
|
||||||
|
[EXIFGPSAltitude] =>
|
||||||
|
[EXIFGPSAltitudeRef] =>
|
||||||
|
[desc] =>
|
||||||
|
[title] => 11_2018
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
|
||||||
|
//preprint($fichier);
|
||||||
|
|
||||||
|
// ****** /PDO ****** //
|
||||||
|
|
||||||
|
return $fichier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
page-ce-mois-ci.php
|
||||||
|
*/
|
||||||
|
function displayRetina ($file,$album) {
|
||||||
|
|
||||||
|
global $ppage;
|
||||||
|
|
||||||
|
//preprint($file);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Array
|
||||||
|
(
|
||||||
|
[filename] => 10_2018.jpg
|
||||||
|
[EXIFModel] => Canon EOS 5D Mark III
|
||||||
|
[EXIFDateTimeOriginal] => 2018:10:17 19:09:12
|
||||||
|
[EXIFExposureTime] => 1/250 sec
|
||||||
|
[EXIFFNumber] => f/4
|
||||||
|
[EXIFISOSpeedRatings] => 4000
|
||||||
|
[EXIFFocalLength] => 500 mm
|
||||||
|
[EXIFLensInfo] => EF500mm f/4L IS USM
|
||||||
|
[EXIFGPSLatitude] =>
|
||||||
|
[EXIFGPSLatitudeRef] =>
|
||||||
|
[EXIFGPSLongitude] =>
|
||||||
|
[EXIFGPSLongitudeRef] =>
|
||||||
|
[EXIFGPSAltitude] =>
|
||||||
|
[EXIFGPSAltitudeRef] =>
|
||||||
|
[desc] =>
|
||||||
|
[title] => 10_2018
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($ppage == "1") {
|
||||||
|
$fullpath = "../../zenphoto/";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$fullpath = "../../../zenphoto/";
|
||||||
|
}
|
||||||
|
$name = explode(".", $file['filename']);
|
||||||
|
|
||||||
|
$thumbpath = "../zenphoto/cache/" . $album . "/";
|
||||||
|
$a = $path . $filename;
|
||||||
|
|
||||||
|
$file_sd = $thumbpath . $name[0] . "_200_thumb.jpg";
|
||||||
|
$file_hd = $thumbpath . $name[0] . "_400_thumb.jpg";
|
||||||
|
|
||||||
|
//echo $file_sd;
|
||||||
|
//echo $file_hd;
|
||||||
|
|
||||||
|
/*
|
||||||
|
$file_sd = $path . $file[0] . "_180_watermark.jpg";
|
||||||
|
$file_hd = $path . $file[0] . "_360_watermark.jpg";
|
||||||
|
*/
|
||||||
|
|
||||||
|
$th_sd = false;
|
||||||
|
$th_hd = false;
|
||||||
|
|
||||||
|
$thumb = array();
|
||||||
|
|
||||||
|
if (file_exists($file_sd)) {
|
||||||
|
$th_sd = true;
|
||||||
|
$size_sd = getimagesize($file_sd, $info);
|
||||||
|
$thumb['sd'] = array(
|
||||||
|
'url' => "../../" . $file_sd,
|
||||||
|
'width' => $size_sd[0],
|
||||||
|
'height' => $size_sd[1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (file_exists($file_hd)) {
|
||||||
|
$th_hd = true;
|
||||||
|
$size_hd = getimagesize($file_hd, $info);
|
||||||
|
$thumb['hd'] = array(
|
||||||
|
'url' => "../../" . $file_hd,
|
||||||
|
'width' => $size_hd[0],
|
||||||
|
'height' => $size_hd[1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($th_sd == true) && ($th_hd == true)) {
|
||||||
|
$standard = $thumb['sd']['url'] . ' 200w, ' . $thumb['hd']['url'] . ' 400w';
|
||||||
|
}
|
||||||
|
elseif ($th_sd == true) {
|
||||||
|
$standard = $thumb['sd']['url'] . ' 200w';
|
||||||
|
}
|
||||||
|
elseif ($th_hd == true) {
|
||||||
|
$standard = $thumb['hd']['url'] . ' 400w';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$display = '<div class="album">';
|
||||||
|
$display .= '<div class="holder">';
|
||||||
|
$display .= '<a href="' . $fullpath . 'albums/'.$album.'/'.$file['filename'].'" title="'.date_archive($file['filename']).'" class="kk-lightbox">';
|
||||||
|
/*
|
||||||
|
$display .= '<picture data-picture data-alt="">';
|
||||||
|
$display .= '<!--[if IE 9]><video style="display: none;"><![endif]-->';
|
||||||
|
$display .= '<source class="image_standard" srcset="' . $standard . '">';
|
||||||
|
|
||||||
|
$display .= '<!--[if IE 9]></video><![endif]-->';
|
||||||
|
$display .= '<img srcset="' . $thumb['sd']['url'] . '" width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"alt="">';
|
||||||
|
$display .= '</picture>';
|
||||||
|
|
||||||
|
$display .= '<img width="" height=""
|
||||||
|
src="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg"
|
||||||
|
class="" alt=""
|
||||||
|
srcset="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg 200w,
|
||||||
|
../../../zenphoto/cache/photos-du-mois/10_2016_400_thumb.jpg 400w"
|
||||||
|
sizes="(max-width: 200px) 100vw, 200px" />';
|
||||||
|
|
||||||
|
$display .= '<img width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"
|
||||||
|
src="' . $thumb['sd']['url'] . '"
|
||||||
|
class="" alt=""
|
||||||
|
srcset="' . $standard . '"
|
||||||
|
sizes="(max-width: 200px) 100vw, 200px" />';
|
||||||
|
*/
|
||||||
|
$display .= "<img width='" . $thumb['sd']['width'] . "' height='" . $thumb['sd']['height'] . "' src='" . $thumb['sd']['url'] . "' class='' alt='' srcset='" . $standard . "' sizes='(max-width: 200px) 100vw, 200px' />";
|
||||||
|
|
||||||
|
$display .= '</a>';
|
||||||
|
$display .= '</div>';
|
||||||
|
$display .= '<div class="albumdesc">';
|
||||||
|
$display .= '<a href="../../zenphoto/index.php?album='.$album.'&image='.$filename.'" title= "'.date_archive($file['filename']).'" class="">';
|
||||||
|
$display .= '<span class="exif">'.date_archive($file['filename']).'</span>';
|
||||||
|
$display .= '</a></div>';
|
||||||
|
$display .= '</div>' . "\r\n";
|
||||||
|
|
||||||
|
//echo "display: " . $display;
|
||||||
|
|
||||||
|
return $display;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function displayRetina_bak ($filename,$album) {
|
||||||
|
|
||||||
global $ppage;
|
global $ppage;
|
||||||
|
|
||||||
@@ -216,7 +474,6 @@ function displayRetina ($filename,$album) {
|
|||||||
return $display;
|
return $display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*functions.php - displayRetina() displayRetina()
|
*functions.php - displayRetina() displayRetina()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||||
define('SERVERPATH',$root.'/zenphoto');
|
define('SERVERPATH',$root.'/zenphoto');
|
||||||
include('../photoblog/exifer/exif.php');
|
include('../photoblog/exifer/exif.php');
|
||||||
|
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
||||||
|
|
||||||
//nb d'archive par page
|
//nb d'archive par page
|
||||||
$nb = 12;
|
$nb = 12;
|
||||||
@@ -75,49 +76,51 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
|
|
||||||
<?php the_content (); ?>
|
<?php the_content (); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$mois = date('n');
|
/*** Photos du mois ***/
|
||||||
$an = date('Y');
|
|
||||||
$image = $mois . '_' . $an . '.jpg';
|
$album = 'photos-du-mois'; //Photos du mois
|
||||||
$annee = $an;
|
$images_du_mois = imagesFromZPAlbum($album, $connexion);
|
||||||
|
|
||||||
// nom des fichiers: 7_2009.jpg et non pas 07_2009.jpg
|
/*
|
||||||
|
1_2018_40_cw40_ch40_thumb.jpg
|
||||||
for ($i = 0; $i <= 11 ; $i++) {
|
1_2018_80_cw80_ch80_thumb.jpg
|
||||||
$a = ($mois - $i);
|
1_2018_200_thumb.jpg thumb WP SD
|
||||||
if ($a < 1) {
|
1_2018_300_thumb.jpg
|
||||||
$a = (12 + $a);
|
1_2018_400_thumb.jpg thumb WP HD
|
||||||
$annee = $an - 1;
|
1_2018_800_clicclac.jpg image du mois SD
|
||||||
}
|
1_2018_w1400_h550_thumb.jpg
|
||||||
$tableau[$i] = $a . '_' . $annee . '.jpg';
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
|
$watermark = "_clicclac";
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < 13) {
|
while ($i < 13) {
|
||||||
$file = '../zenphoto/albums/photos-du-mois/' . $tableau[$i];
|
//$file = '../zenphoto/albums/photos-du-mois/' . $tableau[$i];
|
||||||
//echo $file;
|
$file = '../zenphoto/albums/photos-du-mois/' . $images_du_mois[$i]['filename'];
|
||||||
|
//$file = 'https://silverbook.local/zenphoto/albums/photos-du-mois/' . $images_du_mois[$i]['filename'];
|
||||||
|
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$photo_du_mois = $file;
|
//$photo_du_mois = $file;
|
||||||
$title = $tableau[$i];
|
//$title = $tableau[$i];
|
||||||
|
$filename = $images_du_mois[$i]['filename'];
|
||||||
|
|
||||||
$size = getimagesize($photo_du_mois, $info);
|
$size = getimagesize($file, $info);
|
||||||
//preprint($size);
|
//preprint($size);
|
||||||
|
|
||||||
if ($size[0] > 1000) {
|
if ($size[0] > 1000) {
|
||||||
// HD
|
// HD
|
||||||
$hd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_FULL_watermark.jpg";
|
//$hd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_FULL_watermark.jpg";
|
||||||
|
$hd = $file;
|
||||||
if (file_exists($hd)) {
|
if (file_exists($hd)) {
|
||||||
$size_hd = getimagesize($hd, $info_hd);
|
$size_hd = getimagesize($hd, $info_hd);
|
||||||
$imgs['img_hd'] = array(
|
$imgs['img_hd'] = array(
|
||||||
'url' => $hd,
|
'url' => "../" . $hd,
|
||||||
'width' => $size_hd[0],
|
'width' => $size_hd[0],
|
||||||
'height' => $size_hd[1]
|
'height' => $size_hd[1]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
else {
|
else {
|
||||||
$imgs['img_hd'] = array(
|
$imgs['img_hd'] = array(
|
||||||
'url' => '../' . $photo_du_mois,
|
'url' => '../' . $photo_du_mois,
|
||||||
@@ -125,24 +128,29 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
'height' => $size[1]
|
'height' => $size[1]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// SD
|
// SD
|
||||||
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
|
|
||||||
|
// 12_2017_800_clicclac.jpg
|
||||||
|
|
||||||
|
$sd = '../zenphoto/cache/photos-du-mois/' . substr($filename, 0, strlen($filename) - 4) . "_800" . $watermark . ".jpg";
|
||||||
if (file_exists($sd)) {
|
if (file_exists($sd)) {
|
||||||
$size_sd = getimagesize($sd, $info_sd);
|
$size_sd = getimagesize($sd, $info_sd);
|
||||||
$imgs['img_sd'] = array(
|
$imgs['img_sd'] = array(
|
||||||
'url' => $sd,
|
'url' => "../" . $sd,
|
||||||
'width' => $size_sd[0],
|
'width' => $size_sd[0],
|
||||||
'height' => $size_sd[1]
|
'height' => $size_sd[1]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
// SD
|
// SD
|
||||||
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
|
$sd = '../zenphoto/cache/photos-du-mois/' . substr($filename, 0, strlen($filename) - 4) . "_800" . $watermark . ".jpg";
|
||||||
if (file_exists($sd)) {
|
if (file_exists($sd)) {
|
||||||
$size_sd = getimagesize($sd, $info_sd);
|
$size_sd = getimagesize($sd, $info_sd);
|
||||||
$imgs['img_sd'] = array(
|
$imgs['img_sd'] = array(
|
||||||
'url' => $sd,
|
'url' => "../" . $sd,
|
||||||
'width' => $size_sd[0],
|
'width' => $size_sd[0],
|
||||||
'height' => $size_sd[1]
|
'height' => $size_sd[1]
|
||||||
);
|
);
|
||||||
@@ -154,18 +162,57 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
);
|
);
|
||||||
} // if ($size[0] > 1000)
|
} // if ($size[0] > 1000)
|
||||||
|
|
||||||
$title = explode('.',$title);
|
|
||||||
$title = explode('_',$title[0]);
|
foreach ($images_du_mois[$i] as $key => $val) {
|
||||||
$title = mois2($title[0]) . ' ' . $title[1];
|
$imgs[$key] = $val;
|
||||||
$imgs['img_sd']['title'] = $title;
|
}
|
||||||
|
|
||||||
if (isset($info["APP13"])) {
|
// Ajouter les tags
|
||||||
$iptc = iptcparse($info["APP13"]);
|
|
||||||
|
// Présentation Title et Desc
|
||||||
|
|
||||||
|
//preprint($imgs);
|
||||||
|
|
||||||
if (isset($iptc['2#120'][0])) $legende = $iptc['2#120'][0];
|
/*
|
||||||
else $legende = "";
|
Array
|
||||||
if (isset($iptc['2#005'][0])) $titre = $iptc['2#005'][0];
|
(
|
||||||
else $titre = "";
|
[img_hd] => Array
|
||||||
|
(
|
||||||
|
[url] => ../../zenphoto/albums/photos-du-mois/11_2018.jpg
|
||||||
|
[width] => 1600
|
||||||
|
[height] => 1067
|
||||||
|
)
|
||||||
|
|
||||||
|
[img_sd] => Array
|
||||||
|
(
|
||||||
|
[url] => ../../zenphoto/cache/photos-du-mois/11_2018_800_clicclac.jpg
|
||||||
|
[width] => 800
|
||||||
|
[height] => 534
|
||||||
|
)
|
||||||
|
|
||||||
|
[filename] => 11_2018.jpg
|
||||||
|
[EXIFModel] => Canon EOS-1D Mark IV
|
||||||
|
[EXIFDateTimeOriginal] => 2018:11:04 11:05:09
|
||||||
|
[EXIFExposureTime] => 1/2000 sec
|
||||||
|
[EXIFFNumber] => f/7,1
|
||||||
|
[EXIFISOSpeedRatings] => 500
|
||||||
|
[EXIFFocalLength] => 700 mm
|
||||||
|
[EXIFLensInfo] => EF500mm f/4L IS USM +1.4x
|
||||||
|
[EXIFGPSLatitude] =>
|
||||||
|
[EXIFGPSLatitudeRef] =>
|
||||||
|
[EXIFGPSLongitude] =>
|
||||||
|
[EXIFGPSLongitudeRef] =>
|
||||||
|
[EXIFGPSAltitude] =>
|
||||||
|
[EXIFGPSAltitudeRef] =>
|
||||||
|
[desc] =>
|
||||||
|
[title] => 11_2018
|
||||||
|
[exif] => Le 04.11.2018 à 11:05 - 1/2000 sec à f/7,1 - 500 ISO - Focale700 mm
|
||||||
|
[exif+] => Canon EOS-1D Mark IV - EF500mm f/4L IS USM +1.4x
|
||||||
|
[gps] =>
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
$keyword = "";
|
$keyword = "";
|
||||||
if (isset($iptc['2#025'])) {
|
if (isset($iptc['2#025'])) {
|
||||||
@@ -176,23 +223,21 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
$keyword = substr($keyword, 0, -2);
|
$keyword = substr($keyword, 0, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$imgs['img_sd']['legende'] = $legende;
|
|
||||||
$imgs['img_sd']['titre'] = $titre;
|
|
||||||
$imgs['img_sd']['keyword'] = $keyword;
|
$imgs['img_sd']['keyword'] = $keyword;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
$exifInfo = "";
|
|
||||||
$exif_array = read_exif_data_raw($file,'EXIF');
|
$exifInfo = "";
|
||||||
$exifInfo = __('The','toppic-child') . " " .date(__("F j, Y, g:i a",'toppic-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
|
$exifInfo = __('The','toppic-child') . " " .date(__("F j, Y, g:i a",'toppic-child'),strtotime($imgs['EXIFDateTimeOriginal'])).' - ';
|
||||||
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','toppic-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','toppic-child') .$exif_array['SubIFD']['FocalLength'];
|
$exifInfo .= $imgs['EXIFExposureTime'] . __(' at ','toppic-child') . $imgs['EXIFFNumber'] .' - ' . $imgs['EXIFISOSpeedRatings'] .' ISO - ' . __('Focal','toppic-child') .$imgs['EXIFFocalLength'];
|
||||||
$imgs['img_sd']['exif'] = $exifInfo;
|
$imgs['exif'] = $exifInfo;
|
||||||
|
$imgs['exif+'] = $imgs['EXIFModel'] . ' - ' . $imgs['EXIFLensInfo'];
|
||||||
|
$imgs['gps'] = '';
|
||||||
|
|
||||||
//preprint($exif_array);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
//preprint($imgs);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -202,42 +247,28 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
|
|
||||||
<div class="cadre">
|
<div class="cadre">
|
||||||
|
|
||||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
<?php if (($imgs['title'] != "") || ($imgs['desc'] != "")) { ?>
|
||||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
<p class="titrePhoto"><?php echo $imgs['title']; ?></p>
|
||||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
<p class="legendePhoto"><?php echo $imgs['desc']; ?></p>
|
||||||
<?php } ?>
|
<?php }
|
||||||
|
|
||||||
<!--img src="watermark2.php?src=<?php echo $photo_du_mois; ?>" alt="Image du mois" title="<?php echo $title; ?>" <?php echo $size[3]; ?> /-->
|
|
||||||
|
|
||||||
<!-- Retina -->
|
|
||||||
<?php
|
|
||||||
if (($imgs['img_sd']['url'] != "") && ($imgs['img_hd']['url'] != "")) {
|
if (($imgs['img_sd']['url'] != "") && ($imgs['img_hd']['url'] != "")) {
|
||||||
$standard_source = $imgs['img_sd']['url'] . ', ' . $imgs['img_hd']['url'] . ' 2x';
|
$standard_source = $imgs['img_sd']['url'] . ' 800w, ' . $imgs['img_hd']['url'] . ' 1600w';
|
||||||
//echo "1";
|
|
||||||
}
|
}
|
||||||
else if ($imgs['img_sd']['url'] != "") {
|
else if ($imgs['img_sd']['url'] != "") {
|
||||||
$standard_source = $imgs['img_sd']['url'];
|
$standard_source = $imgs['img_sd']['url'] . ' 800w';
|
||||||
//echo "2";
|
|
||||||
}
|
}
|
||||||
else if ($imgs['img_hd']['url'] != "") {
|
else if ($imgs['img_hd']['url'] != "") {
|
||||||
$standard_source = $imgs['img_hd']['url'] . ' 2x';
|
$standard_source = $imgs['img_hd']['url'] . ' 1600w';
|
||||||
//echo "3";
|
|
||||||
}
|
}
|
||||||
//echo $standard_source;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<picture data-picture data-alt="">
|
$display = '<a href="' . $imgs['img_hd']['url'] .'" title="'.$imgs['title'].'" class="kk-lightbox">';
|
||||||
<!--[if IE 9]><video style="display: none;"><![endif]-->
|
$display .= "<img width='" . $imgs['img_sd']['width'] . "' height='" . $impgs['img_sd']['height'] . "' src='" . $imgs['img_sd']['url'] . "' class='' alt='' srcset='" . $standard . "' sizes='(max-width: 800px) 100vw, 800px' />";
|
||||||
<source class="image_standard" srcset="<?php echo $standard_source; ?>">
|
$display .= '</a>';
|
||||||
<!--source class="image_medium" srcset="" media="(max-width: 767px)">
|
|
||||||
<source class="image_small" srcset="" media="(max-width: 767px)"-->
|
echo $display;
|
||||||
<!--[if IE 9]></video><![endif]-->
|
?>
|
||||||
<?php
|
|
||||||
echo '<img srcset="' . $imgs['img_sd']['url'] . '" alt="" width="'. $imgs['img_sd']['width'] . '" height="'. $imgs['img_sd']['height'] .'" />';
|
|
||||||
?>
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
<!-- /Retina -->
|
|
||||||
|
|
||||||
</div><!-- /cadre -->
|
</div><!-- /cadre -->
|
||||||
|
|
||||||
@@ -246,84 +277,13 @@ $bg_title_img = $kk_parallax[1];
|
|||||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<p class="exifs"><?php echo $imgs['img_sd']['exif']; ?></p>
|
<p class="exifs"><?php echo $imgs['exif']; ?></p>
|
||||||
|
|
||||||
<!-- /image du mois -->
|
<!-- /image du mois -->
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
|
||||||
|
|
||||||
$album = 'photos-du-mois'; //Photos du mois
|
|
||||||
$table = array();
|
|
||||||
if ($_SERVER['HTTP_HOST'] == "silverbook.local") {
|
|
||||||
$table['images'] = ".images";
|
|
||||||
$table['albums'] = ".albums";
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
|
|
||||||
$table['images'] = "zp_images";
|
|
||||||
$table['albums'] = "zp_albums";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
|
|
||||||
$table['images'] = "zenphoto_images";
|
|
||||||
$table['albums'] = "zenphoto_albums";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupérer l'ID de l'album 'photos-du-mois' ($id_album)
|
|
||||||
$i = 0;
|
|
||||||
$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");
|
|
||||||
|
|
||||||
$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' ($fichier[])
|
|
||||||
|
|
||||||
$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();
|
|
||||||
|
|
||||||
//
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$aide = "<span class='aide'> ? </span><b>Utilisation:</b> cliquer sur une vignette, puis....<br />";
|
$aide = "<span class='aide'> ? </span><b>Utilisation:</b> cliquer sur une vignette, puis....<br />";
|
||||||
$aide .= " <b><i>-sur ordinateur:</i></b> naviguer avec les touches flèches droite et gauche, quitter avec ESC.<br />";
|
$aide .= " <b><i>-sur ordinateur:</i></b> naviguer avec les touches flèches droite et gauche, quitter avec ESC.<br />";
|
||||||
@@ -336,15 +296,23 @@ $aide .= " <b><i>-sur tablettes et smartphones:</i></b> balayer l'écran avec un
|
|||||||
<!--h4><?php echo gettext("Archives"); ?> <span class='aide'><a href="#" title="<?php echo $aide; ?>" class="tooltip"><span title="<?php echo gettext("Help"); ?>">( ? )</span></a></span></h4-->
|
<!--h4><?php echo gettext("Archives"); ?> <span class='aide'><a href="#" title="<?php echo $aide; ?>" class="tooltip"><span title="<?php echo gettext("Help"); ?>">( ? )</span></a></span></h4-->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$album = 'photos-du-mois'; //Photos du mois
|
||||||
|
//$fichier = imagesFromZPAlbum($album, $connexion);
|
||||||
|
//preprint($images_du_mois);
|
||||||
|
|
||||||
$debut = (($ppage - 1) * $nb) +1; // page 1: 2, page 2: 14, page 3: 26
|
$debut = (($ppage - 1) * $nb) +1; // page 1: 2, page 2: 14, page 3: 26
|
||||||
$fin = ($debut + $nb) - 1;
|
$fin = ($debut + $nb) - 1;
|
||||||
/**/
|
/**/
|
||||||
for ($j=$debut; $j<=$fin; $j++) {
|
for ($j=$debut; $j<=$fin; $j++) {
|
||||||
|
/*
|
||||||
if ($j <= count($fichier)-1) echo displayRetina($fichier[$j],$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+1 <= count($fichier)-1) echo displayRetina($fichier[$j+1],$album);
|
||||||
if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album);
|
if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album);
|
||||||
|
*/
|
||||||
|
if ($j <= count($images_du_mois)-1) echo displayRetina($images_du_mois[$j],$album);
|
||||||
|
if ($j+1 <= count($images_du_mois)-1) echo displayRetina($images_du_mois[$j+1],$album);
|
||||||
|
if ($j+2 <= count($images_du_mois)-1) echo displayRetina($images_du_mois[$j+2],$album);
|
||||||
|
|
||||||
$j = $j + 2;
|
$j = $j + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,7 +327,7 @@ for ($j=$debut; $j<=$fin; $j++) {
|
|||||||
<?php
|
<?php
|
||||||
/**/
|
/**/
|
||||||
// calcul du nombre de pages (arrondi a l'entier superieur)
|
// calcul du nombre de pages (arrondi a l'entier superieur)
|
||||||
$nbpages = ceil(count($fichier) / 12);
|
//$nbpages = ceil(count($fichier) / 12);
|
||||||
$prec = $ppage - 1;
|
$prec = $ppage - 1;
|
||||||
$suiv = $ppage + 1;
|
$suiv = $ppage + 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user