PDA

View Full Version : Check if user has custom avatar


squishi
04-16-2011, 04:59 PM
I hook into the member_build_blocks_start hook with a plugin.

I want to check if the current (logged-in) user has a custom avatar.

I already inspected the $vbulletin->userinfo object.
The only sign that I could find is "avatarid = 0" in the userinfo for my account (with a custom avatar).
So I can check if a user has a generic avatar, I suppose.

But how do I check if a user has a custom avatar?
I don't want to just add another query, btw.

--------------- Added 1302977327 at 1302977327 ---------------

Hmmm.... when snooping around on other profiles, I found
$vbulletin->userinfo['hascustomavatar']

For me as logged-in user, this variable was not set, though. That is strange, because I have a custom avatar as well.

kh99
04-16-2011, 07:46 PM
I'm not sure I understand it all, but it kind of looks like you might be out of luck if you don't want to do a query. I think 'hascustomavatar' is only set when it's needed.