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.
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.
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" />
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.
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.
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.
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>
<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.
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.