Find:
Code:
<xen:username user="$user" itemprop="name" rich="true" />
Surround it with a conditional:
Code:
<xen:if is="$visitor.user_id">
<xen:username user="$user" itemprop="name" rich="true" />
</xen:if>
However, since you want to display something else, you'll want to add an else statement:
Code:
<xen:if is="$visitor.user_id">
<xen:username user="$user" itemprop="name" rich="true" />
<xen:else />
<a href="#" class="username" itemprop="name">$user.customFields.x</a>
</xen:if>
Change x to the field ID. The above example is for message_user_info. You'll need to find all occurrences and update accordingly.