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

How can I check if I am at a member profile.

Vincent

Well-known member
#1
I'm almost done with my add-on, but I need one more thing,

I need to know how to check if the visitor is on a profile of a user.

How do I do this? :S
 

Dr.Yontem

Formerly Tilkißey
#2
use this if condition in your template
HTML:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Member' ">your codes</xen:if>
another way

if you use this way, you can fetch all users which are viewing a member's profile
in database
xf_session_activity table
controller_name = XenForo_ControllerPublic_Member
controller_action = Member
params = user_id=X

controller action is defined for actions, so, u can also check controller_name is equal or not to XenForo_ControllerPublic_Member
 

Kier

XenForo Developer
Staff member
#5
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Member' AND {$controllerAction} == 'Member'">... your stuff here... </xen:if>