Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 Next > End >>
Re:User selectable private/public profile
Date: 2006/06/08 00:50 By: mikko Status: User  
Karma: 106  
Platinum Joomlapolitan

Posts: 2230
graphgraph
Privacy policy plugin that I have been developing solves the issue with tab level access control. It is till alpha, though.

-mikko
Click here to see the profile of this user The topic has been locked.

Re:User selectable private/public profile
Date: 2006/06/08 04:29 By: ffaabbss Status: User  
Karma: 4  
Gold Joomlapolitan

Posts: 290
graphgraph
I need that reeeeeaaly really! As some users don't want to show their profile.. I want them all in the userlist though. I really like what nant did for his plugin to achieve access control. can't something like that be transferred to the entire profile somehow?

you'll get my karma vote once that privacy thingy is working. wanted to give now, but have spent my Karma elsewhere before reading up on this, sorry

what do you think when will it be second or third beta to give it a shot on a live site?

cheers
fabs
Click here to see the profile of this user The topic has been locked.

Re:User selectable private/public profile- SOLVED!
Date: 2006/08/22 19:14 By: planetkarl.com Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 19
graphgraph
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:

 function userProfile$option$uid$submitvalue) {     global $database$_REQUEST$ueConfig,$my;                      if (isset($_REQUEST['user'])) {         $database->setQuery"SELECT cb_publicprofile FROM #__comprofiler WHERE user_id=".$_REQUEST['user']);         $publicprofile $database->loadResult();         if ($publicprofile ==1){                  }         else{             if (!allowAccess$ueConfig['allow_profileviewbyGID'],'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); }



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
Click here to see the profile of this user The topic has been locked.

Re:User selectable private/public profile- SOLVED!
Date: 2006/08/22 19:22 By: planetkarl.com Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 19
graphgraph
I realize this is not exactly what everyone was going for, but it should be easy to modify this code to make the profile "hidden" completely.

I just wanted the ability to make some users visible to non registered users and others not.
Click here to see the profile of this user The topic has been locked.

Re:User selectable private/public profile- SOLVED!
Date: 2006/08/22 19:28 By: planetkarl.com Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 19
graphgraph
Hmm, thinking about it, modifying this to make the profile hidden, simply use this code:

Code:

   function userProfile$option$uid$submitvalue) {     global $database$_REQUEST$ueConfig,$my;                      if (isset($_REQUEST['user'])) {         $database->setQuery"SELECT cb_publicprofile FROM #__comprofiler WHERE user_id=".$_REQUEST['user']);         $publicprofile $database->loadResult();         if (!allowAccess$ueConfig['allow_profileviewbyGID'],'RECURSE'userGID($my->id)) || $publicprofile == 0) {                 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); }



Hmm, that is even simpler code!
I have not tested this, but it's just a little help to anyone who needs it.
Click here to see the profile of this user The topic has been locked.

Re:User selectable private/public profile- SOLVED!
Date: 2006/08/22 19:30 By: planetkarl.com Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 19
graphgraph
So basically:

Change this:

Code:

 if (!allowAccess$ueConfig['allow_profileviewbyGID'],'RECURSE'userGID($my->id)))



Into this:

Code:

 $database->setQuery"SELECT cb_publicprofile FROM #__comprofiler WHERE user_id=".$_REQUEST['user']);         $publicprofile $database->loadResult();         if (!allowAccess$ueConfig['allow_profileviewbyGID'],'RECURSE'userGID($my->id)) || $publicprofile == 0) {

Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 3 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC4)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC4, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers and now also to all registered joomlapolitans.

CB Login