Changeset 32197


Ignore:
Timestamp:
May 11, 2020, 10:54:44 PM (4 years ago)
Author:
ddtddt
Message:

[photos_from_one_year_ago] to memories

Location:
extensions/memories
Files:
14 edited
1 moved

Legend:

Unmodified
Added
Removed
  • extensions/memories/admin.php

    r32196 r32197  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photos from one year ago for Piwigo by TEMMII                         |
     3// | Memories for Piwigo by TEMMII                                         |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    8282$template->assign('pfoya4T', $PFOYA4T);
    8383
     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
    8499
    85100if (isset($_POST['submitpfoya'])){
  • extensions/memories/admin.tpl

    r32196 r32197  
    4040
    4141<div class="titrePage">
    42     <h2>{'Photo from year ago'|@translate}</h2>
     42    <h2>{'Memories'|@translate}</h2>
    4343</div>
    4444
     
    7272        <p>
    7373        <strong>{'Show other years on PWG Stuffs Block'|@translate}</strong>
    74         <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashowps" values=$pfoya4 output=$pfoya4T selected="{$PFOYA_SHOWPS}"}</div>
     74        <div class="pfoyaradio">{html_radios separator="<br>" name="submitpfoyashowps" values=$pfoya8 output=$pfoya8T selected="{$PFOYA_SHOWPS}"}</div>
    7575    </p>
    7676        <br>
  • extensions/memories/blockhome/main.inc.php

    r32196 r32197  
    11<?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// +-----------------------------------------------------------------------+
    221
    322if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     
    1938}
    2039
    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');
    2241        $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        }
    2348       
    2449        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'));
    2651          $query = '
    2752                SELECT COUNT(DISTINCT(i.id)) as count
     
    3964                        );
    4065          $query .= '
    41                 and DATE ('.$datepfoya.') ="'.$daydate.'";';
     66                and DATE ('.$datepfoya.') ="'.$daydate2.'";';
    4267
    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"].'&amp;memodate='.$i;
     80          }
    4581          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');
    5283          }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);
    5985          }
     86          $template->append('pfoyas', $items);
    6087        }
    6188
    62        
    63         $daydate=date("Y-m-d", strtotime('-1 year'));
    6489 $query = '
    6590SELECT DISTINCT(i.id)
     
    91116    $page['items'] = array_from_query($query, 'id');
    92117        $page['start'] = 0;
    93         $page['section'] = ' Photos_from_1_year_ago';
     118        $page['section'] = 'memories-1-year-ago';
    94119        $page['nb_image_page']=$pfoyanip;
    95120
  • extensions/memories/include/function.pfoya.inc.php

    r32196 r32197  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photos from one year ago for Piwigo by TEMMII                         |
     3// | Memories for Piwigo by TEMMII                                         |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    4848            $items = array(
    4949                  'NB_IMAGES' => $row['count'],
    50                   'URL' => make_index_url(array('section' => 'photos_from_1_year_ago')),
    51                   'LABEL' => l10n('Photos from 1 year ago'),
     50                  'URL' => make_index_url(array('section' => 'memories-1-year-ago')),
     51                  'LABEL' => l10n('1 year ago'),
    5252                );
    5353            $template->append('pfoyas', $items);
     
    5555                $items = array(
    5656                  '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),
    5959                );
    6060            $template->append('pfoyas', $items);
     
    9292            $items = array(
    9393                  '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')),
    9595                  'LABEL' => l10n('1 year ago'),
    9696                );
     
    9898                $items = array(
    9999                  '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')),
    101101                  'LABEL' => l10n('%d years ago',$i),
    102102                );
  • extensions/memories/language/en_UK/description.txt

    r32196 r32197  
    1 Add a "Photos from 1 year ago" link in "Specials" menu.
     1Add 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  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photos from one year ago for Piwigo by TEMMII                         |
     3// | Memories for Piwigo by TEMMII                                         |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    2020// +-----------------------------------------------------------------------+
    2121
    22 $lang['Photos from year ago'] = 'Photos from year ago';
     22$lang['Memories'] = 'Memories';
     23$lang['Memories 1 year ago'] = 'Memories 1 year ago';
    2324$lang['1 year ago'] = '1 year ago';
    2425$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';
    2727$lang['more photos'] = 'more photos';
    2828$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';
    3129$lang['Photos from'] = 'Photos from';
    3230$lang['Number year you want see'] = 'Number year you want see';
     
    4240$lang['yes'] = 'yes';
    4341$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".
     1Ajoutez 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  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photos from one year ago for Piwigo by TEMMII                         |
     3// | Memories for Piwigo by TEMMII                                         |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    2020// +-----------------------------------------------------------------------+
    2121
    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à';
    2324$lang['1 year ago'] = 'il y a 1 an';
    2425$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';
    2727$lang['more photos'] = 'plus de photos';
    2828$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';
    3029$lang['Photos from %d'] = 'Photos du %d';
    3130$lang['Photos from'] = 'Photos du';
     
    4241$lang['yes'] = 'oui';
    4342$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  
    11<?php
    22/*
    3 Plugin Name:  Photos from one year ago
     3Plugin Name:  Memories
    44Version: auto
    5 Description: Add a "photos from one year ago" link in "Specials" menu.
     5Description: Add part "photos from year ago". Link in "Specials/explore" menu or Block menu or other page with PWG Stuffs.
    66Plugin URI: https://piwigo.org/ext/extension_view.php?eid=893
    77Author: ddtddt
     
    1010
    1111// +-----------------------------------------------------------------------+
    12 // | Photos from one year ago for Piwigo by TEMMII                         |
     12// | Memories for Piwigo by TEMMII                                         |
    1313// +-----------------------------------------------------------------------+
    1414// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    5252    load_language('plugin.lang', PFOYA_PATH);
    5353    $menu[] = array(
    54         'NAME' => l10n('Photos from year ago'),
     54        'NAME' => l10n('Memories'),
    5555        'URL' => PFOYA_ADMIN,
    5656    );
     
    6868  if (($block = $menu->get_block('mbSpecials')) != null){
    6969        array_splice($block->data, ($confpfoya['pfoya_position'])-1, 0,
    70           array('photos_from_one_year_ago' =>
     70          array('memories-1-year-ago' =>
    7171                array(
    72                   'URL' => make_index_url(array('section' => 'photos_from_1_year_ago')),
    73                   'TITLE' => l10n('Displays photos from year 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')
    7575                )
    7676          )
     
    9393    $menu = & $menu_ref_arr[0];
    9494        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')));
    9696
    9797    if (($block = $menu->get_block('mbpfoya')) != null) {
     
    113113  global $tokens, $page, $conf, $template, $user;
    114114  $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')));
    117117  if(!empty($testurl[1])){
    118118
     
    123123                listyears();
    124124        }
    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;}
    127127                        $daydate=date("Y-m-d", strtotime('-1 year'));
    128128                    $query = '
     
    142142                          $query .= '
    143143                                   and DATE ('.$datepfoya.') ="'.$daydate.'";';
    144                 $page['section'] = 'photos_from_1_year_ago';
    145             $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('Photos from 1 year ago') . '</a>';
     144                $page['section'] = 'memories-1-year-ago';
     145            $page['title'] = '<a href="' . duplicate_index_url() . '">' . l10n('1 year ago') . '</a>';
    146146            $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>'
    147147                  . $conf['level_separator'] . $page['title'];
     
    150150
    151151          }else{
    152                 $yurl=explode('_year_ago', $testurl[1]);
     152                $yurl=explode('-years-ago', $testurl[1]);
    153153                $yurl=$yurl[0];
    154                 if (!in_array('photos_from_'.$yurl.'_year_ago', $tokens)){return;}
     154                if (!in_array('memories-'.$yurl.'-years-ago', $tokens)){return;}
    155155                $daydate=date("Y-m-d", strtotime('-'.$yurl.' year'));
    156156                  $query = '
     
    170170                  $query .= '
    171171                           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>';
    174174            $page['section_title'] = '<a href="'.get_gallery_home_url().'">' . l10n('Home') . '</a>'
    175175                  . $conf['level_separator'] . $page['title'];
     
    196196  array_push($modules, array(
    197197    'path' => PFOYA_PATH.'/blockhome',
    198     'name' => l10n('Photos from 1 year ago'),
     198    'name' => l10n('Memories 1 year ago'),
    199199    'description' => l10n('Display X photos from 1 year ago in the gallery or a album'),
    200200    )
  • extensions/memories/maintain.class.php

    r32196 r32197  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photos from one year ago for Piwigo by TEMMII                         |
     3// | Memories for Piwigo by TEMMII                                         |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    2222if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    2323
    24 class photos_from_one_year_ago_maintain extends PluginMaintain{
     24class memories_maintain extends PluginMaintain{
    2525
    2626  private $default_conf = array(
  • extensions/memories/menubar_pfoya.tpl

    r32196 r32197  
    66
    77{/html_style}
    8 <dt>{'Photos from year ago'|@translate}</dt>
     8<dt>{'Memories'|@translate}</dt>
    99<dd>
    1010 <ul>
  • extensions/memories/menubar_pfoya_bootstrap.tpl

    r32196 r32197  
    11<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>
    33    <div class="dropdown-menu dropdown-menu-right" role="menu">
    44 {foreach from=$pfoyasblock item=pfoya}
  • extensions/memories/menubar_pfoya_modus.tpl

    r32196 r32197  
    1313{/html_style}
    1414
    15 <dt><a href="{$PFOAYALINKM}">{'Photos from year ago'|@translate}</a></dt>
     15<dt><a href="{$PFOAYALINKM}">{'Memories'|@translate}</a></dt>
    1616<dd>
    1717  <ul>
  • extensions/memories/menubar_pfoya_smartpocket.tpl

    r32196 r32197  
    1 <h3>{'Photos from year ago'|@translate}</h3>
     1<h3>{'Memories'|@translate}</h3>
    22<ul data-role="listview">
    33  {foreach from=$pfoyasblock item=pfoya}
Note: See TracChangeset for help on using the changeset viewer.