AlexCrome.CS 1.3

Community Server

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

AlexCrome.CS 1.3

  • Comments 8

For a CS2008(.5) version, go to http://askcrome.co.uk/alexcrome-cs/alexcrome-cs-2008

UPDATE: Fixed a few bugs in RegistrationPM and QuickReply, download the updated version from [View:/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.01.90/AlexCrome.CS_2D00_1.3.1.zip]

Today I'm updating my package to include one additional CSModule, and one additional Control.  This package now contains the following addons, with new additions highlighted in Green:

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.

NotifyAdministratorOnUserCreate - Sends an email out to the specified email addresses whenever a new user is created.  Particularly useful when you're moderating newly created users.

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

Quick Reply - Based on the CreateEditPostForm, it allows you to place a reply to post form at the bottom of a post list, and have all posts be in reply to the original.

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://alexcrome.co.uk/media/p/190.aspx, which also includes the source code for the package.

 

Breaking Changes

There is one small breaking change in the RegistrationPM module.  The Body and Subject Resources have been moved into a separate resource file - AlexCrome.CS.Resources, and so you'll have to move your resources into that.  As the resources are now in their own file, the resource names are hardcoded to "RegistrationPM_Subject" and "RegistrationPM_Body"

Bug Fixes

The MarkAllPostsRead control will now refresh the page when it's complete, instead of doing a postback, ensuring that the icons for posts and sections are updated correctly.

RegistrationPM will now sends once a user has been approved if your site requires users to be approved by an administrator.

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

You will also need to merge the provided communityserver_override.config file with your existing one (if you don't have one, just copy the provided file into your web directory), and copy the AlexCrome.CS.Resources.xml file to the Languages files of each language your site uses (~/Languages/LANGUAGE KEY/) (translating the file as appropriate).

 

RegistrationPMclip_image002_thumb1[4]

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

For each language your site uses, copy the AlexCrome.CS.Resources.xml file into the appropriate language folder (Languages/<language>/resources.xml), and modify the existing resources as appropriate.  N.B. to include the user's username, use [username].  It is advised that you do so to prevent an issue whereby the module will fail if two users register within 15 minutes of each other (see Known Issues for more details).

Finally, open the communityserver_override.config file and change the SenderUsername to the username of the user who should appear to have sent the RegistrationPM.

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.

MarkAllPostsReadclip_image004_thumb1

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/YOUR THEME/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 runat="server" UrlName="post_NotRead" Parameter1="-1"
ResourceName="Utility_ForumAnchorType_PostsNotRead" Tag="Li" />
<CSControl:SiteUrl runat="server" UrlName="forumSubscriptions"
ResourceName="Utility_ForumAnchorType_ForumSubscriptions" Tag="Li" />
<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.

QuickReplyimage

The QuickReply control is based on the CreateEditPost Control, and can be placed anywhere in the context of a Thread.

A common place to place this control would be at the bottom of the flat thread view.  To add the control here, you'll have to open up ~/Themes/YOUR THEME/Forums/thread-flatview.ascx, and add your code toward the end of the file, just before the Ad Template.

The Control is based on the CreateEditPost control, so you should be able to copy the code from either ~/Themes/YOUR THEME/Forums/createeditpost.aspx or ~/Themes/YOUR THEME/Forums/quickreply.aspx

Please note, it is important that you include a GoToCurrentPostAction in the UnmodreatedSuccessActions to ensure that the new post is displayed when the user submits their post.

UserHasUnreadPrivateMessageConditionclip_image006_thumb1

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.

 

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
  • FYI. Link isn't working: AlexCrome.CS-1.3-1.zip

  • Thanks for catching that - I've updated the link and it should now be working.

  • Thank you, this is really cool CS Module :)

    also your blog design too..

  • Wondered if this works with CS 2008?

  • Hi Alex,

    Do you have any plans on releasing this for CS 2008.5 (SP1)??

    Erik

  • Registration PM, MarkAllPostsRead, UserHasUnreadPrivateMessageCondition - Included out of the box in CS2008.5

    MarkThreadsReadOnUserCreate, NotifyAdministratorOnUserCreate and QuickReply + a few more are included in AlexCrome.CS 2008 - http://askcrome.co.uk/alexcrome-cs/alexcrome-cs-2008/.

    There are currently about 10 extensions in AlexCrome.cS, but I'll soon be packaging up an updated version which contains over 20 addons. If you want to hear more about the next version / try out a pre documentation version contact me on the about page ( http://askcrome.co.uk/about/ )and I'll send you more details.

  • Alex,

    Because we based our theme on "leanandgreen" we cannot move to CS2008.5 instead we are on CS2008.1 with Service Pack 3. However there are two features we really need which are MarkAllPostsRead and UserHasUnreadProvateMessageCondition.

    Is it possible to use the code in cs2008.5 in CS2008 for these two functions and if the answer is yes can you please indicate what code is needed.

    Thanks in advance for your help in this matter..

  • Keith,

    Unfortuanntly theres no way to determine whether conversations have been read in CS2008. It is however possible in CS2008.5. As for mark all threads read, I'm not sure about that. I removed that control in my CS2008.5 package because there's an out of the box control in CS2008.5 that does that for you. I don't know if that control exists in CS2008 though.

    I do have a copy of leanandgreen which does work on CS2008.5 SP1. It doesn't include support for the major new features in CS2008.5 (Wikis and Forum Q&A) but it does include support for showing unread Conversations and selectable avatars. (as well as allowing you to upgrade to CS2008.5 SP1 for bug fixes). If you like I can email you a copy of that (make sure to include your email address when you reply to this comment).

Page 1 of 1 (8 items)
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