• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

xen username

#1
Hey there, i am wondering how i can display the currently logged in username. Also i would like to confirm that <xen:if is="{$visitor.user_id}"> is the id of the user right.
 
#4
Hello Folks,

I am testing on my devlopment site and i get an error
An exception occurred: Use of undefined constant username - assumed 'username' in /home/vps/chickentalk/dev/index.php on line 39
  1. XenForo_Application::handlePhpError() in /home/vps/chickentalk/dev/index.php at line 39
This is the code on line 38-44
PHP:
<xen:if is="$visitor.user_id">
            <p> Welcome <?php $visitor.username; ?> what would you like to do today?</p>
 
        <xen:else />
            <p> Hello Looks like you are not logged in! You Should log in!</p>
            <?php login(); ?>
        </xen:if>
I have tried it with the curly brackets around to, that just gives me an error. Unless i do not need the php tags, but that seems highly unlikely.