SimplePortal

Customization => Custom Coding => Topic started by: ThatCrazyGuy on October 22, 2014, 06:16:44 PM

Title: Staff list - Sort by rank
Post by: ThatCrazyGuy on October 22, 2014, 06:16:44 PM
I know you've probably been asked this a thousand times but how do you make the staff list sort by the rank of the user.
I've never coded with php and have no idea how to edit it without breaking the portal.

The rank system on my forums goes like this: Owner -> Head Administrator -> Super Administrator -> Administrator -> Trial Administrator

Also I apologize if I have put this in the wrong section.

Thanks in advance.

ThatCrazyGuy.
Title: Re: Staff list - Sort by rank
Post by: ccbtimewiz on October 27, 2014, 07:52:20 PM
Could you tell me what the IDs for those groups are?
Title: Re: Staff list - Sort by rank
Post by: ThatCrazyGuy on November 08, 2014, 07:17:22 AM
1 - Owner
9 - Administrator
10 - Head Administrator
11 - Super Administrator
13 - Trial Administrator
Title: Re: Staff list - Sort by rank
Post by: ThatCrazyGuy on May 01, 2015, 09:13:07 PM
I've found a solution to the problem. But thanks for replying. :D
Title: Re: Staff list - Sort by rank
Post by: ♦ Ninja ZX-10RR ♦ on May 01, 2015, 10:00:51 PM
It would be nice to share the solution if you found it ;)
Title: Re: Staff list - Sort by rank
Post by: ThatCrazyGuy on May 02, 2015, 05:43:31 AM
It's a pretty simple change. First you need to get this http://simpleportal.net/index.php?topic=8765.0 Which is grafitus' staff block.

And all you need to is swap your groups around so they are in the correct order and set the block to sort in ascending order.

1 - Owner
9 - Administrator
10 - Head Administrator
11 - Super Administrator
13 - Trial Administrator

This was from a forum I worked on in the past but I'll use it as an example.

If I wanted the order to be Owner -> Head Administrator -> Super Administrator -> Administrator -> Trial Administrator

I would swap them around so they look like this.

1 - Owner
9 -  Head Administrator
10 - Super Administrator
11 - Administrator
13 - Trial Administrator

Of course ensuring that you change the permissions for the groups once you swapped them. A friend of mine on steam showed me this so all the credit goes to him.

If the colors don't work you need to change the following...


Code: [Select]
m.id_member, m.real_name, m.avatar, m.id_group, mg.group_name,
To

Code: [Select]
m.id_member, m.real_name, m.avatar, m.id_group, mg.group_name, mg.online_color,
And This

Code: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
To

Code: [Select]
'link' => '<a style="color: ' . $row['online_color'] . ';" href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
These can be found in your_forum_directory/Sources/PortalBlocks.php. I found this on the New Staff List thread so once again I take no credit for the idea I just included it so you don't have to search the New Staff List thread for it. Credit goes to Blue for the solution.
Title: Re: Staff list - Sort by rank
Post by: ♦ Ninja ZX-10RR ♦ on May 02, 2015, 01:24:24 PM
Cool, thanks anyway :D
SimplePortal 2.3.8 © 2008-2024, SimplePortal