I see this is an old thread. I figured I would search before starting a new one, however, this doesn't really answer the question.
I don't want to change the display order as they appear on the memberslist, I want the users to be able to click the Custom Category Field (as a link), and have it sort ASC, DESC - just like the username Category field.
Explaination
In the template:
memberlist
There is a line that sets the username as a sortable category.
Code:
<td class="thead" align="$stylevar[left]" nowrap="nowrap"><a href="$sorturl&order=ASC&sort=username&pp=$perpage$usergrouplink">$vbphrase[username]</a> $sortarrow[username]</td>
Now since the memberlist_results_header handles the custom fields you find in the template:
memberlist_results_header
Default:
Code:
<td class="thead" nowrap="nowrap">$customfield</td>
Modified:
Code:
<td class="thead" nowrap="nowrap">
<a href="$sorturl&order=ASC&sort=$customfield&pp=$perpage$usergrouplink">$customfield</a>
$sortarrow[customfield]
</td>
Now that spits out a link looking like:
Code:
http://blah/blah/forums/memberlist.php?&order=ASC&sort=Location&pp=30
It obviously doesn't like the sort=Location (Location being the $customfield).
Is there anyway to do this easily without writing new code into the memberslist.php? and if not, a little help on the code would be great.