1

Topic: Use avatar extern

Hi folks!

I'm working on a website with punBB intergrated. People can post comments in the news section of the website (non-punbb) under there own name and because I send the userid from punbb with it, I can show profile information from the one that has placed a comment. Well, I'd like to show the avatar of that one, but I can't get it working.

Does anyone have any idea how it could be done? Please help me.

Thanks in advance,

Tim

Re: Use avatar extern

if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';

Change variables ofcourse.

3

Re: Use avatar extern

Thank you! I got it working now. smile

The exactly script I'm using is:

            $avatardir = "http://www.wiistation.nl/forum/img/avatars";
            if ($img_size = @getimagesize($avatardir.'/'.$list2->userid.'.gif'))
                $user_avatar = '<img src="'.$avatardir.'/'.$list2->userid.'.gif" alt="" />';
            else if ($img_size = @getimagesize($avatardir.'/'.$list2->userid.'.jpg'))
                $user_avatar = '<img src="'.$avatardir.'/'.$list2->userid.'.jpg" alt="" />';
            else if ($img_size = @getimagesize($avatardir.'/'.$list2->userid.'.png'))
                $user_avatar = '<img src="'.$avatardir.'/'.$list2->userid.'.png" alt="" />';

Re: Use avatar extern

<3 search.

Exactly what I was looking for. After seeing it, my brain started to function again. Thanks.