Community Server on my mind

J-O Eriksson's blog


  • Running on CS 2.1 SP 2

    See top menu for subscription options

    Technology Blogs - Blog Top Sites

    BlogRankers.com

    Add to Technorati Favorites



The NewUserDefault CSModule of the Alabaster package

A few weeks ago, the Community Server MVP's released a package of CSModule's, which we called Alabaster. It contained a couple of CSModule's developed by a couple of us MVP's. My contribution to Alabaster was a module called NewUserDefaults, which I like to talk a little bit more about in today's post.

The thing that got me thinking about developing this CSModule, was that CS lacked the possibility to enable notification for newly registered users. When a new user registered, this setting defaults to off. People not used with CS, together with those not that tech savvy, could in my opinion have a hard time finding that setting. Also I believe in many other forums systems this is usually set to on, so they might be used by that.

So why should that be a problem? Well, IMO, in a scenario where a new users registers on your site just to ask a question, he or she may never know if there ever was an answer, they may forget that they ever visited your site, and you loose a potential new active user to your community.

There were also a couple of other settings I found was not configurable by an admin to what their defaults should be, which I thought I add to the module.

To install the module, together with all the others in the package (they are all in one single DLL), just copy the DLL to your BIN folder. To activate the NewUserDefault module you need to add a couple of lines to your communityserver.config file. The lines you add should go into the <CSModules> section, which you'll find near the end of the communityserver.config.

The following is an example on what you could put there:

<add name = "NewUserDefaults" 
type = "CSMVPs.CSModule's.JOEriksson.UserDefaults, CSMVPs.CSModules" > <EnableNotifications Value="True" /> <EnableAvatar Value="True" /> <EnableCollapsingPanels Value="True" /> <EnableInk Value="True" /> <EnableDisplayInMemberList Value="True" /> <EnableDisplayName Value="True" /> <EnableHtmlEmail Value="True" /> <EnableOnlineStatus Value="True" /> <EnablePrivateMessages Value="True" /> <EnableUserSignatures Value="True" /> </add>

Now you might not need each of the lines above. The settings you don't want to change from their defaults behavior can be omitted. So if you just wanted to set the notifications to ON, it would look like this:

<add name = "NewUserDefaults" 
type = "CSMVPs.CSModules.JOEriksson.UserDefaults, CSMVPs.CSModules" > <EnableNotifications Value="True" /> </add>

The code will just look for those rows that are present between the 'add' tags, and ignore any action on those settings that have no rows in the communityserver.config.

After you modify the communityserver.config you need to 'touch' (open and save it) the web.config file so all settings goes through.

That's all you have to do. The next time a user registers, the default settings you've set here should take effect.

The module triggers whenever a user is updated. It then checks if it is a new user that is created.

Private Sub csa_PostUserUpdate(ByVal user As User, ByVal e As CSEventArgs)

If e.State <> ObjectState.Create Then
	Return
End If

SetUserDefaults(user)

End Sub

If it is, it goes through what you have set in your communityserver.config, and sets those settings on the current user object.

Private Sub SetUserDefaults(ByVal user As User)
            If Me._EnableNotifications <> "" Then
                user.EnableThreadTracking = (Me._EnableNotifications)
            End If
.
.
.
End Sub

I've omitted the rest of the IF statements in the code sample above to make it easier to read here in the post. And I know, I should probably not have been using a series of IF statements, but some SELECT CASE block instead, but couldn't figure out how, since even if one of the settings is there, I need it to check the others as well.

Well, there it is, download and use it if you have the needs to set any of these settings for new users.

If you enjoyed this post Subscribe to my feed via RSS or e-mail!
Posted: Monday, August 28, 2006 7:03 PM by J-O Eriksson

Comments

Jaxon Rice said:

This must have somehow slipped below my radar before, but nice module!

# August 28, 2006 1:06 PM

J-O Eriksson said:

Thanks Jaxon, Yeah, I believe we might have done a better job explaining what the Alabaster pack really was. Maybe we took for granted that everyone downloaded it and looked through the code. ;-)
# August 28, 2006 1:13 PM

Community Server Daily News said:

news of the day a grab bag for what's happening in Community Server Gary McPherson writes a consumer-controlled

# November 15, 2006 2:49 PM

Tim Laughlin's Everything VB.NET Blog said:

J-O Eriksson released the NewUserDefault CSModule as part of the Community Server MVP Alabaster CSModule

# December 3, 2006 6:50 PM

Tim Laughlin's Everything VB.NET Blog said:

I was looking for a way to set the default editor for NOAH users. I have added spell checking to the

# December 4, 2006 11:59 AM

Dave Burke said:

A Community Server Admin from Germany was asking today about setting new user default date formats. He

# February 23, 2007 8:44 PM

Community Server Bits said:

A reminder of one of the Alabaster jewels, as Rick directs wellsss to Alabaster for J-O Eriksson's NewUserDefault

# March 12, 2007 5:13 AM

Razzamataz said:

I installed this CSmodule in a CS2.1 SP2 installation running under ASP.NET 2.0 and it does not work.

Creating a new user results in the default settings, regardless from what is configured in the <CSModules> section in ConmmunityServer.config.

Is there an update available?

Razza

# March 16, 2007 5:40 AM

J-O Eriksson said:

Razzamataz,

Chances are that something is wrong with the installation of the CSModule. If it is, CS will not alway show you an error. You'll have to look in the event viewer to see if there is any error right after the application has started up.

If there is an error at start time, the CSModule will not load, and will not do any work for new users.

Have you checked the evenlog after a app restart?

# March 16, 2007 8:37 AM

Razzamataz said:

I checked the Event Log like you suggested, and indeed,

I noticed several errors with EventID 656.

The message reported was "A CSModule (NewUserDefaults) could not be loaded. The type CSMVPs.CSModule's.JOEriksson.UserDefaults, CSMVPs.CSModules does not exist".

The error was caused by the quote in the type definition above; I copied the CSModule entry from this weblog above:

   <add name = "NewUserDefaults"

   type = "CSMVPs.CSModule's.JOEriksson.UserDefaults, CSMVPs.CSModules" >

while the CSModule entry in the communityserver.merge.config showed:

   <add name="NewUserDefaults" type="CSMVPs.CSModules.JOEriksson.UserDefaults, CSMVPs.CSModules">

You might want to correct that. Anyways, user defaults are set quite nicely now; I couldn't be happier.

Thank you very much for your early reply, and for your great NewUserDefault module!

Razza

# March 16, 2007 1:15 PM

J-O Eriksson said:

Thanks Razza,

I've removed the quote from the definition. Must have been added by the spellchecker. Smile

Good, that you got it to work!!

# March 17, 2007 2:39 AM

Don LOper said:

J-O,

Is their anyway to get the Alabaster Files?  I've been googling like crazzy without luck.

I've seen several questions on the Community Server site but it seems no-one wants to reply with the new version being out...

# December 6, 2008 9:51 PM

J-O Eriksson said:

Don,

I don't believe I still have those files. They were available on our old CS MVP site, but that site is gone now.

But the source code management we used was CodePlex (http://www.codeplex.com/CSModulesRepository), so which ever Change Set you'd want should be avaliable there. Problem is I don't remember which one would be the Alabaster.

Why are you looking for an old version of this package?

# December 7, 2008 2:53 AM
New Comments to this post are disabled