Announcement

  •  » Extensions
  •  » Memories plugin, extend date range to N days before and after

#1 2021-05-19 00:06:13

Amony
Member
2020-05-07
3

Memories plugin, extend date range to N days before and after

Hello,

I'm using piwigo as a personal photo gallery, and I found the memories plugin really useful.

I would like to suggest a feature :
- Extend the date range to N days before or after the target date.

For example, instead of having photos from exactly 1 year ago, have the photos range a couple days around 1 year ago (+/- 5 days for example).

I'm more of a embedded developer, but I managed the following modification in main.inc.php to achieve kind of what I wanted :

```
- $daydate=date("Y-m-d", strtotime('-1 year'));
+ $date_min=date("Y-m-d", strtotime('-1 year -5 days'));
+ $date_max=date("Y-m-d", strtotime('-1 year +5 days'));
```

and

```
- $query .= '
-   and DATE ('.$datepfoya.') ="'.$daydate.'";';
+ $query .= '
+   and DATE ('.$datepfoya.') >="'.$date_min.'"';
+ $query .= '
+   and DATE ('.$datepfoya.') <="'.$date_max.'";';
```

I think anyone with actual php knowledge could do this cleanly in a heartbeat, with a parameter in the plugin admin page.

Thanks in advance !

Offline

 

#2 2022-04-17 11:20:05

WilbertS
Member
2022-04-17
1

Re: Memories plugin, extend date range to N days before and after

Memories extension is a great enhancement, thanks!
Extended range would be good, perhaps pictures from the same week (number)?
Another wish is to get notified by email when Memories are available.

Memories feature would be nice in mobile App too!

Offline

 

#3 2022-08-02 20:37:53

ychemineau
Member
2022-08-02
4

Re: Memories plugin, extend date range to N days before and after

This extension is (almost) exactly what I was looking for for a few years, thanks ! (Until now, I was using an excel file to create a link for each year for the day‘s date)

Just maybe two suggestions :
1– In the drop down menu, would it be possible to hide the the « empty » years (i e : years with no photos on this date) ?
2- Could we have an option for « all years » ? This de-activable option could display all photos created/added on this date for all years.

Offline

 

#4 2022-08-03 08:18:29

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7054

Re: Memories plugin, extend date range to N days before and after

Hi :-)

ychemineau wrote:

1– In the drop down menu, would it be possible to hide the the « empty » years (i e : years with no photos on this date) ?

other users wanted all years ...

ychemineau wrote:

Could we have an option for « all years » ? This de-activable option could display all photos created/added on this date for all years.

All the photos of the date without the year on a single page that's it


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#5 2022-08-03 10:04:35

ychemineau
Member
2022-08-02
4

Re: Memories plugin, extend date range to N days before and after

ddtddt wrote:

Hi :-)

ychemineau wrote:

1– In the drop down menu, would it be possible to hide the the « empty » years (i e : years with no photos on this date) ?

other users wanted all years ...

Or maybe just as an option to the add-on ? :)

Photos on my gallery were shot since 2007, so displaying a 15 years drop down menu is quite annoying when only 4 or 5 dates are not empty.

Not a big issue as I‘ve edited the menubar_pfoya.tpl file myself as follows, for my own use :

Code:

{foreach from=$pfoyasblock item=pfoya}

    {if ($pfoya.NB_IMAGES>0)}

    <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}

My programming years are quite far away, so I did not take time to edit the other files to include some $PFOYA_EMPTY variable in the configuration files, but I will probably give it a try one day…

ddtddt wrote:

ychemineau wrote:

Could we have an option for « all years » ? This de-activable option could display all photos created/added on this date for all years.

All the photos of the date without the year on a single page that's it

Exactly :)
(and this one may be too complex for my dev skills yet :) )

Last edited by ychemineau (2022-08-03 11:10:14)

Offline

 

#6 2022-08-04 22:50:51

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7054

Re: Memories plugin, extend date range to N days before and after

Hi :-)

it's my hollidays, can you send me email for this


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2022-08-04 23:13:12

ychemineau
Member
2022-08-02
4

Re: Memories plugin, extend date range to N days before and after

ddtddt wrote:

Hi :-)

it's my hollidays, can you send me email for this

Pas de souci ;)

Edit :
Sorry, doesn’t work.
No worries… Nothing urgent. The only change would be to add a $pfoya.empty variable, set as 1 by default (show empty years) and have a possibility to set it to 0 on the admin menu.
The only change in the menubar_pfoya.tpl files would be this :

Code:

  {foreach from=$pfoyasblock item=pfoya}

  {if ($pfoya.NB_IMAGES==0 AND $pfoya.empty==1)}

    <li><span>{$pfoya.LABEL}</span>  </li>

  {else}

Anyway, only if this matter is of any interest for other users. Otherwise, I‘d be the only one interested :)

Last edited by ychemineau (2022-08-04 23:21:02)

Offline

 
  •  » Extensions
  •  » Memories plugin, extend date range to N days before and after

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact