sort members alphabetically

Is there a way to sort members alphabetically on the browse page?
 Presently the options are: Latest Activity, Member Since, and Rate.
We don't need the rate option, but would love the option so sort alphabetically by user name.

Bill and Deb
Quote · 7 Dec 2012

Open file templates/base/scripts/BxBaseBrowse.php

find this function: function getBlockCode_SearchedMembersBlock

1)
and this code:
    // select sorting parameters ;
        $sSortParam = '`Profiles`.`DateLastNav` DESC';
        if ( isset($this -> aDisplaySettings['sort']) ) {
            switch($this -> aDisplaySettings['sort']) {
                case 'date_reg' :
                    $sSortParam = ' `Profiles`.`DateReg` DESC';
                    break;
                case 'rate' :
                    $sSortParam = ' `Profiles`.`Rate` DESC, `Profiles`.`RateCount` DESC';
                    break;
                default :
                    $this -> aDisplaySettings['sort'] = 'activity';
                case 'activity' :
                    $sSortParam = ' `Profiles`.`DateLastNav` DESC';
                    break;


add the bold code:
    // select sorting parameters ;
        $sSortParam = '`Profiles`.`DateLastNav` DESC';
        if ( isset($this -> aDisplaySettings['sort']) ) {
            switch($this -> aDisplaySettings['sort']) {
                case 'date_reg' :
                    $sSortParam = ' `Profiles`.`DateReg` DESC';
                    break;
                case 'sortname' :
                    $sSortParam = ' `Profiles`.`NickName` ASC';
                    break;
                case 'rate' :
                    $sSortParam = ' `Profiles`.`Rate` DESC, `Profiles`.`RateCount` DESC';
                    break;
                default :
                    $this -> aDisplaySettings['sort'] = 'activity';
                case 'activity' :
                    $sSortParam = ' `Profiles`.`DateLastNav` DESC';
                    break;


2)
and this code:
    $aSortingParam = array
        (
            'activity'     => _t( '_Latest activity' ),
            'date_reg'     => _t( '_FieldCaption_DateReg_View' ),
            'rate'         => _t( '_Rate' ),
        );


add the bold code:
    $aSortingParam = array
        (
            'activity'     => _t( '_Latest activity' ),
            'date_reg'     => _t( '_FieldCaption_DateReg_View' ),
            'sortname' => _t( '_Sort by user name' ),
            'rate'         => _t( '_Rate' ),
        );


3)
Add a new language key: _Sort by user name


4)
Delete cache


5)
Done...

Quote · 7 Dec 2012

 This worked beautifully!

Thank you so much okweb

 

Bill and Deb

Bill and Deb
Quote · 7 Dec 2012

5 years later and this edit still works (and is still needed) 

Quote · 28 Jun 2017

Gee, I've always wanted this and I agree that it should be a standard feature.

Quote · 28 Jun 2017

Thank you, thank you!

You can't make chicken salad out of chicken shit.. although it does work the other way around!
Quote · 18 Apr 2018

seems the code is not working.

Quote · 19 Apr 2018

 

seems the code is not working.

 My version is 7.3.5 dolphin

Quote · 19 Apr 2018
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.