How to display creation date for categories?
-
kurahara
- Phoca Newbie

- Posts: 3
- Joined: 01 Mar 2010, 12:51
How to display creation date for categories?
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.
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to display creation date for categories?
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
Jan
If you find Phoca extensions useful, please support the project
-
kurahara
- Phoca Newbie

- Posts: 3
- Joined: 01 Mar 2010, 12:51
Re: How to display creation date for categories?
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?
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?
-
kurahara
- Phoca Newbie

- Posts: 3
- Joined: 01 Mar 2010, 12:51
Re: How to display creation date for categories?
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));
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));