Gravatar:我怎么知道用户是否有真实的照片 [英] Gravatar: How do I know if a user has a real picture

查看:68
本文介绍了Gravatar:我怎么知道用户是否有真实的照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在自己的网站上使用了gravatar服务.但是我想知道用户是否上传了他们的图片.有办法知道吗?

解决方案

构造URL时,请使用参数d = 404.如果用户未设置图片,这将导致Gravatar返回404错误而不是图片.

如果您使用从gravitar站点链接到的.Net控件,则需要修改IconSet枚举(可能将代码从控件中拉出,以便直接获得状态)./p>

I have gotten the gravatar service working on my site. But I would like to know if the user has uploaded their picture or not. Is there a way to know this?

解决方案

When constructing the URL, use the parameter d=404. This will cause Gravatar to return a 404 error rather than an image if the user hasn't set a picture.

If you're using the .Net control linked to from the gravitar site, you'll need to modify the IconSet enumeration (and probably pull the code out of the control, so you can get at the status directly).

这篇关于Gravatar:我怎么知道用户是否有真实的照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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