From 1fa1f61d0eac172cb3b4bd26fcd9bd73500f8ba5 Mon Sep 17 00:00:00 2001 From: Bruno Pesenti Date: Tue, 27 Dec 2016 06:22:34 +0100 Subject: [PATCH] Page ce mois-ci (pagination ajax 1) https://www.sanwebe.com/2013/03/ajax-pagination-with-jquery-php --- -child/ce-mois.php.zip | Bin 0 -> 4709 bytes ce-mois-bis.php | 366 +++++++++++++++++++++++++++++++++++++++++ ce-mois.php | 240 +++++++++++++++++++++++++++ contact.php | 34 ++++ fetch_pages.php | 310 ++++++++++++++++++++++++++++++++++ footer-page.php | 13 ++ functions.php | 199 ++++++++++++++++++++++ header.php | 96 +++++++++++ languages/fr_FR.mo | Bin 1295 -> 2079 bytes languages/fr_FR.po | 135 ++++++++++++++- livre-d-or.php | 57 +++++++ style.css | 185 ++++++++++++++++++++- 12 files changed, 1631 insertions(+), 4 deletions(-) create mode 100644 -child/ce-mois.php.zip create mode 100755 ce-mois-bis.php create mode 100755 ce-mois.php create mode 100755 contact.php create mode 100755 fetch_pages.php create mode 100755 footer-page.php create mode 100755 header.php create mode 100755 livre-d-or.php diff --git a/-child/ce-mois.php.zip b/-child/ce-mois.php.zip new file mode 100644 index 0000000000000000000000000000000000000000..1aef582ee795f5c2b587c7bf5bee4045e6e87ecf GIT binary patch literal 4709 zcmaKwWmFWA={cpIqREZd@9d) zDskU#Py?(^=|wj7C7VeU@Y2XlKWex(x-}r@bd}NsI_wN#9|#4zWv5e5%!zu)+JH)jW;EQ349Xmx`|ZR&0;<-Zv$?yJ0?_r*{_u zQ%+;|Q%Om%t0$#WT&Z<7Z5iv|^|v{eMA!FQmg8yFQWdj5WzhiJUMb%$okLZ3yd9ke zcnCwn4mDoh9Nu!o#g%lf?AjCN_2Y->^s09!!uc4qikGN0d%wjlw4Tx8xu*9U;4hY6 z_dJwhNQM}Xy{KzoGVolN8x6}h2`7#X;P1&P&@ir}UN_)}2h)xAxZ}AUR5rsnRW#KL zSXAp5YtAGEM!A#DE)z{KsW9u|C9v+(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yycj!R!_cL~r z|A#-AL!O#jL(Cw@sw#TN_PtE8 zUX-WX)(`^q(XsE!tW1N7-?0^|m|RAbN7cU$D@T-y;P&(5;N)ZQg%w4~MtRYvdzInj z(Kxn}%!Cgx$c1mEkT8VZprMfr%oLLhqa!~EeRFv Qk7D5OK>Xf42>;yv0qPsA9RL6T literal 0 HcmV?d00001 diff --git a/ce-mois-bis.php b/ce-mois-bis.php new file mode 100755 index 0000000..0838828 --- /dev/null +++ b/ce-mois-bis.php @@ -0,0 +1,366 @@ + + +
+
+
+ +
> +

+ +
+ + " ."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]; + + $size = getimagesize($photo_du_mois, $info); + //preprint($size); + + 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 .= ''; + $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 = __('The','CreatorThemeRes-child') . " " .date(__("F j, Y, g:i a",'CreatorThemeRes-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - '; + $exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','CreatorThemeRes-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','CreatorThemeRes-child') .$exif_array['SubIFD']['FocalLength']; + $imgs['img_sd']['exif'] = $exifInfo; + + + break; + } + $i++; + } + //preprint($imgs); + + ?> + +
+ + +

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' ($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(); + + // +?> + + ? 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++) { + +//$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; + } +?> + +

+ + + + +
+ +
+ +
+ +
+ +
+
+
+
+ \ No newline at end of file diff --git a/ce-mois.php b/ce-mois.php new file mode 100755 index 0000000..4ad09e6 --- /dev/null +++ b/ce-mois.php @@ -0,0 +1,240 @@ + + +
+
+
+ +
> +

