SocialEngine Zend getting user profile picture

痞子三分冷 提交于 2019-12-04 19:13:45
Salman

$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)

Fred Sanders

You could also use: $this->viewer()->getIdentity().

Rahul Shukla

This will print image with profile link.

<?php
$member2 = Engine_Api::_()->user()->getUser($user_id);
echo $this->htmlLink($member2->getHref(), $this->itemPhoto($member2, 'thumb.icon'), array('class' => 'placement_members_icon'))

?>

replace $user_id in first line with desired user id.... that you can get easily from any table or user table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!