How do I get the userid from the url?

grantus

Active member
I know how to get the userid of the member visiting, but what I'd like to know is how can I get the userid of a profile page?

For example, my userid here is 13867, if I go to someone's profile page and their userid is 15000, how do I get 15000? I need the userid, username, etc of the profile page that's being viewed.

Thanks.

Edit: sorry, this should be in a Xenforo area.
 
No that's not what I meant. I'm doing a custom code for the profile page and I need to check what profile page is being viewed. This gives me MY information:

Code:
$object = XenForo_Visitor::getInstance();
$userid = $object['user_id'];

I need something like that, but for the profile page that is being viewed. I can fetch the URL with $_SERVER but I'd rather not.
 
I misunderstood as you didn't post it in the dev questions forum, which I have now moved it to.
 
There is a code example in the member controller:

Code:
		$userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
 
  • Like
Reactions: LPH
Top Bottom