function pcp_get_user_profile_values in Profile Complete Percent 5
Same name and namespace in other branches
- 6.2 pcp.module \pcp_get_user_profile_values()
- 6 pcp.module \pcp_get_user_profile_values()
- 7 pcp.module \pcp_get_user_profile_values()
Return a users profile field values that have been saved for a given user.
Parameters
int $uid - The uid of the user we are returning data for.:
Return value
assoc array of all profile fields for the user.
1 call to pcp_get_user_profile_values()
- pcp_get_complete_percentage_data in ./
pcp.module - Get the profile complete percentage data for a given user.
File
- ./
pcp.module, line 193 - Allows users with valid permissions to tag profile fields created from the profile module as required fields for a users profile to be considered complete.
Code
function pcp_get_user_profile_values($uid) {
$values = array();
if ($uid) {
$query = db_query("SELECT * FROM {profile_values} WHERE uid = %d", $uid);
while ($result = db_fetch_array($query)) {
$values[$result['fid']] = $result['value'];
}
}
return $values;
}