Uploader Name With Image

Hi guys. Digging through the functions in the Zenphoto Doc. Thank you so much for that fantastic resource! Hoping to find a way to (1) print the uploader's name on the image page and (2) tally user uploads. Would like to reward users for their contributions with achievement awards. Scratching my head on this one. Please advise? Thank you.

Comments

  • anand Member

    I guess I could build something using the OWNER field from the IMAGES table in the database, right? Of course, if there is already a function, that would be great! (wink)

  • acrylian Administrator

    Indeed, the owner is normally the uploader unless it has been changed afterwards.

    There is no template function but an image class method getOwner():
    https://docs.zenphoto.org/source-class-Image.html#1228-1237

    So in the theme's image.php or within the next_image loop on album.php you can use the global variable to get it like this: echo $_zp_current_image->getOwner(); This will be the user name, if you want the "nicename" if set you would additionally have to use the adminstrator class to get that from the user account: https://docs.zenphoto.org/class-Zenphoto_Administrator.html

  • anand Member

    getOwner. Brilliant! You are the best, Acrylian! Thank you very much. And WOW that was a super fast response. Many thanks.

Sign In or Register to comment.