@xf_phantom I tired your suggestion and it didn't work.What is $user? Where is the variable coming from?
If you mean the current user (aka $visitor ) you can already access it via
{$visitor.customFields.X}
http://xenforo.com/help/custom-user-fields/
{xen:helper userFieldValue, 'nick_name', $visitor, {$visitor.customFields.nick_name}}
<xen:if is="{$visitor.user_id}">
<xen:username user="$thread" title="{xen:phrase thread_starter}" /><span class="startDate">,
<xen:else />
<a href="/login/login" class="username" itemprop="name">{xen:helper userFieldValue, 'nick_name', $visitor, {$visitor.customFields.nick_name}}</a>
</xen:if>
<xen:if is="{$visitor.user_id}">
<xen:username user="$thread" title="{xen:phrase thread_starter}" /><span class="startDate">,
<xen:else />
<a href="/login/login" class="username" itemprop="name">{xen:helper userFieldValue, 'nick_name', $visitor, {$visitor.customFields.nick_name}}</a>
</xen:if>
@xf_phantom You had me use $visitor.customFields when I was using $user.customFieldsit won't work because gusts don't have custom fields
@xf_phantomI don't understand, what you want to accomplish
You want to show the value of a userfield to guests?! (at least that's what your code from post 6 is trying to do)
But guests don't have userfields?!
<xen:if is="{$visitor.user_id}">
<xen:username user="$thread" title="{xen:phrase thread_starter}" /><span class="startDate">,
<xen:else />
<a href="/login/login" class="username" itemprop="name">{xen:helper userFieldValue, 'nick_name', $user, {$user.customFields.nick_name}}</a>
</xen:if>
@xf_phantomthis http://xenforo.com/community/threads/hide-username.63831/#post-675024 ?
then it should probably be
Code:<xen:if is="{$visitor.user_id}"> <xen:username user="$thread" title="{xen:phrase thread_starter}" /><span class="startDate">, <xen:else /> <a href="/login/login" class="username" itemprop="name">{xen:helper userFieldValue, 'nick_name', $user, {$user.customFields.nick_name}}</a> </xen:if>
We use essential cookies to make this site work, and optional cookies to enhance your experience.