OK, I needed this, so I implemented it.
Step 1: add a field to the user profile cb_publicprofile (checkbox)
Step 2: Find the userProfile function in comprofiler.php and change the code to match this:
[code:1]function userProfile( $option, $uid, $submitvalue) {
global $database, $_REQUEST, $ueConfig,$my;
if (isset($_REQUEST)) {
$database->setQuery( "SELECT cb_publicprofile FROM #__comprofiler WHERE user_id=".$_REQUEST);
$publicprofile = $database->loadResult();
if ($publicprofile ==1){
}
else{
if (!allowAccess( $ueConfig,'RECURSE', userGID($my->id))) {
echo _UE_NOT_AUTHORIZED;
return;
}
}
} else {
if ($uid==0) {
echo _UE_REGISTERFORPROFILE;
return;
}
}
$users=array();
if (setUserDBrequest($uid)) {
$users = $database->loadObjectList();
}
if (count($users)==0) {
echo _UE_NOSUCHPROFILE;
return;
}
$user = $users[0];
HTML_comprofiler::userProfile( $user, $option, $submitvalue);
}[/code:1]
The code is a bit rough, but it works 100% for me and it was quick.
Works like a dream and took me just 15 mins. I have the cb_publicprofile checkbox not visible on the profile and not user editable, so I can select who is public and private. You can set it any way you like though, it all works.
Enjoy!
Post edited by: planetkarl.com, at: 2006/08/22 19:32