Mono Support How to group discussion boards & Profile privacy 

Viewed 13219 time(s), 2 post(s), 11/16/2012 9:50:10 AM - by Codeplumber
11/16/2012 9:50:10 AM
48 Reputation 3 Total posts

Hello,

I have once more two short questions.

1. How can I set the fields firstname and surename during the registration automatically on non-public? I want to show only the username in top of the profile by default.

2 Is there a way to group the discussion boards? For example: General Forums, Computers & Internet, Business & Finance etc.

Regards
Alex

1
11/21/2012 10:08:02 AM
3016 Reputation 428 Total posts

Hi,

In order to change the privacy you need to attach to the membership editors events and set the privacy level entry. Take a look at the code sample below:

attach to the membership editor event, you can do it on a membership editor landing page, in code behind:

protected override void OnInit(EventArgs e)
       {           
      
           ctlMembershipEditor.AccountCreated += new ModuleGallery.MembershipModuleEvent(ctlMembershipEditor_AccountCreated);
     
           base.OnInit(e);
       }
 
       void ctlMembershipEditor_AccountCreated(object sender, ModuleGallery.MembershipModuleEventArgs e)
       {
            
           Guid userid = (Guid)e.MembershipUser.ProviderUserKey;
           UserProfileRepository rep = UserProfileRepository.GetInstance();
           rep.UpdatePrivacyLevelDefinitions(userid, typeof(UserProfileEntity).ToString(), UserProfileFields.FirstName.Name, PrivacyLevelEntity.PrivacyLevelPrivate.Id);
           rep.UpdatePrivacyLevelDefinitions(userid, typeof(UserProfileEntity).ToString(), UserProfileFields.LastName.Name, PrivacyLevelEntity.PrivacyLevelPrivate.Id);
 
 
       }
Regarding the discussion boards, you can create boards for each category you want, and then topics in each category.

Please open a new topic if you need more information regarding the discussion boards.

Regards.

2
This is a demo site for MonoX. Please visit Mono Software for more info.