findingpeace
07-29-2014, 04:43 PM
I try to use the official avatarurl because it has the dateline built in (so stuff doesn't get stuck in cache when people update their avatar), but it's not in a lot of templates. So I've tried making a plugin to make it work manually, but I'm having some trouble.
Example with MEMBERINFO:
require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
Then in MEMBERINFO, I use:
{vb:raw avatarurl}
It sort of works, except it displays my OWN avatar everywhere! Basically it just seems to take the current user's avatar and display it.
What I need is for the user ID to match the user ID of the profile I'm viewing. So if I'm user 1, and I view user 5's profile, I should see user 5's avatar, not my own.
Thanks!
Example with MEMBERINFO:
require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
Then in MEMBERINFO, I use:
{vb:raw avatarurl}
It sort of works, except it displays my OWN avatar everywhere! Basically it just seems to take the current user's avatar and display it.
What I need is for the user ID to match the user ID of the profile I'm viewing. So if I'm user 1, and I view user 5's profile, I should see user 5's avatar, not my own.
Thanks!