if ($userdata['user_avatar'] != "" && file_exists(IMAGES."avatars/".$userdata['user_avatar'])) {
$size = @getimagesize(IMAGES."avatars/".$userdata['user_avatar']);
if ($size[1] > 80) {
$k = $size[0]/$size[1];
$height = 80;
$width = round(80*$k);
} else {
$height = $size[0];
$width = $size[1];
}
$avatar = "<div class='no_avatar'><img src='".IMAGES."avatars/".$userdata['user_avatar']."' width='$width' height='$height'></div>";
} else {
$avatar = "<div><img src='".BASEDIR."images/noav.gif'></div>";
}