OK, yeah, the problem seems to be that $show['avatar'] is false if the user has no avatar, but it can also be false if the logged in user has chosen not to see avatars. So maybe this:
Code:
<vb:if condition="$bbuserinfo[userid] <= 0 OR $bbuserinfo[showavatars]">
<vb:if condition="$post[userid] == $bbuserinfo[userid] AND $post[avatarid] == 0 AND !$post[hascustomavatar]">
<vb:comment>Post belongs to logged in user and that user doesn't have an avatar</vb:comment>
<a class="postuseravatar" href="/profile.php?do=editavatar" title="Click here to choose your picture!">
<img src="/images/misc/unknown.gif" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="Click here to choose your picture!" />
</a>
<vb:else />
<vb:if condition="$show[avatar]">
<vb:comment>Existing avatar code</vb:comment>
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
</vb:if>
</vb:if>
<vb:if>