- Joined
- Nov 15, 2018
- Messages
- 33
- Points
- 43
Reputation:
ENXF submitted a new resource:
Get user_id of visitor - In XenForo 2, it's a matter of using visitor.
Read more about this resource...
Get user_id of visitor - In XenForo 2, it's a matter of using visitor.
In XenForo 1, getting the user_id involved the getInstance and getUserId methods.
In XenForo 2, it's a matter of using visitor().Code:$user_id =XenForo_Visitor::getInstance()->getUserId();
Once the user_id is known then the $user information is available.Code:$visitor = \XF::visitor(); $user_id = $visitor['user_id'];
Code:$finder = \XF::finder('XF:User'); $user = $finder->where('user_id', 1)->fetchOne(); \XF::dump($user);
Read more about this resource...