Sorting by Rank on "The Team"

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
A.Finest
Registered User
Posts: 2
Joined: Thu Aug 09, 2018 3:53 am

Sorting by Rank on "The Team"

Post by A.Finest »

Hey phpbb,

I've searched around for a solution to my problem and have been unable to find one,

What I'm searching for is a way to order the listing of members on "The Team" page. All of these users would be in the same group, so separating them into multiple groups is not the answer here.

Here's an example of what I am trying to do....

What I'm looking to get...
GROUP NAME: "COMMUNITY CONTRIBUTOR"
User1 - Site Admin
User2 - Moderator
User3 - Developer
User4 - Contributor
User5 - Contributor

Instead I got this at the moment...
GROUP NAME: "COMMUNITY CONTRIBUTOR"
User5 - Contributor
User2 - Moderator
User3 - Developer
User1 - Site Admin
User4 - Contributor

Does anyone know of a solution to this issue?

Also all of my ranks are "Special" and are not posting ranks.
phpbb Installation is version 3.2.2


Best Regards,
A.Finest
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3732
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Sorting by Rank on "The Team"

Post by Kailey »

Sorting is automatically done by username. Not tested by try changing line 186 in memberlist.php.

From

Code: Select all

'ORDER_BY'	=> 'u.username_clean ASC',
to

Code: Select all

'ORDER_BY'	=> 'u.user_rank ASC',
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
A.Finest
Registered User
Posts: 2
Joined: Thu Aug 09, 2018 3:53 am

Re: Sorting by Rank on "The Team"

Post by A.Finest »

kinerity wrote: Thu Aug 09, 2018 10:29 am Sorting is automatically done by username. Not tested by try changing line 186 in memberlist.php.

From

Code: Select all

'ORDER_BY'	=> 'u.username_clean ASC',
to

Code: Select all

'ORDER_BY'	=> 'u.user_rank ASC',
I keep getting more and more amazed how simple things are with phpBB.... I come from Vbulletin and its waaaay more complicated normally.

Anyhow code implemented and by first looks no problems, next thing then is the order goes back to username sorting when navigating into a specific group. As in clicking the name of the usergroup so it lists only the members of that group.

Any idea on how this could be implemented?

Thanks,
A.Finest
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3732
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Sorting by Rank on "The Team"

Post by Kailey »

Again, not tested.

Open memberlist.php

Find (line 982)

Code: Select all

$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';
Replace with

Code: Select all

$sql_select = $sql_where_data = $sql_from = $sql_where = '';
$order_by = 'u.user_rank ASC';
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
Post Reply

Return to “phpBB Custom Coding”