CS Nuggets

This blog is for addons, bugs, fixes, and issues pertaining to Community Server.

August 2006 - Posts

CS: Workaround: Reordering Forum Groups or Forums within a Group

Due to some bugs within CS, it is not possible to change the order of the last Forum Group, or the last Forum within a Group.  The following work around will allow you to make these changes:

Reordering Forum Groups:

  1. Create a new forum group named DUMMY, but do not create or move any forums under it.
  2. While in Tree View, drap the forum groups to the root node to have them reordered to the bottom of the group list.
  3. Ignore the DUMMY group as it can't be seen or reordered.
  4. Once you are done reordering, click on the "Manage All Forums" link and you will see the current order of the forum groups.
  5. Delete the DUMMY group if you wish, but at long as it doesn't have any forums in it, it will not display.

Reordering Forums within a Group:

  1. Create a new forum named DUMMY within the forum group that you want to reorder.
  2. While in Tree View, drag the forums to the group node to have them reordered to the bottom of the group.
  3. Ignore the DUMMY forum as it can't be seen or reordered.
  4. Once you are done reordering, click on the "Manage All Forums" link and you will see the current order of the forums.
  5. Delete the DUMMY forum.
CS: BUG FIX: Numerical or localhost hostnames when wwwStatus = "Require"

If you have wwwStatus = "Require" in your CommunityServer.config file, the site will not function if you try to access it via an IP address (usually used while debugging) or "localhost".  I added the following code to correct the issue.  The regular expressions should probably be expanded upon, but since they weren't the code I added is not either:

CommunityServerComponents(20)/HttpModule/CSHttpModule.cs:

Insert the following line:

private static Regex ignoreWwwStatusRegex = new Regex(@"https?://(localhost|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})", RegexOptions.IgnoreCase | RegexOptions.Compiled);

before the line:

private static Regex wwwStatusRegex = new Regex("https?://www\\.", RegexOptions.IgnoreCase | RegexOptions.Compiled);

Insert the following lines:

if (ignoreWwwStatusRegex.IsMatch(rawUrl))
    return;

after the line:

string rawUrl = context.Request.Url.ToString();

This will prevent the system from trying to make any modifications to the hostname portion of a URL if it is "localhost" or an IP address.