Show user image/avatar in custom block?

1 user found helpful
I would like to show the image/avatar attached to user x.

I have a custom block showing a list of members and their attributes.

Checking for images/avatar with $ui->hasAvatar() return true. But how do I get the image.

I think outputUserAvatar() is the trick, but how do I use this function?

Kind regards, Jens Griebel
griebel
View Replies:
griebel replied on at Reply
griebel
$ui = UserInfo::getByID($userid);
$ih = Loader::helper('image'); 
$av = Loader::helper('concrete/avatar'); 
if ($ui->hasAvatar()) {
    $avatarImgPath = $av->getImagePath( $ui, false );
    $mw = ($maxWidth) ? $maxWidth : '60';
    $mh = ($maxHeight) ? $maxHeight : '80';  
    if( substr($avatarImgPath,0,strlen(DIR_REL))==DIR_REL ) $avatarImgPath=substr($avatarImgPath,strlen(DIR_REL));
    $thumb = $ih->getThumbnail( DIR_BASE.$avatarImgPath, $mw, $mh); 
   if($thumb->src){ 
            ob_start();
       $ih->outputThumbnail(DIR_BASE.$avatarImgPath, $mw, $mh); 
       $avatarHTML=ob_get_contents();
            ob_end_clean();
   }else{
Fernandos replied on at Reply
Fernandos
thx^