I’m logged in as admin, and go to view a user’s account page. How can I get the id of the user I’m viewing, rather than the $user->uid (which would be the admin user id)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The user’s ID is in the URL of the user edit form.
http://example.com/user/1/edit
If you have the devel module installed (and you should), there’ll also be a devel tab on the user’s profile page that’ll let you see other information about the user.
If you’re talking about the user’s profile template (i.e. you’re overriding
user-profile.tpl.php), the user you’re viewing is in the$accountvariable.