Reordering forums in CommunityServer 1.x

Yes, I know that CommunityServer 2.0 has been released months ago, but considering the effort in upgrading (and my lack of time), I’m still using CommunityServer 1.x on CSFBL. It does a fine job for what I need at this time.

However, one thing perturbs me — the fact that new forums in a forum group aren’t added in the correct place when you want alphabetical sorting. There’s a good reason for this: CommuntiyServer manages sort order by using a SortOrder value in the database, allowing you to choose any sort order. However, this works against you when you want to use plain old alphabetical sorting.

The solution is to run a SQL script to update the SortOrder value of each forum such that they will be displayed alphabetically. The following SQL script will show you the forums, current sort order, and new sort order for all forums in a given group.

select sectionid, name, sortorder,
( select count(*) from cs_sections
where groupid = cs.groupid and name < cs.name ) as new_sortorder from cs_sections cs where groupid = 8 order by sortorder asc [/source] Pretty simple. You can get the GroupID by looking at the same table, or by looking at the ForumGroupID in the URLs on your web site. To apply these changes: [source='sql'] update cs_sections set sortorder = ( select count(*) from cs_sections where groupid = cs.groupid and name < cs.name ) from cs_sections cs where groupid = 8 [/source] Simple and relatively harmless -- and a heck of a lot easier than trying to use the (buggy) reordering of forums in the admin console!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.