Jump to the post that solved this thread.
Not Solved Get the url of a users avatar given their uid or username?
#1
Not Solved
Is there a way to get the avatar url of a user given either their uid or username? This will not necessarily be the logged in user.
Reply
#2
Not Solved
You can get the avatar of a user using the below code :-
{$mybb->user['avatar']}

Regards
WallBB
Reply
#3
Not Solved
(2017-01-10, 10:42 AM)WallBB Wrote: You can get the avatar of a user using the below code :-
{$mybb->user['avatar']}

Regards
WallBB
 That gets the avatar of the currently logged in user, how do I get the avatar of any user given either their username or uid?
Reply
#4
Not Solved
$query = $db->simple_select("users", "avatar", "uid=$uid");
$avatarurl = $db->fetch_field($query, "avatar");

Note that avatars don't use a full path url when uploaded;, they use a relative path.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)