Here is a typo:
Original:
$fields['avatar']=qa_get_external_avatar_html($post['ouserid'], $options['avatarsize'], false);
Sholud be:
$fields['avatar']=qa_get_external_avatar_html($question['ouserid'], $options['avatarsize'], false);
$post is undefined in that function, it should be $question.