The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Sort member list by Location
Sorry if this has already been requested. I did a search and didn't find it.
I would like to be able to sort the members list by location. To be able to click the "Location" field just as you do the "posts", "alphabetical", etc. headers. I've seen this requested all the way back to VBulleting 2 something but have never really seen it done. Is it just not feasible? Don |
#2
|
||||
|
||||
Excellent idea - this would be very useful for many forums.
|
#3
|
|||
|
|||
I know quite a few have been asking for this and I knew that I had it before in an earlier version (3.0.3) so I thought I would give it a go and see if I could get it to work in 3.5.2 and it does.
(Thanks to Stuart for the direction over a year ago) 1 File to Edit 1 Template to Edit In memberlist.php you need to add a case, to the switch so as you can sort by location. case 'location': $sqlsort = 'userfield.field2'; break; So in forums/memberlist.php on or about line 356... FIND: Code:
switch ($sortfield) { case 'username': $sqlsort = 'user.username'; break; Code:
switch ($sortfield) { case 'location': $sqlsort = 'userfield.field2'; break; case 'username': $sqlsort = 'user.username'; break; There's more than 1 way to do this, but for ease, I would add a line of code that sets a condition if the field is Location (field2) $show['field2'] = iif($customfield['varname'] == 'field2', true, false); In forums/memberlist.php on or about line 811... FIND: Code:
foreach ($profileinfo AS $index => $customfield) { $totalcols++; $customfield = $customfield['title']; eval('$customfieldsheader .= "' . fetch_template('memberlist_results_header') . '";'); } } Code:
foreach ($profileinfo AS $index => $customfield) { $show['field2'] = iif($customfield['varname'] == 'field2', true, false); $totalcols++; $customfield = $customfield['title']; eval('$customfieldsheader .= "' . fetch_template('memberlist_results_header') . '";'); } } so that in memberlist_results_header you could change FIND: Code:
<td class="thead" nowrap="nowrap">$customfield</td> Code:
<td class="thead" nowrap="nowrap"><if condition="$show['field2']"><a href="$sorturl&order=DESC&sort=location&pp=$perpage&ltr=$ltr$usergrouplink">$customfield</a> $sortarrow[location]<else />$customfield</if></td> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|