+ +
+ + " ."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]; + + $size = getimagesize($photo_du_mois, $info); + //preprint($size); + + 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 .= ''; + $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 = __('The','CreatorThemeRes-child') . " " .date(__("F j, Y, g:i a",'CreatorThemeRes-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - '; + $exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','CreatorThemeRes-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','CreatorThemeRes-child') .$exif_array['SubIFD']['FocalLength']; + $imgs['img_sd']['exif'] = $exifInfo; + + + break; + } + $i++; + } + //preprint($imgs); + + ?> + +
+ + +

Titre

+

Légende

+ + + + + + + + + + + + + '; + ?> + + + + +
+ + +

Titre

+

Légende

+ + +

+ + + ? 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."; +?> + +
+

+

( ? )

+ + + + +
+ + +
ajax-loader.gif" >
+
+ +
+ + + + +
+ +
+ +
+ +
+ +
+
+
+
+ \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100755 index 0000000..2dc96cf --- /dev/null +++ b/contact.php @@ -0,0 +1,34 @@ + +
+
+
+ +
> +

+ +
+
+ +
+ +
+ +
+
+
+
+ \ No newline at end of file diff --git a/fetch_pages.php b/fetch_pages.php new file mode 100755 index 0000000..231c412 --- /dev/null +++ b/fetch_pages.php @@ -0,0 +1,310 @@ +"; + $x .= print_r($s, 1); + $x .= ""; + if ($return) return $x; + else print $x; + } + +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 = ''; + */ + $display = '
'; + $display .= '
'; + $display .= ''; + $display .= ''; + $display .= ''; + $display .= ''; + $display .= '
'; + $display .= '
'; + $display .= ''; + $display .= ''.date_archive($filename).''; + $display .= '
'; + $display .= '
'; + return $display; + } + +function date_archive ($chaine) { + $pieces = explode(".", $chaine); + $b = explode("_", $pieces[0]); + $mois = $b[0]; + $an = $b[1]; + $chaine = mois2($mois) . ' '. $an; + return $chaine; + } + +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; + } + +//continue only if $_POST is set and it is a Ajax request +if(isset($_POST) && isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){ + + //include("config.inc.php"); //include config file + //require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php'); + $db_host = 'localhost'; + $db_username = 'root'; + $db_password = 'sncfp1p2'; + $db_name = 'zenphoto'; + $zptable = 'zenphoto'; + + $album = 'photos-du-mois'; //Photos du mois + $item_per_page = 12; //item to display per page + + $table = array(); + if ($_SERVER['HTTP_HOST'] == "macbook-pro.local") { + $table['images'] = ".images"; + $table['albums'] = ".albums"; + } + if ($_SERVER['HTTP_HOST'] == "clicclac.info") { + $table['images'] = "zenphoto_images"; + $table['albums'] = "zenphoto_albums"; + } + + $mysqli = new mysqli($db_host, $db_username, $db_password, $db_name); + //Output any connection error + if ($mysqli->connect_error) { + die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error); + } + + + // Récupérer l'ID de l'album 'photos-du-mois' ($id_album) + $i = 0; + $conn = new mysqli($db_host, $db_username, $db_password, $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(); + + + //Get page number from Ajax POST + if(isset($_POST["page"])){ + $page_number = filter_var($_POST["page"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number + if(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number + }else{ + $page_number = 1; //if there's no page number, set it to 1 + } + + //get total number of records from database for pagination + //$results = $mysqli->query("SELECT COUNT(*) FROM paginate"); + $results = $mysqli->query("SELECT COUNT(*) FROM `" . $table['images'] . "` WHERE `albumid` = $id_album "); + $get_total_rows = $results->fetch_row(); //hold total records in variable + + //break records into pages + $total_pages = ceil($get_total_rows[0]/$item_per_page); + + //get starting position to fetch the records + $page_position = (($page_number-1) * $item_per_page); + + + //Limit our results within a specified range. + $results = $mysqli->prepare("SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC LIMIT $page_position, $item_per_page"); + $results->bind_param('i', $id_album); + $results->execute(); //Execute prepared Query + $results->bind_result($filename); //bind variables to prepared statement + + //Display records fetched from database. + //echo '
    '; + while($results->fetch()){ //fetch values + /* + echo '
  • '; + echo $filename; + echo '
  • '; + */ + + echo displayRetina($filename,$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; + */ + } + //echo '
'; + + echo '
'; + /* We call the pagination function here to generate Pagination link for us. + As you can see I have passed several parameters to the function. */ + echo paginate_function($item_per_page, $page_number, $get_total_rows[0], $total_pages); + echo '
'; + echo '

