Member
Member
anand   2018-10-03, 18:13
#1

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.

Member
Member
anand   2018-10-03, 18:17
#2

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)

Administrator
Administrator
acrylian   2018-10-03, 18:49
#3

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

Member
Member
anand   2018-10-03, 19:08
#4

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

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.