Memberlist -- Custom Profile Field Sorting
For vBulletin 3.6.0 Description
By default, vBulletin cannot show just a single custom field on the memberlist, nevermind make it sortable. It's all or nothing.. I wanted to display just the location field and make it sortable, because I use the CountryFlag modification. I searched vbulletin.org to see if this was possible, but all that I could find was unanswered questions similarly asking how to do it. So I took it on myself to get something usable and working.
Instructions
Upload the PLUGIN, and edit it via the Plugin Manager.
Find:
You must first be a
registered member to view any code.
Change
urlname to the variable you want to be used in the URL of the memberlist sorting. My example is
location.
Find:
You must first be a
registered member to view any code.
Change
X to the field number of your custom profile field. My example is
2.
Now you have 2 templates to edit. First,
memberlist.
Find:
You must first be a
registered member to view any code.
Above it, add:
You must first be a
registered member to view any code.
Use
DESC or
ASC depending on which default sort order that you wish to use. Change both instances of
urlname to the variable that you specified in the plugin earlier (
location). Change
Title to the title of the field that you wish to be displayed. My example is
Location.
Now edit the
memberlist_resultsbit template.
Find:
You must first be a
registered member to view any code.
Above it, add:
You must first be a
registered member to view any code.
Change both instances of
X to the field number that you specified in the plugin earlier (
2).
Final Comment
It's not pretty, it's not clever but it works.. :p