'; + + exit; +} +################ pagination function ######################################### +function paginate_function($item_per_page, $current_page, $total_records, $total_pages) +{ + $pagination = ''; + if($total_pages > 0 && $total_pages != 1 && $current_page <= $total_pages){ //verify total pages and current page number + $pagination .= '
    '; + + $right_links = $current_page + 3; + $previous = $current_page - 3; //previous link + $next = $current_page + 1; //next link + $first_link = true; //boolean var to decide our first link + + if($current_page > 1){ + $previous_link = ($previous==0)? 1: $previous; + $pagination .= '
  • «
  • '; //first link + $pagination .= '
  • <
  • '; //previous link + for($i = ($current_page-2); $i < $current_page; $i++){ //Create left-hand side links + if($i > 0){ + $pagination .= '
  • '.$i.'
  • '; + } + } + $first_link = false; //set first link to false + } + + if($first_link){ //if current active page is first link + $pagination .= '
  • '.$current_page.'
  • '; + }elseif($current_page == $total_pages){ //if it's the last active link + $pagination .= '
  • '.$current_page.'
  • '; + }else{ //regular current link + $pagination .= '
  • '.$current_page.'
  • '; + } + + for($i = $current_page+1; $i < $right_links ; $i++){ //create right-hand side links + if($i<=$total_pages){ + $pagination .= '
  • '.$i.'
  • '; + } + } + if($current_page < $total_pages){ + $next_link = ($i > $total_pages) ? $total_pages : $i; + $pagination .= '
  • >
  • '; //next link + $pagination .= '
  • »
  • '; //last link + } + + $pagination .= '
