function activity_account in Activity 5
Same name and namespace in other branches
- 5.2 activity.module \activity_account()
-- activity account -- find what user we're getting buddy activity for
Parameters
uid:
Return value
a user object
1 call to activity_account()
- activity_buddy_activity in ./
activity.module - function to get all buddy activity @returns array of activity
File
- ./
activity.module, line 243 - Activity module: Allow users to see their friends' activity on the site.
Code
function activity_account($account_to_load) {
// if we're on a user profile page, make sure we load that user
$q = explode('/', $_GET['q']);
if (is_numeric($q[1])) {
$account = user_load(array(
'uid' => $q[1],
));
}
$account = $account->uid ? $account->uid : $account_to_load;
if (!$account) {
// there was no # passed from 'q' or $account_to_load
global $user;
$account = $user;
}
return $account;
}