Skip to:

Date the image was uploaded?

  • kirkslater



    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


Viewing 1 replies (of 1 total)

  • 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.


Viewing 1 replies (of 1 total)
  • The topic ‘Date the image was uploaded?’ is closed to new replies.
Skip to toolbar