Adding last update and comment to album thumb

MichelleC

Joined: 2005-04-16
Posts: 42
Posted: Thu, 2005-05-05 16:55

Sorry if this has been asked already. Searching on "last comment" or "last update" brings up tons of results.

Anyway, I'd like to add these two to the album thumb display where it gives the creation date and number of items. Is this possible? I'm pretty new to Gallery, so I'll need pretty specific help. :D

Thanks,

Michelle

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-05-10 07:09

Last modification date is easy, put this under the "Views:" code in albumBody.tpl:

          {capture name=modificationTimestamp}{g->date timestamp=$child.modificationTimestamp}{/capture} 
          {g->text text="Changed: %s" arg1=$smarty.capture.modificationTimestamp} <br/> 

Last comment is a little trickier, because the comment module doesn't return that information in summary form. You'll have to extend the comments module in order to do that. I'll show you how to do that, if you want to hack the PHP code (but I'll wait for you to confirm first).

 
MichelleC

Joined: 2005-04-16
Posts: 42
Posted: Fri, 2005-05-13 20:17

Sorry, bharat, I didn't even realized you had answered this. :( Someone helped in in the IRC channel and I wasn't able to act on it then and now I've forgotten who it was so I came here looking for the URL of this post to grep my logs with to find the help in IRC and I see the answer is right here. LOL!

Anyway, I'm not sure if I was clear. I don't want the comment itself but the _date_ of the last comment. I'm sorta copying fryfrog's site. :) So I'm looking to get something like this:

" Last changed on 04/16/2005. This album contains 3 items.
This album has been viewed 307 times since 02/25/2005.
Last comment 10/30/2004."

Thanks for the code. I'll give that a shot.

Michelle