function uc_file_user_view in Ubercart 6.2
Same name and namespace in other branches
- 8.4 uc_file/uc_file.module \uc_file_user_view()
- 7.3 uc_file/uc_file.module \uc_file_user_view()
Implements hook_user_view().
1 call to uc_file_user_view()
- uc_file_user in uc_file/
uc_file.module - Implements hook_user().
File
- uc_file/
uc_file.module, line 372
Code
function uc_file_user_view(&$account) {
global $user;
// If user has files and permission to view them, put a link
// on the user's profile
$existing_download = db_result(db_query("SELECT fid FROM {uc_file_users} WHERE uid = %d", $account->uid));
if (!$existing_download || !user_access('view all downloads') && $user->uid != $account->uid) {
return;
}
$item = array(
'#type' => 'user_profile_category',
'#weight' => '-1',
'#title' => t('File downloads'),
'user_items' => array(
'#type' => 'user_profile_item',
'#value' => l(t('Click here to view your file downloads.'), 'user/' . $account->uid . '/purchased-files'),
),
);
$account->content['uc_file_download'] = $item;
}