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

Need help with IF condition.


Active member
I have this:
<xen:if is="{$user.steam_auth_id} > 0">
I need it, to check on login of the user with this condition. How?
TL;DR How to make a conditional after someone logins, if the condition is true it logs him in as usual, otherwise it doesn't show him the forum but rather a popup or a page ( and he cannot view the forum, at all untill the conditional is set to true )

Chris D

XenForo developer
Staff member
Whenever you're talking about the currently logged in user, you would use $visitor rather than $user.

Also, if you're trying to check if the value exists or NOT 0 then it's sufficient to simply do this:

<xen:if is="{$visitor.steam_auth_id}">


Active member
I'm sorry I guess I wasn't clear nuff.
I want to execute an if condition AFTER the login, and unless the condition is true the user won't be able to view the forum list


Well-known member
I want it to redirect him to a page everytime he tries to go on the forum list.
Last time I ask for help please and thanks :D
Then you have 2 options:
Using a HTML redirect:
<meta http-equiv="Refresh" 
 content="1; URL=MY-URL">
Editing XenForo_ControllerPublic_Index (I think).

Jake Bunce

XenForo moderator
Staff member
Permissions via template conditions is not ideal. Ideally your steam addon would put users into a different usergroup so you can set permissions using groups.