Condition - If user is not connected

  • Thread starter Thread starter Deleted member 10469
  • Start date Start date
D

Deleted member 10469

Guest
Hello, I would like to know how to check if a user is logged or not please :)

Code:
<xen:if is="{$visitor.???????????}">
    // Here is my code for visitors
</xen:if>

Thank :)
 
Hello, I would like to know how to check if a user is logged or not please :)

Code:
<xen:if is="{$visitor.???????????}">
    // Here is my code for visitors
</xen:if>

Thank :)

If users are logged in they will have a user_id so...

<xen:if is="{$visitor.user_id}">
// Code for registered users
</xen:if>

You could also do:

<xen:if is="{$visitor.user_id}">
// Code for registered users
<xen:else />
// Code for guests
</xen:if>

Or you could even do:

<xen:if is="!{$visitor.user_id}">
// Code for guests
</xen:if>
 
I have :

Code:
<xen:if is="!{$visitor.user_id}">
    #loginBar .pageContent
    {
        padding-top: 0px !important;
    }
    #moderatorBar
    {
        border-bottom: none !important;
    }
</xen:if>

Border bottom is not displayed (for user registered) :S

19qHW.jpg


<xen:if is="{$visitor.user_id}">
// This code loads the css for everyone :/
</xen:if>
 
Hmm few things:
<!- this is a comment --> with the !


Also that's putting it as a regular text, easy way could be this:

Rename that template to: XenCrea_CustomGuest (remove the .css)

Then inside the XenCrea_CustomGuest wrap all the css in this:

Code:
<style type="text/css">
 
 
</style>

And in your conditional remove the .css too
 
Back
Top Bottom