Back to vBulletin 3.6 Add-ons

Memberlist -- Custom Profile Field Sorting
Mod Version: 1.0.0, by Oblivion Knight

This modification is in the archives.
vB Version: 3.6.0 Rating: (3 votes - 4.67 average) Installs: 34
Released: 21 Aug 2006 Last Update: Never Downloads: 222
Not Supported Uses Plugins Template Edits Is in Beta Stage  

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:
Code:
	case 'urlname':
Change urlname to the variable you want to be used in the URL of the memberlist sorting. My example is location.

Find:
Code:
		$sqlsort = 'userfield.fieldX';
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:
Code:
	<if condition="$show['homepagecol']"><td class="thead" nowrap="nowrap">$vbphrase[home_page]</td></if>
Above it, add:
Code:
	<td class="thead" nowrap="nowrap"><a href="$sorturl&amp;order=DESC&amp;sort=urlname&amp;pp=$perpage$usergrouplink">Title</a> $sortarrow[urlname]</td>
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:
Code:
	<if condition="$show['homepagecol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['homepagelink']"><a href="$userinfo[homepage]" target="_blank"><img src="$stylevar[imgdir_button]/home.gif" alt="home.gif" title="<phrase 1="$userinfo[username]">$vbphrase[visit_xs_homepage]</phrase>"  border="0" /></a><else />&nbsp;</if></td></if>
Above it, add:
Code:
	<if condition="exec_switch_bg()"><td class="$bgclass"><if condition="$userinfo[fieldX]"><div class="smallfont">$userinfo[fieldX]</div></if></td></if>
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..

Download

This modification is archived, downloads are still allowed.

File Type: %1$s Memberlist Sortable Fields.zip (1.7 KB, 319 downloads)

Screenshots

Click image for larger version
Name:	screenshot.jpg
Views:	1280
Size:	91.9 KB
ID:	52446  


vblts.ru supports vBulletin®, 2022-2024