Skip to:
Content
Pages
Categories
Search
Top
Bottom

Date the image was uploaded?

  • Avatar of kirkslater
    kirkslater
    Participant

    @kirkslater

    Hi

    Just wondered if there was a function to display the date or how long ago the image was uploaded on the single view page template?

    I can see in the database that it does create this but not too sure how to call it.

    I would prefer it to be like the activity stream too where it says how long ago it was uploaded i.e.: Posted 1 day 5 hours ago
    Posted 5 minutes ago

    Any help would be cool

    Cheers

Viewing 1 replies (of 1 total)
  • Avatar of foxly
    foxly
    Participant

    @foxly

    BP-Album doesn’t have a template tag function for that, so you’d need to get at it through the pictures global. In the single-picture template, add:

    `
    global $pictuers_template;
    echo $pictures_template->picture->date_uploaded;
    `

    That will print out the date the picture was uploaded. To convert it to “time since present” format, there is a function buried somewhere in BuddyPress that converts a timestamp into this format, but I can’t find it and I can’t remember the name of it. Try digging around in the BP Activity stream classes.

    ^F^

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.