Usage technique Get user_id of visitor

plouf

Banned
Joined
May 12, 2019
Messages
34
Reaction score
13
Points
8
1/3
Thread owner
Compatible XF Versions 2.x

In XenForo 1, getting the user_id involved the getInstance and getUserId methods.

Code:
Dear Guests, welcome! Please, Log in or Register to view hide content!


In XenForo 2, it's a matter of using visitor().


Code:
Dear Guests, welcome! Please, Log in or Register to view hide content!

Once the user_id is known then the $user information is available.

Code:
Dear Guests, welcome! Please, Log in or Register to view hide content!
 
Quick Jump
Back
Top