Single v1
-commentaires cachés -settings -3 lightbox -enqueue js et css
This commit is contained in:
@@ -12,10 +12,20 @@ get_header();
|
||||
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
define('SERVERPATH',$root.'/zenphoto');
|
||||
//define('WEBPATH','/'.basename(dirname(__FILE__)).'/zenphoto');
|
||||
//require_once(SERVERPATH.'/zp-core/template-functions.php');
|
||||
include('../photoblog/exifer/exif.php');
|
||||
|
||||
//nb d'archive par page
|
||||
$nb = 12;
|
||||
global $ppage;
|
||||
|
||||
$url = $_SERVER[REDIRECT_URL];
|
||||
$a = explode("/", $url);
|
||||
$pages = end($a);
|
||||
$pages = prev($a);
|
||||
|
||||
if ($pages != get_page_uri()) $ppage = $pages;
|
||||
else $ppage = "1";
|
||||
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
@@ -43,16 +53,13 @@ include('../photoblog/exifer/exif.php');
|
||||
}
|
||||
$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 "<br />" ."file exist: " . $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];
|
||||
|
||||
@@ -148,6 +155,8 @@ include('../photoblog/exifer/exif.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($ppage == "1") { ?>
|
||||
|
||||
<div class="cadre">
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
@@ -187,7 +196,7 @@ include('../photoblog/exifer/exif.php');
|
||||
|
||||
<!-- /Retina -->
|
||||
|
||||
</div>
|
||||
</div><!-- /cadre -->
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
||||
@@ -196,6 +205,7 @@ include('../photoblog/exifer/exif.php');
|
||||
|
||||
<p class="exifs"><?php echo $imgs['img_sd']['exif']; ?></p>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
||||
@@ -237,7 +247,6 @@ require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
||||
|
||||
$conn->close();
|
||||
|
||||
|
||||
// Récupérer toutes les fichiers de l'album 'photos-du-mois' ($fichier[])
|
||||
|
||||
$conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable);
|
||||
@@ -281,40 +290,15 @@ $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-->
|
||||
|
||||
<?php
|
||||
//nb d'archive par page
|
||||
$nb = 12;
|
||||
global $page;
|
||||
|
||||
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
|
||||
$debut = (($ppage - 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++) {
|
||||
|
||||
//$fin = (($start + $epp) -1);
|
||||
//for ($j=($start + 1); $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]; // 9_2015.jpg
|
||||
|
||||
$j = $j + 2;
|
||||
}
|
||||
?>
|
||||
@@ -322,27 +306,27 @@ for ($j=$debut; $j<=$fin; $j++) {
|
||||
<p style="clear: both; "></p>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="blog-pagination">
|
||||
|
||||
<?php
|
||||
/**/
|
||||
// calcul du nombre de pages (arrondi a l'entier superieur)
|
||||
$nbpages = ceil(count($fichier) / 12);
|
||||
$prec = $page - 1;
|
||||
$suiv = $page + 1;
|
||||
$prec = $ppage - 1;
|
||||
$suiv = $ppage + 1;
|
||||
|
||||
// $_SERVER[REQUEST_URI] -> /wordpress/ce-mois-ci/
|
||||
if ($ppage >= 2) echo '<a class="prev page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$prec.'" title="'.gettext("Previous Page").'"> ← </a> ';
|
||||
|
||||
|
||||
if ($page >= 2) echo '<a href="'.$_SERVER['REQUEST_URI'].'?page='.$prec.'" title="'.gettext("Previous Page").'">« '.gettext("prev").'</a> ';
|
||||
for ($i = 1; $i <= $nbpages; $i++) {
|
||||
if ($i != $page) {
|
||||
echo '<a href="'.$_SERVER['REQUEST_URI'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a> ';
|
||||
if ($i != $ppage) {
|
||||
echo '<a class="page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a> ';
|
||||
}
|
||||
else {
|
||||
echo "<span class='gras'>".$i."</span> ";
|
||||
echo "<span class='current page-numbers'>".$i."</span> ";
|
||||
}
|
||||
}
|
||||
if ($page < $nbpages) echo '<a href="'.$_SERVER['REQUEST_URI'].'?page='.$suiv.'" title="'.gettext("Next Page").'">'.gettext("next").' »</a> ';
|
||||
|
||||
if ($page < $nbpages) echo '<a class="next page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$suiv.'" title="'.gettext("Next Page").'"> → </a> ';
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user