Quote:
Originally Posted by oldz442
Can I add a fetch_avatar_url($userid) to the block code somewhere? I want to display a clickable mini avatar, 4 per row similar to below. I am using file based avatars. thx
|
In the block code you would add this:
PHP Code:
// AVATAR
require_once(DIR . '/includes/functions_user.php');
$loggedin['avatarurl'] = fetch_avatar_url($loggedin['userid']);
if (!$loggedin['avatarurl']) {
$loggedin['avatarurl'] = 'images/misc/unknown.png';
} else {
$loggedin['avatarurl'] = $loggedin['avatarurl'][0];
}
// AVATAR
Then you can call it with {vb:raw loggedin.avatarurl}.
However you'll need to account for the fact as it stands you'll just get a long line of avatars; you need something in the template code to make them wrap after 4 avatars.
Also bear in mind this adds 1 query per avatar.