Back to top

Add new comment

If you are using Content profile

Comment: 

If you are using Content profile, you can use content_profile_load() function, here is my code:

// Get the uid of the user being viewed.
$userdid = arg(1);
// Pass the uid to the content_profile_load() function for that user's profile
$content_profile = content_profile_load('uprofile', $userdid);
$public = $content_profile->field_uprofile_public[0]['value'];
//hide the profile if 'No'
if ( $public == 'No') {
return TRUE;
};