Add a date of last update to an album or sub album?

domino1891

Joined: 2008-03-03
Posts: 2
Posted: Mon, 2008-03-03 17:12

Is there a setting to add an automatic date/time to the first page of album and/or sub album to indicate when last change or addition was made?

thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2008-03-03 18:30

http://codex.gallery2.org/Gallery2:Modules:newitems

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
domino1891

Joined: 2008-03-03
Posts: 2
Posted: Tue, 2008-03-04 16:43

Thanks, I'll give it a try.

 
ragnard

Joined: 2008-03-04
Posts: 2
Posted: Tue, 2008-03-04 17:02

Unfortunately, that module only puts a New icon up for new items. What I am looking for, and I think the original poster is too, is an actual Date or timestamp of when the last update was made. This way a visitor can quickly see if there is anything new since they visited last. The New icon isn't exact enough to make this decision.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-03-04 19:08

{if $child.canContainChildren}{g->text text="This album last modified:"}{$child.modificationTimestamp|date_format}{/if}
to album.tpl
line 130 in matrix works for me.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ragnard

Joined: 2008-03-04
Posts: 2
Posted: Tue, 2008-03-04 19:35

Thanks Dave. I dug into the theme variable docs and found this out. I'm constantly impressed by the flexibility of Gallery2!

This method works great. For anyone wanting to use this, do keep in mind that the modificationTimestamp gets updated with every change, not just a picture upload. If you change a theme element for that Album, or just rotate an image, it gets updated. This makes sense, just understand that if you plan on using this method.

 
greenteagod

Joined: 2004-05-20
Posts: 38
Posted: Sat, 2008-05-24 09:27

Sorry to resurrect this one, but I've installed this and am having a bit of trouble with it. It works great as far as the parent album goes, but if an album has sub albums is there any way to have it read the last modified date all the way up the chain?

 
greenteagod

Joined: 2004-05-20
Posts: 38
Posted: Wed, 2008-10-15 05:20

Guess not.

 
ASNet0007

Joined: 2006-10-17
Posts: 177
Posted: Thu, 2008-10-16 14:20

Any idea what I would need to add to show on the root album a date of the last update, even if the album updated was nested down a few levels. I want my users to see at the top of the main page the date I last made a change in the site.

Would I need to change the $child to something else in {$child.modificationTimestamp|date_format}?

Cheers

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2008-10-16 23:17

You would have to loop through each sub-item read the date and then display the date that is newest. I am sure it would impact performance and don't know how to do it all in smarty so I can't help much. I am sure it has been asked before but don't know the right keywords to use in a search.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2008-10-19 00:26

I don't think it can be done in Smarty alone. I'm pretty sure you'd have to edit theme.inc and load data for all the parent albums, then you could iterate them through with Smarty. I'm pretty sure the impact on performance would not be worth it as I'm pretty sure you'd be taking database hits for each level of albums you go down so the more levels of albums the slower things will go and the longer pages will take to load if things don't start timing out and just giving you a blank page.

I'm pretty sure this would be the same for what greenteagod and ASNet0007 asked for, only a bit different since one wants to load parents and one wants to load children.

For ASNet0007's issue you can take a look at the Siriux_ijonized theme: http://codex.gallery2.org/Gallery2:Themes:siriux_ijonized Open theme.inc and search for /* Add resizedId to child values */

That bit of code loads some child information, but I think only for one level down, grabbing resized version info for thumbnails of images, not albums. He's not the original author of the code and I don't know where it came from, I know I've seen it in a slightly cleaner state in another theme, (maybe PG or X_treme) but I know the siriux_ijonized theme has it. Nor, do I know exactly everything it's doing as I'm not a coder, just a hack ;)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here