ce-mois.php
This commit is contained in:
691
ce-mois.php
Normal file
691
ce-mois.php
Normal file
@@ -0,0 +1,691 @@
|
||||
<?php header("Content-type: text/html; charset=utf-8");
|
||||
/*
|
||||
ce-mois.php (thème Photoblog2)
|
||||
v2 (10-05-2014): MySQLi - Retina(PictureFill) -
|
||||
*/
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
define('SERVERPATH',$root.'/zenphoto');
|
||||
//define('WEBPATH','/'.basename(dirname(__FILE__)).'/zenphoto');
|
||||
require_once(SERVERPATH.'/zp-core/template-functions.php');
|
||||
//$host = 'http://' . $_SERVER['HTTP_HOST'];
|
||||
if (isset($_SERVER['HTTPS'])) {
|
||||
if ($_SERVER['HTTPS'] == 'on') $secure = 1;
|
||||
else $secure = 0;
|
||||
}
|
||||
else $secure = 0;
|
||||
|
||||
$host = (($secure == 1) ? 'https' : "http") . '://' . $_SERVER['HTTP_HOST'];
|
||||
//$host = (($_SERVER['HTTPS'] != "") ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'];
|
||||
|
||||
include($root.'/lib2/localize.php');
|
||||
$dir_locales = $root . '/locales';
|
||||
|
||||
$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 = 'clicclac';
|
||||
putenv('LC_ALL=' . $langue);
|
||||
$loc = setlocale(LC_ALL, $langue);
|
||||
bindtextdomain($domain, $root . '/locales/');
|
||||
bind_textdomain_codeset($domain, 'UTF-8'); //nécessaire pour clicclac.info, pas pour macbook.local
|
||||
textdomain($domain);
|
||||
gettext("Enter");
|
||||
//$nation = array('fr_FR' => 'Français', 'en_US' => 'English' , 'de_DE' => 'German', 'es_ES' => 'Spanish' );
|
||||
$nation = array('fr_FR' => gettext('French'), 'en_US' => gettext('English') , 'de_DE' => gettext('German'), 'es_ES' => gettext('Spanish') );
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head profile="http://gmpg.org/xfn/11">
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="description" content="blabla" />
|
||||
<meta name="keywords" content="Photo, oiseaux, paysages, nature, animaux, moto, superbike, motogp" />
|
||||
<meta name="language" content="fr" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta name="robots" content="follow, all" />
|
||||
|
||||
<title><?php echo gettext("Photo of the month..."); ?></title>
|
||||
|
||||
<link rel="Shortcut Icon" href="<?php echo $host; ?>/photoblog/images/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<link rel="alternate" type="application/rss+xml" title="Blog RSS 2.0" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/?feed=rss2" />
|
||||
<link rel="alternate" type="text/xml" title="Blog RSS .92" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/?feed=rss" />
|
||||
<link rel="alternate" type="application/atom+xml" title="Blog Atom 0.3" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/?feed=atom" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS de la galerie" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/zenphoto/rss.php" />
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
||||
<script>document.cookie='resolution='+(Math.max(screen.width,screen.height)*("devicePixelRatio" in window ? devicePixelRatio : 1))+'; path=/';</script>
|
||||
|
||||
<!--link rel="stylesheet" href="http://<?php echo $_SERVER['HTTP_HOST'] . '/zenphoto/themes/photoblog/styles/photoblog.css'; ?>" type="text/css" /-->
|
||||
<style type="text/css" media="screen">
|
||||
<!-- @import url( <?php echo $host; ?>/wordpress/wp-content/themes/twentyten/style.css ); -->
|
||||
<!-- @import url( <?php echo $host; ?>/wordpress/wp-content/themes/twentyten-child/style.css ); -->
|
||||
<!-- @import url( <?php echo $host; ?>/photoblog/photoblog.css ); -->
|
||||
</style>
|
||||
<!–-[if lt IE 8]>
|
||||
<!--link rel="stylesheet" type="text/css" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/wordpress/wp-content/themes/twentyten-child/ie.css" /-->
|
||||
<![endif]-–>
|
||||
|
||||
<!--link rel="stylesheet" type="text/css" href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/js/shadowbox-3/shadowbox.css">
|
||||
<script type="text/javascript" src="http://<?php echo $_SERVER['HTTP_HOST']; ?>/js/shadowbox-3/shadowbox.js"></script>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
language: "fr",
|
||||
players: ["img,swf,flv,qt,wmp;iframe,html"],
|
||||
animate: false,
|
||||
slideshowDelay: 4,
|
||||
initialWidth: 800,
|
||||
initialHeight: 600,
|
||||
counterType: 'skip',
|
||||
counterLimit: 12,
|
||||
handleUnsupported: 'remove'
|
||||
});
|
||||
</script-->
|
||||
<!-- http://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly -->
|
||||
<script src="js/tooltip.js"></script>
|
||||
<!-- SwipeBox http://brutaldesign.github.io/swipebox/
|
||||
Voir aussi FancyBox 3 http://fancyapps.com/fancybox/beta/
|
||||
-->
|
||||
<script src="js/swipebox/jquery.swipebox.js"></script>
|
||||
<link rel="stylesheet" href="js/swipebox/swipebox.css">
|
||||
<script type="text/javascript">
|
||||
/**/
|
||||
jQuery(function($) {
|
||||
$(".swipebox").swipebox({
|
||||
hideBarsDelay : 3000 // 0 to always show caption and action bar
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
/*found on http://www.brunildo.org/test/img_center.html*/
|
||||
.wraptocenter {
|
||||
display: table-cell!important;
|
||||
text-align: center!important;
|
||||
vertical-align: middle!important;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
.wraptocenter * {
|
||||
vertical-align: middle!important;
|
||||
}
|
||||
/*\*//*/
|
||||
.wraptocenter {
|
||||
display: block;
|
||||
}
|
||||
.wraptocenter span {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
width: 1px;
|
||||
}
|
||||
/**/
|
||||
</style>
|
||||
<!--[if IE]><style>
|
||||
.wraptocenter span {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
}
|
||||
</style><![endif]-->
|
||||
|
||||
|
||||
<?php
|
||||
include('exifer/exif.php');
|
||||
|
||||
function exif_date($date,$apn) {
|
||||
//'Model' => string 'Canon EOS 50D' (length=13)
|
||||
//50D: 'DateTimeOriginal' => string '2009:12:05 12:42:33' (length=19)
|
||||
|
||||
//'Model' => string 'Canon EOS 7D' (length=12)
|
||||
//7D: DateTimeOriginal' => string '2010-02-20T15:07:05.24+01:00' (length=28)
|
||||
|
||||
// -> 50D
|
||||
if (!preg_match("/7D/", $apn)) {
|
||||
$pieces = explode(' ', $date);
|
||||
list($yy, $mm, $dd) = explode(':', $pieces[0]);
|
||||
list($hh, $min, $ss) = explode(':', $pieces[1]);
|
||||
}
|
||||
// 7D
|
||||
else {
|
||||
$pieces = explode('T', $date);
|
||||
list($yy, $mm, $dd) = explode('-', $pieces[0]);
|
||||
$pieces_h = explode('.', $pieces[1]);
|
||||
list($hh, $min, $ss) = explode(':', $pieces_h[0]);
|
||||
}
|
||||
$timestamp = mktime((int) $hh, (int) $min, (int) $ss, (int) $mm, (int) $dd, (int) $yy, '-1');
|
||||
$date = date('d.m.Y à H:i',$timestamp);
|
||||
return $date;
|
||||
}
|
||||
function mois2 ($mois) {
|
||||
switch ($mois)
|
||||
{
|
||||
case 00:
|
||||
$mois = "00";
|
||||
break;
|
||||
case 1:
|
||||
$mois = gettext("January");
|
||||
break;
|
||||
case 2:
|
||||
$mois = gettext("February");
|
||||
break;
|
||||
case 3:
|
||||
$mois = gettext("March");
|
||||
break;
|
||||
case 4:
|
||||
$mois = gettext("April");
|
||||
break;
|
||||
case 5:
|
||||
$mois = gettext("May");
|
||||
break;
|
||||
case 6:
|
||||
$mois = gettext("June");
|
||||
break;
|
||||
case 7:
|
||||
$mois = gettext("July");
|
||||
break;
|
||||
case 8:
|
||||
$mois = gettext("August");
|
||||
break;
|
||||
case 9:
|
||||
$mois = gettext("September");
|
||||
break;
|
||||
case 10:
|
||||
$mois = gettext("October");
|
||||
break;
|
||||
case 11:
|
||||
$mois = gettext("November");
|
||||
break;
|
||||
case 12:
|
||||
$mois = gettext("December");
|
||||
break;
|
||||
}
|
||||
return $mois;
|
||||
}
|
||||
|
||||
function display ($filename,$album) {
|
||||
$display = '<div class="album">'.
|
||||
'<div class="thumb">' .
|
||||
'<a href="../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="wraptocenter swipebox" />'.
|
||||
'<img src="../zenphoto/zp-core/i.php?a='.$album.'&i='.$filename.'&s=180" class="img_archive" />'.
|
||||
'</a>'.
|
||||
'</div>'.
|
||||
'<div class="albumdesc">'.
|
||||
'<a href="../zenphoto/index.php?album='.$album.'&image='.$filename.'" title= "'.date_archive($filename).'" class="" />'.
|
||||
'<span class="exif">'.date_archive($filename).'</span>'.
|
||||
'</a></div>'.
|
||||
'</div>';
|
||||
return $display;
|
||||
}
|
||||
|
||||
function displayRetina ($filename,$album) {
|
||||
// 6_2012.jpg
|
||||
// 4_2014_180_thumb.jpg 4_2014_360_thumb.jpg
|
||||
$path = "../zenphoto/cache/" . $album . "/";
|
||||
$file = explode(".", $filename);
|
||||
|
||||
//$a = $path . $filename;
|
||||
//echo $a;
|
||||
|
||||
|
||||
$file_sd = $path . $file[0] . "_180_thumb.jpg";
|
||||
$file_hd = $path . $file[0] . "_360_thumb.jpg";
|
||||
/*
|
||||
$file_sd = $path . $file[0] . "_180_watermark.jpg";
|
||||
$file_hd = $path . $file[0] . "_360_watermark.jpg";
|
||||
*/
|
||||
//
|
||||
$th_sd = false;
|
||||
$th_hd = false;
|
||||
|
||||
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]
|
||||
);
|
||||
}
|
||||
//preprint($thumb);
|
||||
|
||||
if (($th_sd == true) && ($th_hd == true)) {
|
||||
$standard = $thumb['sd']['url'] . ', ' . $thumb['hd']['url'] . ' 2x';
|
||||
}
|
||||
elseif ($th_sd == true) {
|
||||
$standard = $thumb['sd']['url'];
|
||||
}
|
||||
elseif ($th_hd == true) {
|
||||
$standard = $thumb['hd']['url'] . ' 2x';
|
||||
}
|
||||
|
||||
$display = '<div class="album">';
|
||||
$display .= '<div class="thumb">';
|
||||
$display .= '<a href="../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="wraptocenter swipebox" />';
|
||||
|
||||
$display .= '<picture data-picture data-alt="">';
|
||||
$display .= '<!--[if IE 9]><video style="display: none;"><![endif]-->';
|
||||
$display .= '<source class="image_standard" srcset="' . $standard . '">';
|
||||
|
||||
//$display .= '<img src="../zenphoto/zp-core/i.php?a='.$album.'&i='.$filename.'&s=180" class="img_archive" />';
|
||||
|
||||
$display .= '<!--[if IE 9]></video><![endif]-->';
|
||||
$display .= '<img srcset="' . $thumb['sd']['url'] . '" width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"alt="">';
|
||||
$display .= '</picture>';
|
||||
|
||||
$display .= '</a>';
|
||||
$display .= '</div>';
|
||||
$display .= '<div class="albumdesc">';
|
||||
$display .= '<a href="../zenphoto/index.php?album='.$album.'&image='.$filename.'" title= "'.date_archive($filename).'" class="" />';
|
||||
$display .= '<span class="exif">'.date_archive($filename).'</span>';
|
||||
$display .= '</a></div>';
|
||||
$display .= '</div>';
|
||||
return $display;
|
||||
}
|
||||
|
||||
function get_image_title ($photo) {
|
||||
$photo = '../zenphoto/albums/photos-du-mois/' . $photo;
|
||||
$size = getimagesize($photo, $info);
|
||||
if (isset($info["APP13"])) {
|
||||
$iptc = iptcparse($info["APP13"]);
|
||||
//print_r($iptc);
|
||||
$caption = isset($iptc['2#120'][0]);
|
||||
$graphic_name = isset($iptc['2#005'][0]);
|
||||
}
|
||||
return $caption;
|
||||
}
|
||||
|
||||
function date_archive ($chaine) {
|
||||
$pieces = explode(".", $chaine);
|
||||
$b = explode("_", $pieces[0]);
|
||||
$mois = $b[0];
|
||||
$an = $b[1];
|
||||
$chaine = mois2($mois) . ' '. $an;
|
||||
return $chaine;
|
||||
}
|
||||
function preprint($s, $return=false) {
|
||||
$x = "<pre>";
|
||||
$x .= print_r($s, 1);
|
||||
$x .= "</pre>";
|
||||
if ($return) return $x;
|
||||
else print $x;
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
// Picture element HTML5 shiv
|
||||
document.createElement( "picture" );
|
||||
</script>
|
||||
<script src="<?php echo $host; ?>/photoblog/js/picturefill.min.js" async></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="now">
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<div id="header">
|
||||
<div id="logo">
|
||||
<div id="site-name">
|
||||
<a href="index.php" title="ClicClac.info" rel="home">ClicClac.info</a>
|
||||
</div>
|
||||
<div id="site-description"><?php echo gettext("Now"); ?></div>
|
||||
</div>
|
||||
<div id="pagenav">
|
||||
<ul id="menu-principal" class="menu">
|
||||
|
||||
<li><a href="ce-mois.php"><?php echo gettext("Now"); ?></a></li>
|
||||
<li><a href="/wordpress/"><?php echo gettext("Blog"); ?></a></li>
|
||||
<li><a href="/zenphoto/"><?php echo gettext("Gallery"); ?></a></li>
|
||||
<li><a href="/wordpress/livre_d-or/"><?php echo gettext("Guestbook"); ?></a></li>
|
||||
<li><a href="/wordpress/contact/"><?php echo gettext("Contact"); ?></a></li>
|
||||
<li><a href="/wordpress/liens/"><?php echo gettext("Links"); ?></a></li>
|
||||
|
||||
<!--En ce moment, Blog, Portfolio, Livre d’Or, Contact, Liens -->
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- /header -->
|
||||
|
||||
<div id="main">
|
||||
|
||||
<div id="padbox">
|
||||
<h2><?php echo gettext("Photo of the month..."); ?></h2>
|
||||
<?php
|
||||
$mois = date('n');
|
||||
$an = date('Y');
|
||||
$image = $mois . '_' . $an . '.jpg';
|
||||
$annee = $an;
|
||||
|
||||
// nom des fichiers: 7_2009.jpg et non pas 07_2009.jpg
|
||||
|
||||
for ($i = 0; $i <= 11 ; $i++) {
|
||||
$a = ($mois - $i);
|
||||
if ($a < 1) {
|
||||
$a = (12 + $a);
|
||||
$annee = $an - 1;
|
||||
}
|
||||
$tableau[$i] = $a . '_' . $annee . '.jpg';
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < 13) {
|
||||
$file = '../zenphoto/albums/photos-du-mois/' . $tableau[$i];
|
||||
//echo $file;
|
||||
|
||||
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 .= '<a href="' . $host . '/zenphoto/index.php?p=search&words=' . $val . '" title="Tag > ' . $val . '" rel="tag">' . $val . '</a>';
|
||||
$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);
|
||||
|
||||
?>
|
||||
|
||||
<div class="cadre">
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
||||
<?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'] != "")) {
|
||||
$standard_source = $imgs['img_sd']['url'] . ', ' . $imgs['img_hd']['url'] . ' 2x';
|
||||
//echo "1";
|
||||
}
|
||||
else if ($imgs['img_sd']['url'] != "") {
|
||||
$standard_source = $imgs['img_sd']['url'];
|
||||
//echo "2";
|
||||
}
|
||||
else if ($imgs['img_hd']['url'] != "") {
|
||||
$standard_source = $imgs['img_hd']['url'] . ' 2x';
|
||||
//echo "3";
|
||||
}
|
||||
//echo $standard_source;
|
||||
?>
|
||||
|
||||
<picture data-picture data-alt="">
|
||||
<!--[if IE 9]><video style="display: none;"><![endif]-->
|
||||
<source class="image_standard" srcset="<?php echo $standard_source; ?>">
|
||||
<!--source class="image_medium" srcset="" media="(max-width: 767px)">
|
||||
<source class="image_small" srcset="" media="(max-width: 767px)"-->
|
||||
<!--[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>
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
||||
<?php } ?>
|
||||
|
||||
<p class="exifs"><?php echo $imgs['img_sd']['exif']; ?></p>
|
||||
|
||||
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
||||
|
||||
$album = 'photos-du-mois'; //Photos du mois
|
||||
$table = array();
|
||||
if ($_SERVER['HTTP_HOST'] == "macbook-pro.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'] == "www.funnymac.com") || ($_SERVER['HTTP_HOST'] == "clicclac.info")) {
|
||||
$table['images'] = "zenphoto_images";
|
||||
$table['albums'] = "zenphoto_albums";
|
||||
}
|
||||
|
||||
// Récupérer l'ID de l'album 'photos-du-mois'
|
||||
$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'
|
||||
|
||||
$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
|
||||
$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 tablettes et smartphones:</i></b> 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.";
|
||||
?>
|
||||
|
||||
<div id="archive">
|
||||
<p style="clear: both; "></p>
|
||||
<h4><?php echo gettext("Archives"); ?> (<abbr title="<?php echo $aide; ?>" rel="tooltip"> ? </abbr>)</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
|
||||
//nb d'archive par page
|
||||
$nb = 12;
|
||||
|
||||
if (!isset($_GET['page'])) $page = 1;
|
||||
// sinon on recupere la valeur numerique recue en paramètre
|
||||
else $page = intval($_GET['page']);
|
||||
|
||||
// on determine debut du limit
|
||||
$debut = (($page - 1) * $nb) +1; // page 1: 2, page 2: 14, page 3: 26
|
||||
$fin = ($debut + $nb) - 1;
|
||||
/*
|
||||
echo count($fichier) . "<br>";
|
||||
echo $debut . "<br>";
|
||||
echo $fin . "<br>";
|
||||
echo $page . "<br>";
|
||||
*/
|
||||
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;
|
||||
}
|
||||
?>
|
||||
|
||||
<p style="clear: both; "></p>
|
||||
|
||||
<?php
|
||||
// calcul du nombre de pages (arrondi a l'entier superieur)
|
||||
$nbpages = ceil(count($fichier) / 12);
|
||||
$prec = $page - 1;
|
||||
$suiv = $page + 1;
|
||||
|
||||
if ($page >= 2) echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$prec.'" title="'.gettext("Previous Page").'">« '.gettext("prev").'</a> ';
|
||||
for ($i = 1; $i <= $nbpages; $i++) {
|
||||
if ($i != $page) {
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a> ';
|
||||
}
|
||||
else {
|
||||
echo "<span class='gras'>".$i."</span> ";
|
||||
}
|
||||
}
|
||||
if ($page < $nbpages) echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$suiv.'" title="'.gettext("Next Page").'">'.gettext("next").' »</a> ';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> <!-- wrapper -->
|
||||
|
||||
|
||||
<div id="credit">
|
||||
<?php
|
||||
$host = $_SERVER["HTTP_HOST"];
|
||||
//if (($host == "macbook.local") or ($host == "localhost")) $license = "?page_id=122";
|
||||
//if ($host == "clicclac.info") $license = "license-des-photos";
|
||||
$license = "license-des-photos";
|
||||
?>
|
||||
|
||||
<div id="choose_lang">
|
||||
<?php echo choose_lang(gettext('Select language'),$liste_locale, $get=0, $post=-1); ?>
|
||||
</div>
|
||||
© <?php echo $_SERVER['HTTP_HOST']; ?> | <a href="http://<?php echo $_SERVER["HTTP_HOST"] . '/wordpress/' . $license; ?>" title="<?php echo gettext("Photo's licence"); ?>"><?php echo gettext("Photo's licence"); ?></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user