Log in

View Full Version : Template Hook Avatar


Kriskof
12-15-2012, 04:12 PM
Hi, I'm currently using 3.8.7 and want to display and switch the user's avatar on the side of the template when they change it but can't seem to get it to work.

I'm currently using:

<img src="image.php?u=$bbuserinfo[userid]">

This displays their current avatar, but the image stays the same even if they change avatars or even logout and log back in. I want it to change when they change their avatar. I read that you need can use a template hook to get this done, but I can't find the solution for it. If anybody can help, that'd be great. Thanks.

kh99
12-15-2012, 05:15 PM
image.php only works if the user has a custom avatar, and the reason that you're having that problem is that the browser caches it. To get around that it needs to have the "avatardate" field as a parameter. We discussed it a while ago in this thread: www.vbulletin.org/forum/showthread.php?p=2370595&highlight=image.php (I think the final working code is in the next to the last post).

Kriskof
12-15-2012, 05:31 PM
image.php only works if the user has a custom avatar, and the reason that you're having that problem is that the browser caches it. To get around that it needs to have the "avatardate" field as a parameter. We discussed it a while ago in this thread: www.vbulletin.org/forum/showthread.php?p=2370595&highlight=image.php (I think the final working code is in the next to the last post).
Wow, I spent all that time looking and it was right there. Got it to work, thank you very much for the response and the code itself.