Restricting editing of custom profile fields
Posted: 15 July 2004 07:04 AM   [ Ignore ]  
Summer Student
Total Posts:  16
Joined  06-16-2004

Hi,

I searched around the forum but didn’t find any results as to how I can restrict editing of custom profile fileds I have added. What I would like to do is be able to assign members specific information that I can change, but they cannot not. The members should still be able to see this information, it’s just not editable by them.

If anyone knows any ways of doing this, please let me know. Thanks in advance.

Profile
 
 
Posted: 20 July 2004 06:07 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

If you go to Admin > Custom Profile Fields and create/edit a field then there are two settings in there:

“Is this field visible in public profiles?”
“Is field visible in registration page?”

I believe if you set the first to YES and the second to NO then you’ll have what you want.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 21 July 2004 06:36 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  16
Joined  06-16-2004

Ok, I tried that but it’s not exactly what I’m trying to get. That makes it not viewable on the registration page but unfortuneatly it can still be edited by the users if they go to Member list > My account > Edit your profile.

I need a way to make it so they can never edit it but they can see it when they just do the member list lookup, i.e. they can see the data under the member list .

Profile
 
 
Posted: 21 July 2004 01:29 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

That would require you to hack the backend code that controls the “edit your profile” page.  You’d probably want to check the previous “Is field visible in registration page?” preference and then determine whether the field can be edited based on the value.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 22 July 2004 08:42 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  16
Joined  06-16-2004

Ok, I did just that.

I looked through the file modules/member/mod.member.php and found the editing of the profile page. On line 441, the SQL call can easily be changed to:

if ($SESS->userdata['group_id'] != 1)
        
{
            $sql
.= " WHERE m_field_public = 'y' AND m_field_reg = 'y' ";
        
}

so that it requires that the “Show on registration page” be YES. This seems to working but I’ll keep testing it further.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64944 Total Logged-in Users: 66
Total Topics: 81925 Total Anonymous Users: 48
Total Replies: 440358 Total Guests: 293
Total Posts: 522283    
Members ( View Memberlist )