为什么此 FQL 不返回某些用户的个人资料图片?

发布于 2024-10-22 05:34:57 字数 372 浏览 2 评论 0原文

这个 FQL 来自一个已经运行了几天的应用程序,并且已经过彻底测试:

SELECT src_big FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = {uid} AND type = 'profile')

我使用的是从 ActionScript 桥接的 JS API,并且 {uid} 部分被替换为任何 uid对应于朋友浏览器中单击的列表项。问题是,大多数时候这个查询工作得很好,返回大图像(尽管通常不是一组完整的匹配个人资料图像),但在某些情况下,查询根本不返回任何内容,只是一个空数组。检查用户的个人资料图像相册确认有大量图像可供选择。有人知道为什么会这样吗?

This FQL is from an app which has been running for a few days now, and has been thoroughly tested:

SELECT src_big FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = {uid} AND type = 'profile')

I'm using the JS API bridged from ActionScript and the {uid} part is replaced with whatever uid corresponds to a list item clicked in a friend browser. The thing is that most of the time this query works fine and nice, large images are returned (although usually not a complete set of matching profile images), but in some instances the query does not return anything at all, just an empty array. Checking the user's profile images album confirms that there are plenty of images to choose from. Anyone know why that might be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏了南城 2024-10-29 05:34:57

可能是因为该用户设置了隐私设置,因此您无法访问他们的个人资料图片。

Probably because that user has their privacy settings set so you cannot access their profile picture.

九八野马 2024-10-29 05:34:57

这是因为,如果您导航到 ,某些字段对公众可见,而其他字段则需要权限。 users.getInfo 方法,按照 < 的建议代码>用户表。您将找到可以查询任何用户的公共字段列表:

  • uid
  • first_name
  • middle_name
  • last_name
  • name
  • locale
  • current_location
  • affiliations (regional type only)
  • pic_square
  • profile_url
  • sex

现在查询相册 如果用户未授予您权限,表很可能不会返回任何内容,但值得尝试以下操作:

SELECT pic_big FROM user WHERE uid={uid}

如果它不起作用,那么您可能需要坚持使用上面列表中的 pic_square

另外值得注意的是,所有 pic 字段可能为空:

pic_big 最大尺寸的 URL
用户的个人资料图片
询问。图像最多可以有
宽度为 200px,最大高度为
600 像素。 此网址可能为空

这适用于 user 表中提到的所有图片。

重要提示:
在没有返回图像时使用后备图像(通用图像)始终是一个好习惯!

That's because some fields are visible to public and others need permissions, if you navigate to the users.getInfo method as advised from the user table. You'll find the list of public fields that you can query for any user:

  • uid
  • first_name
  • middle_name
  • last_name
  • name
  • locale
  • current_location
  • affiliations (regional type only)
  • pic_square
  • profile_url
  • sex

Now query the album table would most likely return nothing if the user didn't grant you permissions, but it's worth to try the following:

SELECT pic_big FROM user WHERE uid={uid}

If it didn't work then you may need to stick with pic_square from the list above.

Also it's worth to note that all the pic fields might be empty:

pic_big The URL to the largest-sized
profile picture for the user being
queried. The image can have a maximum
width of 200px and a maximum height of
600px. This URL may be blank.

This applies to all the pics as mentioned in the user table.

IMPORTANT NOTE:
It's always a good practice to have a fallback image (a generic image) to use whenever no image is returned!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文