Page 1 of 1
How to display creation date for categories?
Posted: 01 Mar 2010, 12:57
by kurahara
Title pretty much sums it up, but is there any way to show timestamp of categories (directories)? Default view shows categories names and the amount of pictures, but I couldn't find any settings for displaying date.
Re: How to display creation date for categories?
Posted: 01 Mar 2010, 13:22
by Jan
Hi, this needs to be customized, so in e.g. categories view you need to load the creation date from database (maybe it is loaded) and then into the template of categories view paste this value on some place you want.
Jan
Re: How to display creation date for categories?
Posted: 19 Apr 2010, 14:05
by kurahara
Thanks for your reply.
I'm a bit noob when it comes to php. I tried to display date like this:
echo $this->categories[$i]->date;
But it didn't work. Can anyone please guide me to right direction?
Re: How to display creation date for categories?
Posted: 20 Apr 2010, 13:53
by kurahara
I managed to solve this. Hopefully somenone with better php abilities will check my solution.
I added date to variable list in "models/categories.php" at line 152 (function _categoryTree):
$tree[$iCT]->date = $key->date;
And then display it in "categories/tmpl/default.php":
$myDate = $this->categories[$i]->date;
echo date('d.m.Y',strtotime($myDate));