How to get the current viewed users uid If I am viewing a users profile page, how do I obtain and display (in a block) their uid? NOTHING to do with the current logged in user. I need to display the users id in a block on their page.
If you are showing a standard drupal user profile page this should get you going:

  $user = user_load(arg(1));
  $user-&gt;uid; // access user id


This assumes the path is user/uid. If your path looks different adjust the arg(position_in_path) to your needs.