AlexCrome.CS 2008.5

Community Server

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

AlexCrome.CS 2008.5

  • Comments 8

I've finaly got around to finishing and packing up the 2008.5 version of my addons.

For those of you who can't wait to read the rest of this blog post, you can download the addons from the media gallery and read documentation on them from the wiki.

New in this version

Extended Attributes Sub Form

This is the addon I'm most excited about.  A very powerful feature of Chameleon Forms in Community Server is the ability to plug in "SubForms" which can collect additional data and store it with the object when it saved.  Whilst this is a powerful feature, for simple situations where you only want to collect extra data without performing validation or much extra work the SubForms method is overly complictaed with a lot of formality required to do a simple action.

The Extended Attributes SubForm is a SubForm which allows the controls within it to be defined through an XML file in much the same way you can define DynamicConfiguration optiosn for a theme in the theme.config file (In fact the subform control uses the same DynamicConfiguration bits as Theme Configurationd does).  Whilst I accept the XML file itself is not as elegant as writing a custom SubForm, for simple data collection it is easier, and more accessible.

You can see an example of the SubForm in action at http://alexcrome.co.uk/demo/ExtendedAttributesSample.aspx .

 

Table of Contents

The table of contents addon can be used to generate a Table of Cotnents for an individual post.  The table of contents is generated based on the use of heading tags (h1, h2, h3 etc.)  A table of contents is placed by adding [toc] into a post where you want the table of contents to appear.  The following is the table of contents generated for this post.

 

Other smaller additions

  • New User Random Avatar - Sick of having lots of users with the anonymous avatar?  This module will assign new members a random avatar from the Selectable Avatars store when they join.
  • Default Mirrored Blog Post Author - Sick of having mirrrored blog posts having the anonymous user avatar.  This module will cause the posts to be created by the first owner of the blog the post is being mirrored to instead of the anonymous user.
  • SubscribeToHubOnJoin - Subscribes a user to a group when they join so they recieve email updates from that group.
  • New Hub Random Avatar - Does the same as the User Random Avatar module, but for Hubs.

 

Changes to Existing Addons

  • Referal Points now supports creating friendships betwen users when a user accepts an invitation from another user.
  • A few CSModules have been renamed

 

Get the Addons

To get the addons, just to to the media gallery and download the addon package.  Installation instructions are available on the download page.

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
  • Great work Alex! Can you validate a birthdate within the extended attributes subform? Also, are the attributes searchable?
  • What sort of validation do you want to perform on a birthdate? The attributes are not searchable.
  • In ReferalPointsModule.cs,

    provider.AddReferal(invitation.UserID, e.UserAccepted.UserID);

    If a logged-in user accepted the invitation, e.UserAccepted.UserID would be the logged-in UserID, not the newly registered UserID.

    I changed the source code in \CommunityServer.Controls\Forms\CreateUserForm.cs

                       /* Origional Code

                       if (!Page.Request.IsAuthenticated)

                           FormsAuthentication.SetAuthCookie(user.Username, true);

                       */

                       #region marty1101

                       // Login the newly registered user if the user is logged-in while accepting an invitation.

                       FormsAuthentication.SetAuthCookie(user.Username, true);

                       #endregion marty1101

    Did I do the right thing?

  • Oopps!  Is there a way to do this without touching the source code?

  • That behavour is intentional.  The new member has to accept the invitation.  If an existing member tries to accept the invitation, the referal should never be logged - to determine if the acceptor is a new member the module checks if the user has been created within the past minute.

    Can you provide a scenario where the module doesn't work as expected?

  • I went through the process again:

    1. login as marty1101(2100)

    2. Accepts an invitation from admin(2104) and register a new user: watcher (2132)

    3. After the invitation is accepted, the logged-in user is still marty1101(2100).  and no new entry in Table: ac_UserReferals

    The one minute window did the trick.  However, if marty1101 was registered within the last minute.  A new entry in TAble: ac_UserReferals would be NewUserID=2100(marty1101) instead of NewUserID=2132(watcher)

    I know this is unlikely to happen, but it still an uncertainty.

    Actually, I wrote a similar csa_UserInvitationAccepted() before discovering your add-on.  The behavior I expected was:

    after a logged-in user (marty1101) accepted an invitation, the logged-in user should be the newly created user (watcher) instead of the user (marty1101) who accepted the invitation.  It's more intuitive to me.

    so I made the change to the source code (\CommunityServer.Controls\Forms\CreateUserForm.cs) and it behaves as expected.

    The default behavior leaves me no access to the newly registered User in csa_UserInvitationAccepted(); and it is needed for other purposes.

    I can't think of a reason why CS designed it this way and its intention.  Could you elaborate more on this?

    Let's say a friend issued more than one invitations to me.  I logged in after accepting the 1st one; and accidently accepts the 2nd one (create another new user).  Now I'm logged-in as the first username; and I forgot what username(2nd one) I just registered.  Or, I didn't like the first username and forgot to log out before registering the 2nd username ...

    The final version of my code is to make the change to \CommunityServer.Controls\Forms\CreateUserForm.cs.  and in csa_UserInvitationAccepted(), I check if the new UserID exists in the referral table, and only create a new entry when not.  (ps. I use this referral table for the purpose of multi-level marketing father-son relationship)

    Hopefully I explain it well.  It's quite complicated for me when I discovered the default behavior at the first place.

  • Hi Alex,

    Thank you very much.

    I know it's outside of your current pack, but since you have made it even easier to use the extended attributes (and thank you for that), then there is really one thing that would be GREAT to have, and that's a template tool for creating SQL Scripts to extract the extended attributes!

  • Hi Alex,

    Lately (after I applied your last version) my users are complaining that the Quick Reply form often is malfunction.

    I cannot really see the common issue between the users (personally I've never had the problem), but I too think that it's "funny" that it doesn't show anything when you hold the mouse over the "Reply" button, as it does everywhere else.

    You find the error reports here: dynamicsuser.net/.../27796.aspx

    Rgds,

    Erik

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