I am trying to get a users profile picture by using
$this->itemPhoto($this->viewer(), 'thumb.icon');
or
$this->htmlLink($this->viewer()->getHref(), $this->itemPhoto($this->viewer(), 'thumb.icon'))
The this->viewer gets the person who is viewing the page and outputs their user_id and a link. I mimicked the output of that but it refuses to accept it. It errors out with 'Item must be a valid item." I have searched through the code and when users upload images it for some reason is hashed and put into hashed folders which i can't just pull from. But using the above functions do not work if i wanted to get the profile picture of someone else besides the current viewer or pageSubject. Does anyone know how to get this thing to work?
The lack of socialengine help and awful api are making this hard.
This will print image with profile link.
replace
$user_id
in first line with desired user id.... that you can get easily from any table or user tableYou could also use:
$this->viewer()->getIdentity()
.$this->viewer()
actually is the logged-in user's object. If your user is not logged in this code won't output anything.Edit: It is the user object. You can use
Engine_Api::_()->user()->getViewer()
or if you know the user_id/email of viewer,Engine_Api::_()->user()->getUser($user_id)