How can I add an additional Timestamp to be displayed next to every photo Thumbnail?
So it will display:
Date taken: 04/21/2001
Date uploaded: 02/05/2007
Views: 296
(adding the words "taken" and "uploaded" I know.. I just need help implementing the extra timestamp code)
I thought that all I had to do was edit ItemInfo.tpl
I tried the following..... (you can tell I don't know PHP, but at least I try fiddling with it)
<div class="{$class}">
{if !empty($showDate)}
<div class="date summary">
{capture name=childTimestamp}{g->date timestamp=$item.originationTimestamp}{/capture}
{capture name=childTimestamp}{g->date timestamp=$item.creationTimestamp}{/capture}
{g->text text="Date: %s" arg1=$smarty.capture.childTimestamp}
</div>
{/if}
That didn't work..
So I tried just adding an extra DIV below the first one..
<div class="{$class}">
{if !empty($showDate)}
<div class="date summary">
{capture name=childTimestamp}{g->date timestamp=$item.originationTimestamp}{/capture}
{g->text text="Date taken: %s" arg1=$smarty.capture.childTimestamp}
</div>
{/if}
<div class="{$class}">
{if !empty($showDate)}
<div class="date summary">
{capture name=childTimestamp}{g->date timestamp=$item.creationTimestamp}{/capture}
{g->text text="Date uploaded: %s" arg1=$smarty.capture.childTimestamp}
</div>
{/if}
Of course that didn't work either.
Could someone please help me?
Also.. This is just for picture Dates.. I don't want to make any changes to "Album" Dates.
Thank you!!
Posts: 27300
Not sure what theme you are using but album.tpl should have a loop that starts like:
{foreach from=$theme.children item=child}
then below that you should be able to use:
{g->date timestamp=$child.originationTimestamp}
{g->date timestamp=$child.creationTimestamp}
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 32509
haven't looked too cloely, but you need to give the two captures different names
{capture name=originationTimestamp}{g->date timestamp=$item.originationTimestamp}{/capture}
{capture name=creationTimestamp}{g->date timestamp=$item.creationTimestamp}{/capture}
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 143
Oh my!! I got a response from both of you... I thought for a while that I was being ignored here!!
THANK YOU!!
Dave, I am using the Classic Theme.. I need to remember to always specify that when I ask questions here. Sorry!!
Your code (album.tpl) generated all these dates below, just like it looks here, right on the top of the pictures thumbnails page (below the Album's name and description).
04/21/2007 04/28/2007 04/21/2007 04/28/2007 08/19/2006 04/28/2007 10/08/2006 04/28/2007 04/22/2007 04/28/2007 03/17/2007 04/28/2007 04/07/2007 04/28/2007 12/29/2006 04/28/2007 05/29/2007 06/05/2007 06/24/2007 07/01/2007 01/05/2007 07/10/2007 01/05/2007 07/10/2007
So that didn't work. But thanks for trying to help.
-------------
Valiant, your code (ItemInfo.tpl) worked great, but it also added the same thing in the Album page level... I don't want to have the 2 dates on the Album level because it doesn't make any sense.. to say "Date taken" for an Album. Only for pictures.
Look: (this is just my Test Gallery)
http://www.alexandradavila.com/gallery2/main.php
And when you go inside the Album... then the dates next to the thumbs are perfect. But at the top where it again displays the ALBUM date, it shouldn't have both either.
I understand that this may get a little bit more complicated now... since ItemInfo.tpl seems to take care of those "Dates" everywhere huh? I hope I'm wrong, and it can be fixed.
And just curious... something strange happened...
When I added your code, it totally messed up the FONT for the "second Date" and the "Views"... I don't know why. I had to change the font on theme.css for .giInfo, from 0.9em (originally), to 1em, and that fixed the weird font mess-up.
If you have the Web Developer Toolbar on Firefox, take a look... then change .giInfo back to 0.9em and see what happens. The font was ok at 0.9em before I added your code. Wonder why it shrunk afterwards... and changing to 1em fixed it.
Posts: 27300
I thought that you would have move the code to where you would like it. And add some text to what you wanted.
anyway albums.tpl I added the bold and it seems to work for me.
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 143
Beautiful!!!
But I just had to add the css to your code because the words were all black.
But... one more minor detail...
On this page:
http://www.alexandradavila.com/gallery2/v/test2/
On the top left it says "Date: 02/05/2008" which is correct because it's the Date that this Album was created. Perfect!!!
But..
On the photo page:
http://www.alexandradavila.com/gallery2/v/test2/aaa.html
On the top left it says "Date: 03/26/2006".
The part about 03/26/2006 is correct, but I want it to say TAKEN. And I don't know which file should I change. I don't want to do it on ItemInfo.tpl, because it will write TAKEN on the Album thumbs level too.
I thought it would be on photo.tpl, but could not find it there. Where is it?
Remember, it's just to change it on the actual photo page.
Posts: 27300
Do you mean top Right?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 143
Sorry... yes... brain tired.. As my husband says "the other left".. ha ha
Posts: 27300
in photo.tpl it is rendered with is bit of code:
I would change to
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 143
Worked....
But uuuugh... It took the css color of the font again...
So I tried adding a <p class="giInfo"> or a <div class="giInfo"> as in...
And then it added a space underneath it.
http://www.alexandradavila.com/gallery2/v/test/aaa_001.html
How do I add .giInfo to your code without having to do a <p> or <div>?
Posts: 27300
_try removing the <br />
Dave
____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 143
Yesssssssssssss.... that was better than removing the <br />!!
We........ are....... DONE!!!!!!!
Well, at least on this topic... I have a few other things to modify.. but that's it for today... I am brain dead..
Thank you so much again!!