Changeset 32197
- Timestamp:
- May 11, 2020, 10:54:44 PM (4 years ago)
- Location:
- extensions/memories
- Files:
-
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/memories/admin.php
r32196 r32197 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Photos from one year ago for Piwigo by TEMMII|3 // | Memories for Piwigo by TEMMII | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 82 82 $template->assign('pfoya4T', $PFOYA4T); 83 83 84 $PFOYA8T = array( 85 l10n('link in blocks'), 86 l10n('link to memories page'), 87 l10n('no'), 88 ); 89 $PFOYA8 = array( 90 '2', 91 '1', 92 '0', 93 ); 94 95 $template->assign('pfoya8', $PFOYA8); 96 $template->assign('pfoya8T', $PFOYA8T); 97 98 84 99 85 100 if (isset($_POST['submitpfoya'])){ -
extensions/memories/admin.tpl
r32196 r32197 40 40 41 41 <div class="titrePage"> 42 <h2>{' Photo from year ago'|@translate}</h2>42 <h2>{'Memories'|@translate}</h2> 43 43 </div> 44 44 … … 72 72 <p> 73 73 <strong>{'Show other years on PWG Stuffs Block'|@translate}</strong> 74 <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashowps" values=$pfoya 4 output=$pfoya4T selected="{$PFOYA_SHOWPS}"}</div>74 <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashowps" values=$pfoya8 output=$pfoya8T selected="{$PFOYA_SHOWPS}"}</div> 75 75 </p> 76 76 <br> -
extensions/memories/blockhome/main.inc.php
r32196 r32197 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Memories for Piwigo by TEMMII | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 3 22 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); … … 19 38 } 20 39 21 if($confpfoya['pfoya_datemax']>1 and $confpfoya['pfoya_showps'] ==1)$template->assign('pfoya','a');40 if($confpfoya['pfoya_datemax']>1 and $confpfoya['pfoya_showps']!=0)$template->assign('pfoya','a'); 22 41 $template->assign('renewpfoya',realpath(PFOYA_PATH.'blockhome/main.inc.php')); 42 if (isset($_GET['memodate'])) { 43 check_input_parameter('memodate', $_GET, false, PATTERN_ID); 44 $daydate=date("Y-m-d", strtotime('-'.$_GET['memodate'].' year')); 45 }else{ 46 $daydate=date("Y-m-d", strtotime('-1 year')); 47 } 23 48 24 49 for ($i = 1; $i <= $confpfoya['pfoya_datemax']; $i++) { 25 $daydate =date("Y-m-d", strtotime('-'.$i.' year'));50 $daydate2=date("Y-m-d", strtotime('-'.$i.' year')); 26 51 $query = ' 27 52 SELECT COUNT(DISTINCT(i.id)) as count … … 39 64 ); 40 65 $query .= ' 41 and DATE ('.$datepfoya.') ="'.$daydate .'";';66 and DATE ('.$datepfoya.') ="'.$daydate2.'";'; 42 67 43 $row = pwg_db_fetch_assoc(pwg_query($query)); 44 68 $row = pwg_db_fetch_assoc(pwg_query($query)); 69 70 $items['NB_IMAGES']=$row['count']; 71 if($confpfoya['pfoya_showps']==1){ 72 if ($i == 1){ 73 $items['URL']=make_index_url(array('section' => 'memories-1-year-ago')); 74 }else{ 75 $items['URL']=make_index_url(array('section' => 'memories-'.$i.'-years-ago')); 76 } 77 } 78 if($confpfoya['pfoya_showps']==2){ 79 $items['URL']=$_SERVER["REQUEST_URI"].'&memodate='.$i; 80 } 45 81 if ($i == 1){ 46 $items = array( 47 'NB_IMAGES' => $row['count'], 48 'URL' => make_index_url(array('section' => 'photos_from_1_year_ago')), 49 'LABEL' => l10n('Photos from 1 year ago'), 50 ); 51 $template->append('pfoyas', $items); 82 $items['LABEL']=l10n('1 year ago'); 52 83 }else{ 53 $items = array( 54 'NB_IMAGES' => $row['count'], 55 'URL' => make_index_url(array('section' => 'photos_from_'.$i.'_year_ago')), 56 'LABEL' => l10n('Photos from %d years ago',$i), 57 ); 58 $template->append('pfoyas', $items); 84 $items['LABEL']=l10n('%d years ago',$i); 59 85 } 86 $template->append('pfoyas', $items); 60 87 } 61 88 62 63 $daydate=date("Y-m-d", strtotime('-1 year'));64 89 $query = ' 65 90 SELECT DISTINCT(i.id) … … 91 116 $page['items'] = array_from_query($query, 'id'); 92 117 $page['start'] = 0; 93 $page['section'] = ' Photos_from_1_year_ago';118 $page['section'] = 'memories-1-year-ago'; 94 119 $page['nb_image_page']=$pfoyanip; 95 120 -
extensions/memories/include/function.pfoya.inc.php
r32196 r32197 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Photos from one year ago for Piwigo by TEMMII|3 // | Memories for Piwigo by TEMMII | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 48 48 $items = array( 49 49 'NB_IMAGES' => $row['count'], 50 'URL' => make_index_url(array('section' => ' photos_from_1_year_ago')),51 'LABEL' => l10n(' Photos from1 year ago'),50 'URL' => make_index_url(array('section' => 'memories-1-year-ago')), 51 'LABEL' => l10n('1 year ago'), 52 52 ); 53 53 $template->append('pfoyas', $items); … … 55 55 $items = array( 56 56 'NB_IMAGES' => $row['count'], 57 'URL' => make_index_url(array('section' => ' photos_from_'.$i.'_year_ago')),58 'LABEL' => l10n(' Photos from%d years ago',$i),57 'URL' => make_index_url(array('section' => 'memories-'.$i.'-years-ago')), 58 'LABEL' => l10n('%d years ago',$i), 59 59 ); 60 60 $template->append('pfoyas', $items); … … 92 92 $items = array( 93 93 'NB_IMAGES' => $row['count'], 94 'URL' => make_index_url(array('section' => ' photos_from_1_year_ago')),94 'URL' => make_index_url(array('section' => 'memories-1-year-ago')), 95 95 'LABEL' => l10n('1 year ago'), 96 96 ); … … 98 98 $items = array( 99 99 'NB_IMAGES' => $row['count'], 100 'URL' => make_index_url(array('section' => ' photos_from_'.$i.'_year_ago')),100 'URL' => make_index_url(array('section' => 'memories-'.$i.'-years-ago')), 101 101 'LABEL' => l10n('%d years ago',$i), 102 102 ); -
extensions/memories/language/en_UK/description.txt
r32196 r32197 1 Add a "Photos from 1 year ago" link in "Specials" menu.1 Add part "photos from year ago". Link in "Specials/explore" menu or Block menu or other page with PWG Stuffs. -
extensions/memories/language/en_UK/plugin.lang.php
r32196 r32197 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Photos from one year ago for Piwigo by TEMMII|3 // | Memories for Piwigo by TEMMII | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 20 20 // +-----------------------------------------------------------------------+ 21 21 22 $lang['Photos from year ago'] = 'Photos from year ago'; 22 $lang['Memories'] = 'Memories'; 23 $lang['Memories 1 year ago'] = 'Memories 1 year ago'; 23 24 $lang['1 year ago'] = '1 year ago'; 24 25 $lang['%d years ago'] = '%d years ago'; 25 $lang['Photos from 1 year ago'] = 'Photos from 1 year ago'; 26 $lang['Displays photos from 1 year ago'] = 'Displays photos from 1 year ago'; 26 $lang['Displays Memories year ago'] = 'Displays Memories year ago'; 27 27 $lang['more photos'] = 'more photos'; 28 28 $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'; 29 $lang['Photos from %d years ago'] = 'Photos from %d years ago';30 $lang['Photos from %d'] = 'Photos from %d';31 29 $lang['Photos from'] = 'Photos from'; 32 30 $lang['Number year you want see'] = 'Number year you want see'; … … 42 40 $lang['yes'] = 'yes'; 43 41 $lang['no'] = 'no'; 42 $lang['link in blocks'] = 'link in blocks'; 43 $lang['link to memories page'] = 'link to memories page'; -
extensions/memories/language/fr_FR/description.txt
r32125 r32197 1 Ajoutez un lien "Photos d'il y a un an" dans le menu "Spéciales".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 -
extensions/memories/language/fr_FR/plugin.lang.php
r32196 r32197 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Photos from one year ago for Piwigo by TEMMII|3 // | Memories for Piwigo by TEMMII | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 20 20 // +-----------------------------------------------------------------------+ 21 21 22 $lang['Photos from year ago'] = 'Photos d\'il y a 1 an'; 22 $lang['Memories'] = 'Souvenir'; 23 $lang['Memories 1 year ago'] = 'Souvenir 1 ans déjà'; 23 24 $lang['1 year ago'] = 'il y a 1 an'; 24 25 $lang['%d years ago'] = 'il y a %d ans'; 25 $lang['Photos from 1 year ago'] = 'Photos d\'il y a 1 an'; 26 $lang['Displays photos from 1 year ago'] = 'Affiche les photos d\'il y a 1 an'; 26 $lang['Displays Memories year ago'] = 'Affiche les souvenirs d\'un an'; 27 27 $lang['more photos'] = 'plus de photos'; 28 28 $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'; 29 $lang['Photos from %d years ago'] = 'Photos d\'il y a %d ans';30 29 $lang['Photos from %d'] = 'Photos du %d'; 31 30 $lang['Photos from'] = 'Photos du'; … … 42 41 $lang['yes'] = 'oui'; 43 42 $lang['no'] = 'non'; 43 $lang['link in blocks'] = 'lien dans le blocs'; 44 $lang['link to memories page'] = 'lien vers la page souvenir'; -
extensions/memories/main.inc.php
r32196 r32197 1 1 <?php 2 2 /* 3 Plugin Name: Photos from one year ago3 Plugin Name: Memories 4 4 Version: auto 5 Description: Add a "photos from one year ago" link in "Specials" menu.5 Description: Add part "photos from year ago". Link in "Specials/explore" menu or Block menu or other page with PWG Stuffs. 6 6 Plugin URI: https://piwigo.org/ext/extension_view.php?eid=893 7 7 Author: ddtddt … … 10 10 11 11 // +-----------------------------------------------------------------------+ 12 // | Photos from one year ago for Piwigo by TEMMII|12 // | Memories for Piwigo by TEMMII | 13 13 // +-----------------------------------------------------------------------+ 14 14 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 52 52 load_language('plugin.lang', PFOYA_PATH); 53 53 $menu[] = array( 54 'NAME' => l10n(' Photos from year ago'),54 'NAME' => l10n('Memories'), 55 55 'URL' => PFOYA_ADMIN, 56 56 ); … … 68 68 if (($block = $menu->get_block('mbSpecials')) != null){ 69 69 array_splice($block->data, ($confpfoya['pfoya_position'])-1, 0, 70 array(' photos_from_one_year_ago' =>70 array('memories-1-year-ago' => 71 71 array( 72 'URL' => make_index_url(array('section' => ' photos_from_1_year_ago')),73 'TITLE' => l10n('Displays photos fromyear ago'),74 'NAME' => l10n(' Photos from year ago')72 'URL' => make_index_url(array('section' => 'memories-1-year-ago')), 73 'TITLE' => l10n('Displays Memories year ago'), 74 'NAME' => l10n('Memories') 75 75 ) 76 76 ) … … 93 93 $menu = & $menu_ref_arr[0]; 94 94 listyearsBlock(); 95 $template->assign('PFOAYALINKM',make_index_url(array('section' => ' photos_from_1_year_ago')));95 $template->assign('PFOAYALINKM',make_index_url(array('section' => 'memories-1-year-ago'))); 96 96 97 97 if (($block = $menu->get_block('mbpfoya')) != null) { … … 113 113 global $tokens, $page, $conf, $template, $user; 114 114 $confpfoya = safe_unserialize($conf['pfoya']); 115 $testurl = explode(' photos_from_', $_SERVER['REQUEST_URI']);116 $template->assign('PFOAYALINK',make_index_url(array('section' => ' photos_from_1_year_ago')));115 $testurl = explode('memories-', $_SERVER['REQUEST_URI']); 116 $template->assign('PFOAYALINK',make_index_url(array('section' => 'memories-1-year-ago'))); 117 117 if(!empty($testurl[1])){ 118 118 … … 123 123 listyears(); 124 124 } 125 if($testurl[1]=='1 _year_ago'){126 if (!in_array(' photos_from_1_year_ago', $tokens)){return;}125 if($testurl[1]=='1-year-ago'){ 126 if (!in_array('memories-1-year-ago', $tokens)){return;} 127 127 $daydate=date("Y-m-d", strtotime('-1 year')); 128 128 $query = ' … … 142 142 $query .= ' 143 143 and DATE ('.$datepfoya.') ="'.$daydate.'";'; 144 $page['section'] = ' photos_from_1_year_ago';145 $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n(' Photos from1 year ago') . '</a>';144 $page['section'] = 'memories-1-year-ago'; 145 $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('1 year ago') . '</a>'; 146 146 $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>' 147 147 . $conf['level_separator'] . $page['title']; … … 150 150 151 151 }else{ 152 $yurl=explode(' _year_ago', $testurl[1]);152 $yurl=explode('-years-ago', $testurl[1]); 153 153 $yurl=$yurl[0]; 154 if (!in_array(' photos_from_'.$yurl.'_year_ago', $tokens)){return;}154 if (!in_array('memories-'.$yurl.'-years-ago', $tokens)){return;} 155 155 $daydate=date("Y-m-d", strtotime('-'.$yurl.' year')); 156 156 $query = ' … … 170 170 $query .= ' 171 171 and DATE ('.$datepfoya.') ="'.$daydate.'";'; 172 $page['section'] = ' photos_from_'.$yurl.'_year_ago';173 $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n(' Photos from%d years ago',$yurl) . '</a>';172 $page['section'] = 'memories-'.$yurl.'-years-ago'; 173 $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('%d years ago',$yurl) . '</a>'; 174 174 $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>' 175 175 . $conf['level_separator'] . $page['title']; … … 196 196 array_push($modules, array( 197 197 'path' => PFOYA_PATH.'/blockhome', 198 'name' => l10n(' Photos from1 year ago'),198 'name' => l10n('Memories 1 year ago'), 199 199 'description' => l10n('Display X photos from 1 year ago in the gallery or a album'), 200 200 ) -
extensions/memories/maintain.class.php
r32196 r32197 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | Photos from one year ago for Piwigo by TEMMII|3 // | Memories for Piwigo by TEMMII | 4 4 // +-----------------------------------------------------------------------+ 5 5 // | Copyright(C) 2008-2020 ddtddt http://temmii.com/piwigo/ | … … 22 22 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 23 23 24 class photos_from_one_year_ago_maintain extends PluginMaintain{24 class memories_maintain extends PluginMaintain{ 25 25 26 26 private $default_conf = array( -
extensions/memories/menubar_pfoya.tpl
r32196 r32197 6 6 7 7 {/html_style} 8 <dt>{' Photos from year ago'|@translate}</dt>8 <dt>{'Memories'|@translate}</dt> 9 9 <dd> 10 10 <ul> -
extensions/memories/menubar_pfoya_bootstrap.tpl
r32196 r32197 1 1 <li id="pfoyaDropdownMenu" class="nav-item dropdown"> 2 <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">{' Photos from year ago'|@translate}</a>2 <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">{'Memories'|@translate}</a> 3 3 <div class="dropdown-menu dropdown-menu-right" role="menu"> 4 4 {foreach from=$pfoyasblock item=pfoya} -
extensions/memories/menubar_pfoya_modus.tpl
r32196 r32197 13 13 {/html_style} 14 14 15 <dt><a href="{$PFOAYALINKM}">{' Photos from year ago'|@translate}</a></dt>15 <dt><a href="{$PFOAYALINKM}">{'Memories'|@translate}</a></dt> 16 16 <dd> 17 17 <ul> -
extensions/memories/menubar_pfoya_smartpocket.tpl
r32196 r32197 1 <h3>{' Photos from year ago'|@translate}</h3>1 <h3>{'Memories'|@translate}</h3> 2 2 <ul data-role="listview"> 3 3 {foreach from=$pfoyasblock item=pfoya}
Note: See TracChangeset
for help on using the changeset viewer.