AlexCrome.CS 1.2

Community Server

Group for Content about my AlexCrome.CS addon package for Community Server 2008

AlexCrome.CS 1.2

  • Comments 2

This package has been built for and tested on CS 2007.1. Whilst they have been tested I accept no responsibility for anything that may occur as a result of installing any part of this package. This package contains the following addons:

Registration PM - Sends a private message to each user when they are created

MarkThreadsReadOnUserCreate - Marks all posts created before a new user registered as being read so the user’s ‘Unread posts’ page is not clogged up with posts created before he or she joined.

MarkAllPostsRead - Similar to MarkThreadsReadOnUserCreate however, the control works on demand.

UserHasUnreadPrivateMessageCondition - Allows you to display content based on whether or not a user has any unread Private Messages. The most obvious use of this is to give users a message when they have new private messages.

You can may download this package from http://askcrome.co.uk/alexcrome.cs.zip, which includes a copy of these instructions, and the source code for the package.

 

Installation

Before you can this package, you must copy communityserver_override.config to the root of your website and copy AlexCrome.CS.dll to your website’s bin folder. You also need to open up your web.config file and find the <controls> section. After the last <add ... /> item, add

<add tagPrefix="ACControl" namespace="AlexCrome.CS.Controls" assembly="AlexCrome.CS" />

 

RegistrationPM

clip_image002

The RegistrationPM CSModule sends a private message to each user when they are created.

For each language your site uses, open up the appropriate resource file in a text editor (Languages/<language>/resources.xml), and add two resources – one containing the subject, and another containing the body. In the Body resource, [username] will be replaced by the new user’s username. For Example:

<resource name="RegistrationPM_Subject">Welcome</resource> 
<resource name="RegistrationPM_Body">
  <![CDATA[<P >Welcome [username]</P>
    <P >Here you can add more text telling users about certain features of yoursite, to give them a friendly welcome or anything else you can think of.</P>
  ]]>
</resource>

Finally, open the communityserver_override.config file and change the SenderUsername, SubjectResource & BodyResource attributes for the RegistrationPM as appropriate.

 

MarkThreadsReadOnUserCreate

The MarkThreadsReadOnUserCreate module will mark all posts created before a new user registered as being read so the user’s ‘Unread posts’ page is not clogged up with posts created before he or she joined.

No further setup is required to install this module.

 

MarkAllPostsRead

clip_image004

The MarkAllPostsRead control is similar to the MarkThreadsReadOnUserCreate CSModule however, the control works on demand.

A common place to place this control is in the Forum Shortcuts. To do so, you need to open up Themes/default/Forums/forum.master in a text editor. Next, find the line similar to

<ContentTemplate>
<CSControl:SiteUrl UrlName="post_NotRead" Parameter1="-1" ResourceName="Utility_ForumAnchorType_PostsNotRead" Tag="Li" runat="server" />
<CSControl:SiteUrl UrlName="forumSubscriptions" ResourceName="Utility_ForumAnchorType_ForumSubscriptions" Tag="Li" runat="server" />
</ContentTemplate>

Replace that with

<ContentTemplate>
<CSControl:SiteUrl UrlName="post_NotRead" Parameter1="-1" ResourceName="Utility_ForumAnchorType_PostsNotRead" Tag="Li" runat="server" />
<CSControl:SiteUrl UrlName="forumSubscriptions" ResourceName="Utility_ForumAnchorType_ForumSubscriptions" Tag="Li" runat="server" />
<li><ACControl:MarkAllPostsReadControl runat="server" Text="Mark all posts as read" /></li>
</ContentTemplate>

Save the file and upload it to your website. Goto your forums and the shortcuts box should look similar to the one above.

 

UserHasUnreadPrivateMessageCondition

clip_image006

The UserHasUnreadPrivateMessageCondition allows you to display content based on whether or not a user has any unread Private Messages. The most obvious use of this is to give users a message when they have new private messages.

To do this, open up Themes/default/Common/UserWelcome.ascx in a text editor and find the following line:

<CSControl:UserData runat="server" LinkTo="UserPrivateMessages" ResourceName="PrivateMessage_Unread">
<LeaderTemplate>| </LeaderTemplate></CSControl:UserData>

Replace that with

<CSControl:ConditionalContent runat="server">
<ContentConditions><ACControl:UserHasUnreadPrivateMessageCondition runat="server"
UseAccessingUser="true" /></ContentConditions>
<TrueContentTemplate><br /><CSControl:UserData runat="server" LinkTo="UserPrivateMessages"
Text="You have Unread PMs" /></TrueContentTemplate>
<FalseContentTemplate>| <CSControl:UserData runat="server" LinkTo="UserPrivateMessages"
ResourceName="PrivateMessage_Unread" /></FalseContentTemplate>
</CSControl:ConditionalContent>

And save. Upload the file to your website and when a user has any unread PMs, the top right corner should look similar to the one above. When the user has no unread PMs, it should look how it normally does.

 

 

Known Issues

Private Message may fail to send if two users register within 15 minutes of each other.
If duplicate posting is disabled on your forum, Community Server may detect the registration as a duplicate post. A workaround for this is to include [username] somewhere in the resource body which will be converted into the user’s username when the private message is sent.
The RegistrationPM module sends a copy of the PM to the sender
There is currently no known workaround for this issue. You may however delete your copy of the private message without deleting the new user’s version.
Posts & Forums will not be marked as read until after another refresh
Refresh the page or move onto another page on the site and posts will have been marked unread as expected.
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Post
  • Hey Alex

    Great Controls, I love them :) Are you planning to update them to CS Server 2008 when they release?

    Severin

  • No promises, but I certainly hope to do so.

Page 1 of 1 (2 items)