this is the correct cod
function useravatar()
{
$handle= qa_get_logged_in_handle();
$user=qa_db_select_with_pending(
qa_db_user_account_selectspec($handle, false)
);
$this->output('<li class="qa-sidebar-user-li-avatar">'.qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true).'</li>');
}
and this code put when you want to display the avatar
$this->useravatar();
sory for my english