 		where
 			a.BoardID=@BoardID
 		order by
-			a.MinPosts,
+			a.SortOrder,
 			a.Name
 	else
 		select

			TotalCount =  @user_totalrowsnumber 
			from [{databaseOwner}].[{objectQualifier}User] a with(nolock)
			join [{databaseOwner}].[{objectQualifier}Rank] b with(nolock) on b.RankID=a.RankID	
      where (a.UserID >= (case 
        when @SortName = 1 then @firstselectuserid end) OR a.UserID <= (case 
        when @SortName = 2 then @firstselectuserid end) OR
		a.UserID >= (case 
        when @SortName = 0 then 0 end)) and
		(a.Joined >= (case 
        when @SortJoined = 1 then @firstselectjoined end) 
		OR a.Joined <= (case 

        when @NumPostsCompare = 1 then @NumPosts end)) 
     order by  	 
	    (case 
        when @SortName = 2 then a.[Name] end) DESC,
		(case 
        when @SortName = 1 then a.[Name] end) ASC, 
		(case 
        when @SortRank = 2 then a.RankID end) DESC,
		(case 