'; + } + return $pagination; //return pagination links +} + +?> + diff --git a/footer-page.php b/footer-page.php new file mode 100755 index 0000000..db21df4 --- /dev/null +++ b/footer-page.php @@ -0,0 +1,13 @@ +
+
+
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/functions.php b/functions.php index 6174418..f2d80f5 100644 --- a/functions.php +++ b/functions.php @@ -68,6 +68,23 @@ function RelativeTime() { } +function getRandomFile($start_dir) { + + chdir($start_dir); + $dir = opendir('.'); + while (($myfile = readdir($dir)) !==false) { + if ($myfile != '.' && $myfile != '..' && is_file($myfile) && $myfile != 'resource.frk') { + $files[] = $myfile; + } + } + closedir($dir); + chdir('../'); + srand ((float) microtime() * 10000000); + $file = array_rand($files); + return $files[$file]; + } + + function preprint($s, $return=false) { $x = "
"; 
     $x .= print_r($s, 1); 
@@ -76,4 +93,186 @@ function preprint($s, $return=false) {
     else print $x; 
     } 
 
+
+/* photo du mois */
+
+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 = __('January','CreatorThemeRes-child');
+		break;
+		case 2:
+		$mois = __('February','CreatorThemeRes-child');
+		break;
+		case 3:
+		$mois = __('March','CreatorThemeRes-child');
+		break;
+		case 4:
+		$mois = __('April','CreatorThemeRes-child');
+		break;
+		case 5:
+		$mois = __('May','CreatorThemeRes-child');
+		break;
+		case 6:
+		$mois = __('June','CreatorThemeRes-child');
+		break;
+		case 7:
+		$mois = __('July','CreatorThemeRes-child');
+		break;
+		case 8:
+		$mois = __('August','CreatorThemeRes-child');
+		break;
+		case 9:
+		$mois = __('September','CreatorThemeRes-child');
+		break;
+		case 10:
+		$mois = __('October','CreatorThemeRes-child');
+		break;
+		case 11:
+		$mois = __('November','CreatorThemeRes-child');
+		break;
+		case 12:
+		$mois = __('December','CreatorThemeRes-child');
+		break;
+		}
+    return $mois;
+	}
+
+function display ($filename,$album) {
+	$display = '
'. + '
' . + ''. + ''. + ''. + '
'. + ''. + '
'; + 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 = ''; + 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; + } + ?> \ No newline at end of file diff --git a/header.php b/header.php new file mode 100755 index 0000000..f4c2b00 --- /dev/null +++ b/header.php @@ -0,0 +1,96 @@ + +> + + + + + + + + + + +> + \ No newline at end of file diff --git a/languages/fr_FR.mo b/languages/fr_FR.mo index 084a624ad128a7ed3520b958b1443c30fa1941e8..33c8be0f0443cd9c72a90b67d234ce72d7d150e9 100644 GIT binary patch delta 1093 zcmZY7&1(}u7zXe+>8fpwR_j-7)ecsamQtI7Jyf9-HAtwnP``=@Zj&)xNwZ;gH#K<3 z!IPkftRkLl4+^<>u>J+j!Gi}8FM3eHi>HDoFBb86Hd_!JcIUS<%)ax!v-`09`HtGx zPV0%F9m0J8cPb&$57!~vQc}c%%WxZf8T$rq$9NSUfgj)|_zP}^>#!BJv^3vKL5{m2 z*Y&|IA~os912;&=j>Zd4LR>Nt&!2@1kcD_rX5#s4@%#hh98>0QX}26ylOs z=(^x*n8N<@4i9|s6a0p(ze6UpiZXV>w{REy40ppdcnl_y1uGeVTt5sM=LAf_ama)x zAuhQTdp%Y|3;W9gAE1HQTNdL5cOV1YjmP&P*FA#lPP^r*aSHSPkeYTE zwb6MsS5;SBlb<%)^JJoIoT5wwg~0RWjLzwWIc+4PZVjs0K~)%Ylr0%OX9C+)CFADo zqGat-G|C3Ws$_$bmh-mB&7-f%l)mlDlv_cVF2uQz^IgW9whLOYVa0I+FYHMiZPjHz z+A17RbhTWZ*Wu;Fz1ERYl}?YP)8UVV+8B(ibR@4PE!9|3;Z5t*|5X{c92C7qU6pO~ zZ()_FFgHM1jXLWxTJl2+L$eHZZp@KPqmDJKmSt(h!YUkR1E*NjJ}t2}51k`3fm5+d neH-N=T2vj3tHUmhdR~|OaM?QEHq)%o=j`n;vS+>_sX$>r{Dv)4iQE$7`3DnRncDKd#XAzYsb&%cKL!YS@Y zh{jNLOg1qhmzB@!cIE{JJBbp)VQi^64FRmaTbO)E=16+bHkT3TE zv+x^YP%uh_y$0XV4r&Zfci1yHk1_~fz(@E$Dymf@>QQP$)YP``6m0Ak=XATBu8TyA zmNp$Dj`dkmFWX1=Qpzo%Hfq)Cnp9E-`+MO*<2*L8PQu-&)2NAxRGXoyg#YXMC*F}` RpEKL`-Y?r%zhHm-l|S@ZHc\n" "Language-Team: Bruno \n" "Language: fr_FR\n" @@ -20,7 +20,19 @@ msgstr "" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPathExcluded-0: *.js\n" -#: accueil.php:178 +#: accueil.php:42 +msgid "Previous" +msgstr "Précédent" + +#: accueil.php:43 +msgid "Next" +msgstr "Suivant" + +#: accueil.php:51 +msgid "Portfolio" +msgstr "" + +#: accueil.php:178 index.php:167 tpl-blog.php:45 msgid "Read More" msgstr "Lire la suite" @@ -32,6 +44,54 @@ msgstr "Lire plus d'entrées de blog..." msgid "Sorry, no posts found." msgstr "Désolé, aucun post trouvé." +#: ce-mois.php:140 +msgid "The" +msgstr "Le" + +#: ce-mois.php:140 +msgid "F j, Y, g:i a" +msgstr "d.m.Y à H:i" + +#: ce-mois.php:142 +msgid " at " +msgstr " à " + +#: ce-mois.php:142 +msgid "Focal" +msgstr "Focale " + +#: ce-mois.php:288 ce-mois.php:289 +msgid "Archives" +msgstr "" + +#: ce-mois.php:289 +msgid "Help" +msgstr "" + +#: ce-mois.php:334 +msgid "Previous Page" +msgstr "" + +#: ce-mois.php:334 +msgid "prev" +msgstr "" + +#: ce-mois.php:337 +msgid "Page" +msgstr "Page" + +#: ce-mois.php:343 +msgid "Next Page" +msgstr "" + +#: ce-mois.php:343 +msgid "next" +msgstr "" + +#: footer-page.php:5 +msgid "2016 Copyright. Powered by WordPress" +msgstr "2016 Copyright. Propulsé par WordPress" + #: functions.php:48 msgid "yesterday" msgstr "hier" @@ -59,6 +119,72 @@ msgstr "il y a %1$s semaine" msgid "%1$s weeks ago" msgstr "il y a %1$s semaines" +#: functions.php:130 +msgid "January" +msgstr "Janvier" + +#: functions.php:133 +msgid "February" +msgstr "Février" + +#: functions.php:136 +msgid "March" +msgstr "Mars" + +#: functions.php:139 +msgid "April" +msgstr "Avril" + +#: functions.php:142 +msgid "May" +msgstr "Mai" + +#: functions.php:145 +msgid "June" +msgstr "Juin" + +#: functions.php:148 +msgid "July" +msgstr "Juillet" + +#: functions.php:151 +msgid "August" +msgstr "Aout" + +#: functions.php:154 +msgid "September" +msgstr "Septembre" + +#: functions.php:157 +msgid "October" +msgstr "Octobre" + +#: functions.php:160 +msgid "November" +msgstr "Novembre" + +#: functions.php:163 +msgid "December" +msgstr "Décembre" + +#: header.php:14 +msgid "Tel: " +msgstr "" + +#: header.php:15 +msgid "Email: " +msgstr "" + +#: livre-d-or.php:30 +msgid "Pages" +msgstr "" + +#: tpl-blog.php:66 +msgid "" +"Sorry, no blog posts found. Please create a post and assign it in \"blog\" " +"category." +msgstr "" + #. Theme Name of the plugin/theme msgid "Creator Responsive WordPress Theme Child" msgstr "" @@ -80,3 +206,6 @@ msgstr "" #. Author URI of the plugin/theme msgid "http://dessign.net" msgstr "" + +#~ msgid "Focal " +#~ msgstr "Focale " diff --git a/livre-d-or.php b/livre-d-or.php new file mode 100755 index 0000000..2d5979c --- /dev/null +++ b/livre-d-or.php @@ -0,0 +1,57 @@ + + +
+
+
+ +
> +

+ + + +
'; +?> + + '', + 'link_before' => '', + 'link_after' => '' + )); + ?> + + Tags: ', ', ', '
' ); ?> + +

+ +
+
+ +
+
+ +
+ + + \ No newline at end of file diff --git a/style.css b/style.css index cee59d3..a1de218 100644 --- a/style.css +++ b/style.css @@ -24,4 +24,187 @@ Text Domain: CreatorThemeRes-child .featured-box { /*border: thin solid #ff6231;*/ -} \ No newline at end of file +} + + +/* livre d'or */ + +#randomImg { + margin-right: auto; + margin-left: auto; +} + +#randomImg img { + padding: 10px; + background-color: #fff; + border: 1px solid #818181; + margin-right: auto; + margin-left: auto; + display: block; +} + +/* photo du mois */ + +.cadre { + text-align: center; + margin-top: 1em; +} +.cadre img { + padding: 50px; + background-color: #fff; + border: 1px solid #ccc; +} + +.exifs { + text-align: center; + color: #909090; + font-size: smaller; + margin-bottom: 3em; + margin-top: 1em; +} + + +.thumb { + /*float: left; + line-height: 200px;*/ + width: 200px; + height: 200px; + /**/ + border: 1px solid #ccc; + background-color: #fff; + +} + +.albumdesc { + float: right; + text-align:center; + width: 200px; + padding: 6px 0 0 0; + text-align:center; + vertical-align: middle; +} + +.pagination { + margin-top: 4em; + margin-bottom: 2em; +} + +.albumdesc a, .pagination a { + color: #333; +} + +.gras { + font-weight: bold; +} + +.albumdesc:hover { + /* + background: #ddd; + color: #333 !important; + border-radius: 0; + */ + font-weight: bold; +} + +.album { + float: left; + width: 200px; + height: 200px; + text-align:center; + margin-top: 0; + margin-right: auto; + /* entre 2 rangées d'albums */ + margin-bottom: 25px; + margin-left: auto; + padding: 0px 11px 20px; +} + +/*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; +} +/**/ + + + +/* +.contents{ + margin: 20px; + padding: 20px; + list-style: none; + background: #F9F9F9; + border: 1px solid #ddd; + border-radius: 5px; +} +.contents li{ + margin-bottom: 10px; +} +*/ +.loading-div{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.56); + z-index: 999; + display:none; +} +.loading-div img { + margin-top: 20%; + margin-left: 50%; +} + +/* Pagination style */ +.pagination{margin:0;padding:0;} +.pagination li{ + display: inline; + padding: 6px 10px 6px 10px; + border: 1px solid #ddd; + margin-right: -1px; + font: 15px/20px Arial, Helvetica, sans-serif; + background: #FFFFFF; + box-shadow: inset 1px 1px 5px #F4F4F4; +} +.pagination li a{ + text-decoration:none; + color: rgb(89, 141, 235); +} +.pagination li.first { + border-radius: 5px 0px 0px 5px; +} +.pagination li.last { + border-radius: 0px 5px 5px 0px; +} +.pagination li:hover{ + background: #CFF; +} +.pagination li.active{ + background: #F0F0F0; + color: #333; +} +.pagine { + clear: both; + margin-bottom: 40px; +}