SimplePortal
Customization => Custom Coding => Topic started 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.
-
Could you tell me what the IDs for those groups are?
-
1 - Owner
9 - Administrator
10 - Head Administrator
11 - Super Administrator
13 - Trial Administrator
-
I've found a solution to the problem. But thanks for replying. :D
-
It would be nice to share the solution if you found it ;)
-
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...
m.id_member, m.real_name, m.avatar, m.id_group, mg.group_name,
To
m.id_member, m.real_name, m.avatar, m.id_group, mg.group_name, mg.online_color,
And This
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
To
'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.
-
Cool, thanks anyway :D