Index: /extensions/memories/admin.php
===================================================================
--- /extensions/memories/admin.php	(revision 32197)
+++ /extensions/memories/admin.php	(revision 32197)
@@ -0,0 +1,130 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+if (!defined('PHPWG_ROOT_PATH'))
+    die('Hacking attempt!');
+global $template, $conf, $user;
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+global $conf, $page;
+$confpfoya = safe_unserialize($conf['pfoya']);
+
+$template->assign(
+  array(
+	'PFOYA_POSITION' => $confpfoya['pfoya_position'],
+	'PFOYA_DATE' => $confpfoya['pfoya_dateb'],
+	'PFOYA_DATEMAX' => $confpfoya['pfoya_datemax'],
+	'PFOYA_NIP' => $confpfoya['pfoya_nip'],
+	'PFOYA_MENU' => $confpfoya['pfoya_menu'],
+	'PFOYA_SHOW' => $confpfoya['pfoya_show'],
+	'PFOYA_SHOWPS' => $confpfoya['pfoya_showps'],
+  )
+);
+
+$PFOYA3T = array(
+  l10n('Available date'),
+  l10n('Creation date'),
+);
+
+$PFOYA3 = array(
+  'date_available',
+  'date_creation',
+);
+
+$template->assign('PFOYA3', $PFOYA3);
+$template->assign('PFOYA3T', $PFOYA3T);
+
+$PFOYA2T = array(
+  l10n('none'),
+  l10n('link Specials/Explore menu'),
+  l10n('block menu'),
+);
+$PFOYA2 = array(
+  '-1',
+  'link',
+  'block',
+); 
+
+$template->assign('pfoya2', $PFOYA2);
+$template->assign('pfoya2T', $PFOYA2T);
+
+$PFOYA4T = array(
+  l10n('yes'),
+  l10n('no'),
+);
+$PFOYA4 = array(
+  '1',
+  '0',
+); 
+
+$template->assign('pfoya4', $PFOYA4);
+$template->assign('pfoya4T', $PFOYA4T);
+
+$PFOYA8T = array(
+  l10n('link in blocks'),
+  l10n('link to memories page'),
+  l10n('no'),
+);
+$PFOYA8 = array(
+  '2',
+  '1',
+  '0',
+); 
+
+$template->assign('pfoya8', $PFOYA8);
+$template->assign('pfoya8T', $PFOYA8T);
+
+
+
+if (isset($_POST['submitpfoya'])){
+  if (is_numeric($_POST['submitpfoyadatemax'])){
+    $confpfoya['pfoya_datemax']=$_POST['submitpfoyadatemax'];
+  }else{
+	$_SESSION['page_errors'] = array(l10n('number years must be a number'));
+  }
+  $confpfoya['pfoya_dateb']=$_POST['submitpfoyadateb'];
+  $confpfoya['pfoya_menu']=$_POST['submitpfoyamenu'];
+  $confpfoya['pfoya_show']=$_POST['submitpfoyashow'];
+  $confpfoya['pfoya_showps']=$_POST['submitpfoyashowps'];
+  if (is_numeric($_POST['submitpfoyaposition'])){
+    $confpfoya['pfoya_position']=$_POST['submitpfoyaposition'];
+  }else{
+	$_SESSION['page_errors'] = array(l10n('position must be a number'));
+  }
+  if (is_numeric($_POST['submitpfoyanip'])){
+    $confpfoya['pfoya_nip']=$_POST['submitpfoyanip'];
+  }else{
+	$_SESSION['page_errors'] = array(l10n('number photos must be a number'));
+  }
+  conf_update_param('pfoya', $confpfoya, true);
+  $_SESSION['page_infos'] = array(l10n('Information data registered in database'));
+  redirect(PFOYA_ADMIN);
+}
+if (isset($_POST['resetpfoya'])){
+  redirect(PFOYA_ADMIN);
+}
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/admin.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT','plugin_admin_content');
+?>
Index: /extensions/memories/admin.tpl
===================================================================
--- /extensions/memories/admin.tpl	(revision 32197)
+++ /extensions/memories/admin.tpl	(revision 32197)
@@ -0,0 +1,86 @@
+{combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
+{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
+
+{footer_script}
+jQuery(function($) {
+
+  jQuery('.eiw').delay(2000).slideUp();
+
+// slide
+    $('.range').each(function(){
+        var cls=$(this).attr('class');
+        var elem=$(this).parent();
+        var input=elem.find('input');
+        var options={};
+        elem.append('<div class="uirange"></div>');
+        options.slide=function(event,ui){
+            elem.find('label span').empty().append(ui.value);
+            input.val(ui.value);
+        }
+        options.value=input.val();
+        options.range='min';
+        options.min=$(this).data('min');
+        options.max=$(this).data('max');
+        elem.find('.uirange').slider(options);
+        elem.find('label span').empty().append(input.val());
+        input.hide();
+    });
+});
+{/footer_script}
+
+{html_style}
+.uirange{
+    margin:10px;
+    margin-left: 40px;
+}
+.pfoyaradio{
+	padding-left: 100px
+}
+{/html_style}
+
+<div class="titrePage">
+    <h2>{'Memories'|@translate}</h2>
+</div>
+
+<form method="post">
+ <fieldset>
+  <legend>{'Configuration'|translate}</legend>
+    <p class="input" style="width: 700px;">
+        <label for="range"><strong>{'Number year you want see'|@translate} </strong><span></span></label>
+        <input type="text" name="submitpfoyadatemax" data-min="1" data-max="50" class="range" value="{$PFOYA_DATEMAX}"/>
+    </p>
+    <p>
+        <strong>{'Chosen type date'|@translate}</strong> 
+        <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyadateb" values=$PFOYA3 output=$PFOYA3T selected="{$PFOYA_DATE}"}</div>
+    </p>
+	<p>
+        <strong>{'Show other years on plugin page'|@translate}</strong> 
+        <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashow" values=$pfoya4 output=$pfoya4T selected="{$PFOYA_SHOW}"}</div>
+    </p>
+	<p>
+        <strong>{'Show menu'|@translate}</strong> 
+        <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyamenu" values=$pfoya2 output=$pfoya2T selected="{$PFOYA_MENU}"}</div>
+    </p>
+	<p class="input" style="width: 700px;">
+        <label for="range"><strong>{'link position in menu'|@translate} </strong><span></span></label>
+        <input type="text" name="submitpfoyaposition" data-min="1" data-max="10" class="range" value="{$PFOYA_POSITION}"/>
+    </p>
+	<p class="input" style="width: 700px;">
+        <label for="range"><strong>{'Maximal number photos for PWG Stuffs Blocs'|@translate} </strong><span></span></label>
+        <input type="text" name="submitpfoyanip" data-min="1" data-max="60" class="range" value="{$PFOYA_NIP}"/>
+    </p>
+	<p>
+        <strong>{'Show other years on PWG Stuffs Block'|@translate}</strong> 
+        <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashowps" values=$pfoya8 output=$pfoya8T selected="{$PFOYA_SHOWPS}"}</div>
+    </p>
+	<br>
+	<br>
+	<p>
+		<input class="submit" type="submit" name="submitpfoya" value="{'Submit'|@translate}">
+		<input class="submit" type="submit" name="resetpfoya" value="{'Reset'|@translate}">
+	</p>
+ </fieldset>
+</form>
+    
+
+
Index: /extensions/memories/blockhome/index.php
===================================================================
--- /extensions/memories/blockhome/index.php	(revision 32197)
+++ /extensions/memories/blockhome/index.php	(revision 32197)
@@ -0,0 +1,15 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/memories/blockhome/main.inc.php
===================================================================
--- /extensions/memories/blockhome/main.inc.php	(revision 32197)
+++ /extensions/memories/blockhome/main.inc.php	(revision 32197)
@@ -0,0 +1,140 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $page, $user, $conf, $template;
+$confpfoya = safe_unserialize($conf['pfoya']);
+
+$page_save = $page;
+$tpl_save = $template->get_template_vars('THUMBNAILS');
+$pfoyanip = $confpfoya['pfoya_nip'];
+$datepfoya = $confpfoya['pfoya_dateb'];
+
+if (script_basename() == 'picture'
+  or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items']))
+  or ($datas['cat_display'] == 'w_thumb' and empty($page['items']) and isset($page['category']))
+  or ($datas['cat_display'] == 'selected_cats' and isset($page['category']) and !in_array($page['category']['id'], $datas['cat_selection'])))
+{
+  return false;
+}
+
+	if($confpfoya['pfoya_datemax']>1 and $confpfoya['pfoya_showps']!=0)$template->assign('pfoya','a');
+	$template->assign('renewpfoya',realpath(PFOYA_PATH.'blockhome/main.inc.php'));
+	if (isset($_GET['memodate'])) {
+	  check_input_parameter('memodate', $_GET, false, PATTERN_ID);
+	  $daydate=date("Y-m-d", strtotime('-'.$_GET['memodate'].' year'));
+	}else{
+	  $daydate=date("Y-m-d", strtotime('-1 year'));
+	}
+	
+	for ($i = 1; $i <= $confpfoya['pfoya_datemax']; $i++) {
+	$daydate2=date("Y-m-d", strtotime('-'.$i.' year'));
+	  $query = '
+		SELECT COUNT(DISTINCT(i.id)) as count 
+		FROM '.IMAGES_TABLE.' AS i
+		INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+		INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
+		WHERE ' .  
+		  get_sql_condition_FandF(
+			array(
+			  'forbidden_categories' => 'category_id',
+			  'visible_categories' => 'category_id',
+			  'visible_images' => 'image_id',
+			  ),
+			'', true
+			);
+	  $query .= '
+		and DATE ('.$datepfoya.') ="'.$daydate2.'";';
+
+	  $row = pwg_db_fetch_assoc(pwg_query($query));
+	
+	  $items['NB_IMAGES']=$row['count'];
+	  if($confpfoya['pfoya_showps']==1){
+		if ($i == 1){
+		  $items['URL']=make_index_url(array('section' => 'memories-1-year-ago'));
+		}else{
+		  $items['URL']=make_index_url(array('section' => 'memories-'.$i.'-years-ago'));
+		}
+	  }
+	  if($confpfoya['pfoya_showps']==2){
+		$items['URL']=$_SERVER["REQUEST_URI"].'&amp;memodate='.$i;
+	  }
+	  if ($i == 1){
+		$items['LABEL']=l10n('1 year ago');
+	  }else{
+		$items['LABEL']=l10n('%d years ago',$i);
+	  }
+	  $template->append('pfoyas', $items);
+	}
+
+ $query = '
+SELECT DISTINCT(i.id)
+  FROM '.IMAGES_TABLE.' AS i
+    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id ';
+
+ $query .= 'WHERE ' .  
+      get_sql_condition_FandF(
+        array(
+          'forbidden_categories' => 'category_id',
+          'visible_categories' => 'category_id',
+          'visible_images' => 'image_id',
+          ),
+        '', true
+        );
+  $query .= '
+       and DATE ('.$datepfoya.') ="'.$daydate.'"';
+
+if (isset($page['category'])){
+  $query .= '
+        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
+  ';
+}
+  $query .= '
+    LIMIT 0, '.$pfoyanip.'
+  ;';
+
+    $page['items'] = array_from_query($query, 'id');
+	$page['start'] = 0;
+	$page['section'] = 'memories-1-year-ago';
+	$page['nb_image_page']=$pfoyanip;
+
+
+
+$tpl_thumbnails_var = array();
+$pwg_stuffs_tpl_thumbnails_var = & $tpl_thumbnails_var;
+include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
+
+if (!empty($pwg_stuffs_tpl_thumbnails_var))
+{
+  $block['thumbnails'] = $pwg_stuffs_tpl_thumbnails_var;
+  $block['derivative_params'] = ImageStdParams::get_by_type(IMG_THUMB);
+  $block['TEMPLATE'] = realpath(PFOYA_PATH.'/blockhome/stuffs_homepfoya.tpl');
+}
+
+$page = $page_save;
+$template->assign('THUMBNAILS', $tpl_save);
+
+
+
+
+?>
Index: /extensions/memories/blockhome/stuffs_homepfoya.tpl
===================================================================
--- /extensions/memories/blockhome/stuffs_homepfoya.tpl	(revision 32197)
+++ /extensions/memories/blockhome/stuffs_homepfoya.tpl	(revision 32197)
@@ -0,0 +1,58 @@
+{assign var='thumbnails' value=$block.thumbnails}
+{assign var='derivative_params' value=$block.derivative_params}
+
+{html_style}
+{*Set some sizes according to maximum thumbnail width and height*}
+.stuffs_block_{$block.ID} SPAN,
+.stuffs_block_{$block.ID} .wrap2 A,
+.stuffs_block_{$block.ID} LABEL{ldelim}
+	width: {$derivative_params->max_width()+2}px !important;
+}
+
+.stuffs_block_{$block.ID} .wrap2{ldelim}
+	height: {$derivative_params->max_height()+3}px !important;
+}
+{if $derivative_params->max_width() > 600}
+.stuffs_block_{$block.ID} .thumbLegend {ldelim}font-size: 130% !important}
+{else}
+{if $derivative_params->max_width() > 400}
+.stuffs_block_{$block.ID} .thumbLegend {ldelim}font-size: 110% !important}
+{else}
+.stuffs_block_{$block.ID} .thumbLegend {ldelim}font-size: 90% !important}
+{/if}
+{/if}
+
+.pfoya{
+float:right;
+padding-right:100px;
+}
+
+.pfoyat{
+	padding-left:50px;
+	font-size:2em;
+}
+{/html_style}
+
+{if isset($pfoya)}
+  <div class="calendarBar">
+	{foreach from=$pfoyas item=pfoya}
+	  {if ($pfoya.NB_IMAGES==0)}
+		<span class="calItem">{$pfoya.LABEL}</span>
+	  {else}
+		<a class="calItem calItempfoya"{if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+	  {/if}
+	{/foreach}
+  </div>
+{/if}
+{if isset($pfoyadata)}
+<div class="pfoyat">{$pfoyadata}</div>
+{/if}
+
+
+<ul class="thumbnails stuffs_block_{$block.ID}" id="thumbnails">
+{include file='thumbnails.tpl'|@get_extent:'index_thumbnails'}
+</ul>
+
+{if $pfoya !='a'}
+<div class="pfoya"><a href="{$PFOAYALINK}">{'more photos'|@translate} ...</a></div>
+{/if}
Index: /extensions/memories/include/function.pfoya.inc.php
===================================================================
--- /extensions/memories/include/function.pfoya.inc.php	(revision 32197)
+++ /extensions/memories/include/function.pfoya.inc.php	(revision 32197)
@@ -0,0 +1,110 @@
+<?php 
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+function listyears(){
+  global $conf, $template;
+  $confpfoya = safe_unserialize($conf['pfoya']);
+
+	for ($i = 1; $i <= $confpfoya['pfoya_datemax']; $i++) {
+	$daydate=date("Y-m-d", strtotime('-'.$i.' year'));
+
+	  $query = '
+		SELECT COUNT(DISTINCT(i.id)) as count 
+		FROM '.IMAGES_TABLE.' AS i
+		INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+		INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
+		WHERE ' .  
+		  get_sql_condition_FandF(
+			array(
+			  'forbidden_categories' => 'category_id',
+			  'visible_categories' => 'category_id',
+			  'visible_images' => 'image_id',
+			  ),
+			'', true
+			);
+	  $query .= '
+		and DATE ('.$confpfoya['pfoya_dateb'].') ="'.$daydate.'";';
+	  
+	  $row = pwg_db_fetch_assoc(pwg_query($query));
+	  if ($i == 1){
+	    $items = array(
+		  'NB_IMAGES' => $row['count'],
+		  'URL' => make_index_url(array('section' => 'memories-1-year-ago')),
+		  'LABEL' => l10n('1 year ago'),
+		);
+	    $template->append('pfoyas', $items);
+	  }else{
+		$items = array(
+		  'NB_IMAGES' => $row['count'],
+		  'URL' => make_index_url(array('section' => 'memories-'.$i.'-years-ago')),
+		  'LABEL' => l10n('%d years ago',$i),
+		);
+	    $template->append('pfoyas', $items);
+	  }
+	}
+
+}
+
+function listyearsBlock(){
+  global $conf, $template;
+  $confpfoya = safe_unserialize($conf['pfoya']);
+	$bnipfoya=0;
+	for ($i = 1; $i <= $confpfoya['pfoya_datemax']; $i++) {
+	$daydate=date("Y-m-d", strtotime('-'.$i.' year'));
+	  $query = '
+		SELECT COUNT(DISTINCT(i.id)) as count 
+		FROM '.IMAGES_TABLE.' AS i
+		INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+		INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
+		WHERE ' .  
+		  get_sql_condition_FandF(
+			array(
+			  'forbidden_categories' => 'category_id',
+			  'visible_categories' => 'category_id',
+			  'visible_images' => 'image_id',
+			  ),
+			'', true
+			);
+	  $query .= '
+		and DATE ('.$confpfoya['pfoya_dateb'].') ="'.$daydate.'";';
+	  
+	  $row = pwg_db_fetch_assoc(pwg_query($query));
+	  $bnipfoya += $row['count'];
+	  if ($i == 1){
+	    $items = array(
+		  'NB_IMAGES' => $row['count'],
+		  'URL' => make_index_url(array('section' => 'memories-1-year-ago')),
+		  'LABEL' => l10n('1 year ago'),
+		);
+	  }else{
+		$items = array(
+		  'NB_IMAGES' => $row['count'],
+		  'URL' => make_index_url(array('section' => 'memories-'.$i.'-years-ago')),
+		  'LABEL' => l10n('%d years ago',$i),
+		);
+	  }
+	  
+	  $template->append('pfoyasblock', $items);
+	}
+      $template->assign('BNIPFOYA',$bnipfoya);
+}
+
+?>
Index: /extensions/memories/index.php
===================================================================
--- /extensions/memories/index.php	(revision 32197)
+++ /extensions/memories/index.php	(revision 32197)
@@ -0,0 +1,15 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/memories/language/en_UK/description.txt
===================================================================
--- /extensions/memories/language/en_UK/description.txt	(revision 32197)
+++ /extensions/memories/language/en_UK/description.txt	(revision 32197)
@@ -0,0 +1,1 @@
+Add part "photos from year ago". Link in "Specials/explore" menu or Block menu or other page with PWG Stuffs.
Index: /extensions/memories/language/en_UK/index.php
===================================================================
--- /extensions/memories/language/en_UK/index.php	(revision 32197)
+++ /extensions/memories/language/en_UK/index.php	(revision 32197)
@@ -0,0 +1,15 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/memories/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/memories/language/en_UK/plugin.lang.php	(revision 32197)
+++ /extensions/memories/language/en_UK/plugin.lang.php	(revision 32197)
@@ -0,0 +1,43 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['Memories'] = 'Memories';
+$lang['Memories 1 year ago'] = 'Memories 1 year ago';
+$lang['1 year ago'] = '1 year ago';
+$lang['%d years ago'] = '%d years ago';
+$lang['Displays Memories year ago'] = 'Displays Memories year ago';
+$lang['more photos'] = 'more photos';
+$lang['Display X photos from 1 year ago in the gallery or a album'] = 'Display X photos from 1 year ago in the gallery or a album';
+$lang['Photos from'] = 'Photos from';
+$lang['Number year you want see'] = 'Number year you want see';
+$lang['Chosen type date'] = 'Chosen type date';
+$lang['Available date'] = 'Available date';
+$lang['Show other years on plugin page'] = 'Show other years on plugin page';
+$lang['Show menu'] = 'Show menu';
+$lang['link Specials/Explore menu'] = 'link Specials/Explore menu';
+$lang['block menu'] = 'block menu';
+$lang['link position in menu'] = 'link position in menu';
+$lang['Maximal number photos for PWG Stuffs Block'] = 'Maximal number photos for PWG Stuffs Block';
+$lang['Show other years on PWG Stuffs Block'] = 'Show other years on PWG Stuffs Block';
+$lang['yes'] = 'yes';
+$lang['no'] = 'no';
+$lang['link in blocks'] = 'link in blocks';
+$lang['link to memories page'] = 'link to memories page';
Index: /extensions/memories/language/fr_FR/description.txt
===================================================================
--- /extensions/memories/language/fr_FR/description.txt	(revision 32197)
+++ /extensions/memories/language/fr_FR/description.txt	(revision 32197)
@@ -0,0 +1,1 @@
+Ajoutez un espace "Photos d'il y a un an" soit dans un lien dans le menu Spéciales/Explorer, soit un blocs menu, soit un blocs sur les page avec PWG Stuffs
Index: /extensions/memories/language/fr_FR/index.php
===================================================================
--- /extensions/memories/language/fr_FR/index.php	(revision 32197)
+++ /extensions/memories/language/fr_FR/index.php	(revision 32197)
@@ -0,0 +1,15 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/memories/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/memories/language/fr_FR/plugin.lang.php	(revision 32197)
+++ /extensions/memories/language/fr_FR/plugin.lang.php	(revision 32197)
@@ -0,0 +1,44 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['Memories'] = 'Souvenir';
+$lang['Memories 1 year ago'] = 'Souvenir 1 ans déjà';
+$lang['1 year ago'] = 'il y a 1 an';
+$lang['%d years ago'] = 'il y a %d ans';
+$lang['Displays Memories year ago'] = 'Affiche les souvenirs d\'un an';
+$lang['more photos'] = 'plus de photos';
+$lang['Display X photos from 1 year ago in the gallery or a album'] = 'Afficher les X photos d\'il y a 1 ans de la galerie ou de l\'album';
+$lang['Photos from %d'] = 'Photos du %d';
+$lang['Photos from'] = 'Photos du';
+$lang['Number year you want see'] = 'Nombre d\'année que vous souhaitez afficher';
+$lang['Chosen type date'] = 'Choisissez le type de date';
+$lang['Available date'] = 'Date d\'ajout';
+$lang['Show other years on plugin page'] = 'Montrer les autres années sur les pages généré par le plugin';
+$lang['Show menu'] = 'Afficher dans le menu';
+$lang['link Specials/Explore menu'] = 'lien dans le menu Spéciales / Explorer';
+$lang['block menu'] = 'un block menu';
+$lang['link position in menu'] = 'Position du lien dans le menu';
+$lang['Maximal number photos for PWG Stuffs Block'] = 'Nombre de photo maximal pour le bloc PWG Stuffs Blocs';
+$lang['Show other years on PWG Stuffs Block'] = 'Montrer les autres années dans le bloc PWG Stuffs';
+$lang['yes'] = 'oui';
+$lang['no'] = 'non';
+$lang['link in blocks'] = 'lien dans le blocs';
+$lang['link to memories page'] = 'lien vers la page souvenir';
Index: /extensions/memories/language/index.php
===================================================================
--- /extensions/memories/language/index.php	(revision 32197)
+++ /extensions/memories/language/index.php	(revision 32197)
@@ -0,0 +1,15 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/memories/main.inc.php
===================================================================
--- /extensions/memories/main.inc.php	(revision 32197)
+++ /extensions/memories/main.inc.php	(revision 32197)
@@ -0,0 +1,203 @@
+<?php
+/*
+Plugin Name:  Memories
+Version: auto
+Description: Add part "photos from year ago". Link in "Specials/explore" menu or Block menu or other page with PWG Stuffs.
+Plugin URI: https://piwigo.org/ext/extension_view.php?eid=893
+Author: ddtddt
+Author URI: http://temmii.com/piwigo/
+*/
+
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+define('PFOYA_DIR' , basename(dirname(__FILE__)));
+define('PFOYA_PATH' , PHPWG_PLUGINS_PATH .PFOYA_DIR . '/');
+define('PFOYA_ADMIN' , get_root_url().'admin.php?page=plugin-'.PFOYA_DIR);
+
+include_once(PFOYA_PATH . 'include/function.pfoya.inc.php');
+
+add_event_handler('loading_lang', 'pfoya_loading_lang');	  
+function pfoya_loading_lang(){
+  load_language('plugin.lang', PFOYA_PATH);
+}
+
+  global $conf;
+$confpfoya = safe_unserialize($conf['pfoya']);
+
+//admin menu
+add_event_handler('get_admin_plugin_menu_links', 'pfoya_admin_menu');
+
+function pfoya_admin_menu($menu){
+  if (is_webmaster()){
+    load_language('plugin.lang', PFOYA_PATH);
+    $menu[] = array(
+        'NAME' => l10n('Memories'),
+        'URL' => PFOYA_ADMIN,
+    );
+  }
+     return $menu;
+}
+
+//public menu
+if($confpfoya['pfoya_menu']=='link'){
+add_event_handler('blockmanager_apply' , 'add_link_pfoya');
+function add_link_pfoya($menu_ref_arr){
+  global $conf;
+  $confpfoya = safe_unserialize($conf['pfoya']);
+  $menu = &$menu_ref_arr[0];
+  if (($block = $menu->get_block('mbSpecials')) != null){
+	array_splice($block->data, ($confpfoya['pfoya_position'])-1, 0, 
+	  array('memories-1-year-ago' =>
+		array(
+		  'URL' => make_index_url(array('section' => 'memories-1-year-ago')),
+		  'TITLE' => l10n('Displays Memories year ago'),
+		  'NAME' => l10n('Memories')
+		)
+	  )
+	);
+  }
+}
+}else if($confpfoya['pfoya_menu']=='block'){
+    add_event_handler('blockmanager_register_blocks', 'register_pfoya_menubar_blocks');
+    add_event_handler('blockmanager_apply', 'pfoya_apply');
+
+function register_pfoya_menubar_blocks($menu_ref_arr) {
+    $menu = & $menu_ref_arr[0];
+    if ($menu->get_id() != 'menubar')
+        return;
+    $menu->register_block(new RegisteredBlock('mbpfoya', 'pfoya', ('Photo from year ago')));
+}
+
+function pfoya_apply($menu_ref_arr) {
+  global $template,$user;
+    $menu = & $menu_ref_arr[0];
+	listyearsBlock();
+	$template->assign('PFOAYALINKM',make_index_url(array('section' => 'memories-1-year-ago')));
+
+    if (($block = $menu->get_block('mbpfoya')) != null) {
+        $template->set_template_dir(PFOYA_PATH);
+		if ($user['theme'] == 'bootstrapdefault'||$user['theme'] == 'bootstrap_darkroom'){
+		  $block->template = 'menubar_pfoya_bootstrap.tpl';		
+		}else if ($user['theme'] == 'smartpocket'){
+		  $block->template = 'menubar_pfoya_smartpocket.tpl';		
+		}else if ($user['theme'] == 'modus'){
+		  $block->template = 'menubar_pfoya_modus.tpl';		
+		}else{
+		  $block->template = 'menubar_pfoya.tpl';
+		}
+    }
+}
+}
+add_event_handler('loc_end_section_init', 'section_init_pfoya');
+function section_init_pfoya(){
+  global $tokens, $page, $conf, $template, $user;
+  $confpfoya = safe_unserialize($conf['pfoya']);
+  $testurl = explode('memories-', $_SERVER['REQUEST_URI']);
+  $template->assign('PFOAYALINK',make_index_url(array('section' => 'memories-1-year-ago')));
+  if(!empty($testurl[1])){
+
+    $datepfoya = $confpfoya['pfoya_dateb'];
+	$daydatemax= $confpfoya['pfoya_datemax'];
+	if($confpfoya['pfoya_datemax']>1 and $confpfoya['pfoya_show']==1){
+		$template->assign('pfoya','a');
+		listyears();
+	}
+	  if($testurl[1]=='1-year-ago'){
+		if (!in_array('memories-1-year-ago', $tokens)){return;}
+		  	$daydate=date("Y-m-d", strtotime('-1 year'));
+		    $query = '
+			  SELECT DISTINCT(i.id)
+			  FROM '.IMAGES_TABLE.' AS i
+				INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+				INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
+				WHERE ' .  
+				  get_sql_condition_FandF(
+					array(
+					  'forbidden_categories' => 'category_id',
+					  'visible_categories' => 'category_id',
+					  'visible_images' => 'image_id',
+					  ),
+					'', true
+					);
+			  $query .= '
+				   and DATE ('.$datepfoya.') ="'.$daydate.'";';
+		$page['section'] = 'memories-1-year-ago';
+	    $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('1 year ago') . '</a>';
+	    $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>'
+		  . $conf['level_separator'] . $page['title'];
+	    $page['items'] = query2array($query, null, 'id');
+		$template->assign('pfoyadata',l10n('Photos from').' '.format_date($daydate));
+
+	  }else{
+		$yurl=explode('-years-ago', $testurl[1]);
+		$yurl=$yurl[0];
+		if (!in_array('memories-'.$yurl.'-years-ago', $tokens)){return;}
+		$daydate=date("Y-m-d", strtotime('-'.$yurl.' year'));
+		  $query = '
+		  SELECT DISTINCT(i.id)
+		  FROM '.IMAGES_TABLE.' AS i
+			INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
+			INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
+			WHERE ' .  
+			  get_sql_condition_FandF(
+				array(
+				  'forbidden_categories' => 'category_id',
+				  'visible_categories' => 'category_id',
+				  'visible_images' => 'image_id',
+				  ),
+				'', true
+				);
+		  $query .= '
+			   and DATE ('.$datepfoya.') ="'.$daydate.'";';
+		$page['section'] = 'memories-'.$yurl.'-years-ago';
+	    $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('%d years ago',$yurl) . '</a>';
+	    $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>'
+		  . $conf['level_separator'] . $page['title'];
+	    $page['items'] =query2array($query, null, 'id'); 
+		$template->assign('pfoyadata',l10n('Photos from').' '.format_date($daydate));
+	  }
+	  
+	
+  }	
+  	  if ($user['theme'] == 'bootstrapdefault'||$user['theme'] == 'bootstrap_darkroom'){
+		  $template->set_filename('PFOYA', realpath(PFOYA_PATH . 'pfoya_bootstrap.tpl'));			
+		}else{
+		    $template->set_filename('PFOYA', realpath(PFOYA_PATH . 'pfoya.tpl'));
+	  }
+	
+
+  $template->assign_var_from_handle('CONTENT', 'PFOYA');
+	
+}
+
+add_event_handler('get_stuffs_modules', 'register_pfoya_module');
+
+function register_pfoya_module($modules){
+  array_push($modules, array(
+    'path' => PFOYA_PATH.'/blockhome',
+    'name' => l10n('Memories 1 year ago'),
+    'description' => l10n('Display X photos from 1 year ago in the gallery or a album'),
+    )
+  );
+  return $modules;
+}
Index: /extensions/memories/maintain.class.php
===================================================================
--- /extensions/memories/maintain.class.php	(revision 32197)
+++ /extensions/memories/maintain.class.php	(revision 32197)
@@ -0,0 +1,60 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Memories for Piwigo by TEMMII                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+class memories_maintain extends PluginMaintain{
+
+  private $default_conf = array(
+    'pfoya_position' => 5,
+    'pfoya_dateb' => 'date_available',
+    'pfoya_datemax' => 5,
+    'pfoya_nip' => 6,
+	'pfoya_menu' => 'link',
+	'pfoya_show' => 1,
+	'pfoya_showps' => 1,
+    );
+
+
+
+  function install($plugin_version, &$errors=array()){
+	global $conf;
+	if (empty($conf['pfoya'])){
+      conf_update_param('pfoya', $this->default_conf, true);
+    }else{
+      $old_conf = safe_unserialize($conf['pfoya']);
+      foreach (array_keys($this->default_conf) as $conf_key){
+        if (!isset($old_conf[$conf_key])){
+          $old_conf[$conf_key] = $this->default_conf[$conf_key];
+        }
+      }
+      conf_update_param('pfoya', $old_conf, true);
+    }
+  }
+
+  function update($old_version, $new_version, &$errors=array()){
+	$this->install($new_version, $errors);
+  }
+
+  function uninstall(){
+	conf_delete_param('pfoya');
+  }
+}
Index: /extensions/memories/menubar_pfoya.tpl
===================================================================
--- /extensions/memories/menubar_pfoya.tpl	(revision 32197)
+++ /extensions/memories/menubar_pfoya.tpl	(revision 32197)
@@ -0,0 +1,23 @@
+{html_style}
+#mbpfoya P {
+    font-size: 100%;
+    margin: 10px 0 10px 5px;
+}
+
+{/html_style}
+<dt>{'Memories'|@translate}</dt>
+<dd>
+ <ul>
+ {foreach from=$pfoyasblock item=pfoya}
+	  {if ($pfoya.NB_IMAGES==0)}
+		<li><span>{$pfoya.LABEL}</span>  </li>
+	  {else}
+		<li>
+		  <a {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+		  <span class="menuInfoCat badge">{if isset($pfoya.NB_IMAGES)}{$pfoya.NB_IMAGES}{/if}</span>
+		</li>
+	  {/if}
+	{/foreach}
+  </lu>
+  <p class="totalImages">{$BNIPFOYA|@translate_dec:'%d photo':'%d photos'}</p>
+ </dd>
Index: /extensions/memories/menubar_pfoya_bootstrap.tpl
===================================================================
--- /extensions/memories/menubar_pfoya_bootstrap.tpl	(revision 32197)
+++ /extensions/memories/menubar_pfoya_bootstrap.tpl	(revision 32197)
@@ -0,0 +1,17 @@
+<li id="pfoyaDropdownMenu" class="nav-item dropdown">
+    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">{'Memories'|@translate}</a>
+    <div class="dropdown-menu dropdown-menu-right" role="menu">
+ {foreach from=$pfoyasblock item=pfoya}
+	  {if ($pfoya.NB_IMAGES==0)}
+		<span class="dropdown-item">{$pfoya.LABEL}</span>
+	  {else}
+		<a class="dropdown-item" {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}
+		  <span class="badge badge-secondary ml-2">{if isset($pfoya.NB_IMAGES)}{$pfoya.NB_IMAGES}{/if}</span>
+		</a>
+	  {/if}
+	{/foreach}
+<div class="dropdown-divider"></div>
+        <div class="dropdown-header">{$BNIPFOYA|@translate_dec:'%d photo':'%d photos'}</div>
+    </div>
+</li>
+
Index: /extensions/memories/menubar_pfoya_modus.tpl
===================================================================
--- /extensions/memories/menubar_pfoya_modus.tpl	(revision 32197)
+++ /extensions/memories/menubar_pfoya_modus.tpl	(revision 32197)
@@ -0,0 +1,31 @@
+{html_style}
+#mbpfoya dd ul li span:nth-child(2n) {
+    background-color: #777;
+    border-radius: 0px;
+    color: #ddd;
+}
+#mbpfoya dd ul li span:nth-child(2n) {
+    margin-left: 5px;
+    padding: 2px 5px;
+    font-size: 12px;
+    font-weight: normal;
+}
+{/html_style}
+
+<dt><a href="{$PFOAYALINKM}">{'Memories'|@translate}</a></dt>
+<dd>
+  <ul>
+  {foreach from=$pfoyasblock item=pfoya}
+	{if ($pfoya.NB_IMAGES==0)}
+	  <li><span>{$pfoya.LABEL}</span>  </li>
+	{else}
+	  <li>
+		<a {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+		<span class="menuInfoCat badge" {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if}>{if isset($pfoya.NB_IMAGES)}{$pfoya.NB_IMAGES}{/if}</span>
+	  </li>
+	{/if}
+  {/foreach}
+  </lu>
+  <p class="totalImages">{$BNIPFOYA|@translate_dec:'%d photo':'%d photos'}</p>
+</dd>
+
Index: /extensions/memories/menubar_pfoya_smartpocket.tpl
===================================================================
--- /extensions/memories/menubar_pfoya_smartpocket.tpl	(revision 32197)
+++ /extensions/memories/menubar_pfoya_smartpocket.tpl	(revision 32197)
@@ -0,0 +1,14 @@
+<h3>{'Memories'|@translate}</h3>
+<ul data-role="listview">
+  {foreach from=$pfoyasblock item=pfoya}
+	{if ($pfoya.NB_IMAGES==0)}
+	  <li><span>{$pfoya.LABEL}</span>  </li>
+	{else}
+	  <li>
+		<a {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+		<span class="ui-li-count">{if isset($pfoya.NB_IMAGES)}{$pfoya.NB_IMAGES}{/if}</span>
+	  </li>
+	{/if}
+  {/foreach}
+</lu>
+
Index: /extensions/memories/pfoya.tpl
===================================================================
--- /extensions/memories/pfoya.tpl	(revision 32197)
+++ /extensions/memories/pfoya.tpl	(revision 32197)
@@ -0,0 +1,22 @@
+{html_style}
+.pfoyat{
+	padding-left:50px;
+	font-size:2em;
+}
+{/html_style}
+{if isset($pfoya)}
+  <div class="calendarBar">
+	{foreach from=$pfoyas item=pfoya}
+	  {if ($pfoya.NB_IMAGES==0)}
+		<span class="calItem">{$pfoya.LABEL}</span>
+	  {else}
+		<a class="calItem"{if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+	  {/if}
+	{/foreach}
+  </div>
+{/if}
+{if isset($pfoyadata)}
+<div class="pfoyat">{$pfoyadata}</div>
+{/if}
+
+  
Index: /extensions/memories/pfoya_bootstrap.tpl
===================================================================
--- /extensions/memories/pfoya_bootstrap.tpl	(revision 32197)
+++ /extensions/memories/pfoya_bootstrap.tpl	(revision 32197)
@@ -0,0 +1,22 @@
+{html_style}
+.pfoyat{
+	padding-left:50px;
+	font-size:2em;
+}
+{/html_style}
+{if isset($pfoya)}
+ <div class="calendarBar">
+   <div id="calendar-nav-buttons" class="btn-group" role="group"> 
+	{foreach from=$pfoyas item=pfoya}
+	  {if ($pfoya.NB_IMAGES==0)}
+		<a class="btn btn-secondary" disabled="disabled">{$pfoya.LABEL}</a>
+	  {else}
+		<a class="btn btn-secondary"{if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>
+	  {/if}
+	{/foreach}
+  </div>
+ </div>
+{/if}
+{if isset($pfoyadata)}
+<div class="pfoyat">{$pfoyadata}</div>
+{/if}
