Print Page | Close Window

REQ: Members.asp Default Sort Order

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23006
Printed Date: 30 March 2026 at 5:57am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: REQ: Members.asp Default Sort Order
Posted By: MortiOli
Subject: REQ: Members.asp Default Sort Order
Date Posted: 29 March 2007 at 1:00pm

Did a quick search, but couldn't find an answer - lots of requests, but no answers.

How do I go about changing the default sort order for members.asp?
 
For example, at the moment it sorts by Username when you access the page, but I'd like it to be sorting by Post Count (highest first), instead.
 
Cheers!



Replies:
Posted By: MortiOli
Date Posted: 03 April 2007 at 1:37pm
Anyone have an idea?


Posted By: MrMellie
Date Posted: 03 April 2007 at 2:42pm
Oli, change line 119 (after the 'case else' on line 118) from 
 
 strSortBy = strDbTable & "Author.Username "

to

strSortBy = strDbTable & "Author.No_of_posts "



Posted By: MrMellie
Date Posted: 03 April 2007 at 2:56pm
Oh and you might also want to change lines 122 on to get the default sort order right.
 
From:
 

'Sort the direction of db results

If Request.QueryString("OB") = "desc" Then

strSortDirection = "asc"

strSortBy = strSortBy & "DESC"

Else

strSortDirection = "desc"

strSortBy = strSortBy & "ASC"

End If

to
 
'Sort the direction of db results

If Request.QueryString("OB") = "asc" Then

strSortDirection = "desc"

strSortBy = strSortBy & "ASC"
Else

strSortDirection = "asc"

strSortBy = strSortBy & "DESC"

End If

And hopefully, the last change, around line 370-376, replace with:
[code]

<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">

<tr class="tableLedger">

<td width="20%"><a href="members.asp?SF=<% = Server.URLEncode(Request.QueryString("SF")) %>&GID=<% = intGetGroupID %>&SO=UN<% = strQsSID2 %>"><% = strTxtUsername %></a><% If Request.QueryString("SO") = "UN" Then Response.Write(" <a href=""members.asp?SF=" & Server.URLEncode(Request.QueryString("SF")) & "&GID=" & intGetGroupID & "&SO=UN&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & ".gif"" border=""0"" align=""absmiddle"" alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>

<td width="20%"><a href="members.asp?SF=<% = Server.URLEncode(Request.QueryString("SF")) %>&GID=<% = intGetGroupID %>&SO=GP<% = strQsSID2 %>"><% = strTxtType %></a><% If Request.QueryString("SO") = "GP" Then Response.Write(" <a href=""members.asp?SF=" & Server.URLEncode(Request.QueryString("SF")) & "&GID=" & intGetGroupID & "&SO=GP&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & ".gif"" border=""0"" align=""absmiddle"" alt=""" & strTxtReverseSortOrder &



Posted By: MortiOli
Date Posted: 05 April 2007 at 2:00pm

Cheers Ric!  Perfect!



Posted By: MortiOli
Date Posted: 05 April 2007 at 10:59pm
Just found that your first change also needed a line adding, otherwise sorting by username didn't work correctly;
 
'Get the sort critiria
Select Case Request.QueryString("SO")
 Case "PT"
  strSortBy = strDbTable & "Author.No_of_posts "
 Case "LU"
  strSortBy = strDbTable & "Author.Join_date "
 Case "OU"
  strSortBy = strDbTable & "Author.Join_date "
 Case "GP"
  strSortBy = strDbTable & "Group.Name "
 Case "LA"
  strSortBy = strDbTable & "Author.Last_visit "
 Case "UN"
  strSortBy = strDbTable & "Author.Username "
 Case Else
  strSortBy = strDbTable & "Author.No_of_posts "
End Select


Posted By: wistex
Date Posted: 08 April 2007 at 1:12am
Another way to accomplish this is to simply change the link to the members list at the top pf the page.
 
http://www.caribbeanchoice.com/forums/members.asp?SF=&GID=0&SO=PT&OB=desc&">Display%20List%20of%20Forum%20MembersMemberlist  
 
It used to be:
http://www.caribbeanchoice.com/forums/members.asp - http://www.caribbeanchoice.com/forums/members.asp
 
I changed it to:
http://www.caribbeanchoice.com/forums/members.asp?SF=&GID=0&SO=PT&OB=desc - http://www.caribbeanchoice.com/forums/members.asp?SF=&GID=0&SO=PT&OB=desc &
which you will notice is the URL produced when you sort by posts by clicking on column headings to sort.
 
I added the trailing & just in case WWF tacked on a session ID for those without cookies, otherwise it would break for them.
 
Changing the link to the members page accomplishes the same thing.
 
I wish this sort order was the default and I didn't have to change it every time I upgrade.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net