开发者

Get the user id of the user you are viewing (as admin)

开发者 https://www.devze.com 2023-01-21 18:11 出处:网络
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, rathe开发者_如何学运维r than the $user->uid (which would be the admin user id)?The user\'s

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, rathe开发者_如何学运维r than the $user->uid (which would be the admin user id)?


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 $account variable.


Use the Devel module and you will get every kind of information you wanted.


do a print_r($node) in the correct file or use devel like Vivek suggested

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号