SocialEngine Zend获取用户个人资料图片 [英] SocialEngine Zend getting user profile picture

查看:93
本文介绍了SocialEngine Zend获取用户个人资料图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

$this->itemPhoto($this->viewer(), 'thumb.icon');

$this->htmlLink($this->viewer()->getHref(), $this->itemPhoto($this->viewer(), 'thumb.icon'))

此->查看者获取正在查看页面的人员,并输出其user_id和链接.我模仿了它的输出,但是它拒绝接受它.我搜索了代码,并在用户出于某种原因上载图像时将其哈希并放入了我不能从中拉出的哈希文件夹中,但是使用上面的函数可以解决此错误.如果我想获取当前查看器或pageSubject之外的其他人的个人资料图片,将无法正常工作.有人知道如何使此功能正常工作吗?

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?

缺乏社交引擎帮助和糟糕的api使得这一点变得很困难.

The lack of socialengine help and awful api are making this hard.

推荐答案

$this->viewer()实际上是已登录用户的对象.如果您的用户未登录,则此代码将不会输出任何内容.

$this->viewer() actually is the logged-in user's object. If your user is not logged in this code won't output anything.

编辑:它是用户对象.您可以使用Engine_Api::_()->user()->getViewer(),或者如果您知道查看器的user_id/电子邮件,请使用Engine_Api::_()->user()->getUser($user_id)

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)

这篇关于SocialEngine Zend获取用户个人资料图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