Greetings!

I am trying to perform some calculation based on current user's latitude and longitude.
I see from print_r that $user object does not initially include this information.
How do I then access user's location?

Either of these two solutions might do:
1) Automatically add lat/lon to $user object when user's lat/lon is set
2) Access user's lat/lon 'on demand'

I am creating a site where setting your home location is crucial for the functionality of the site. So, there should be a block that screams to you if your location is unset.

Thanks

Comments

farald’s picture

Status: Active » Fixed

Found some sort of solution:

<?php
global $user;
$viewinguser = user_load(array('uid' => $user->uid));
print_r($viewinguser);
?>

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.