SimplePortal

Customization => Blocks and Modifications => Topic started by: Kiwiee on April 22, 2012, 12:19:53 PM

Title: Ordering Forum Staff Block
Post by: Kiwiee on April 22, 2012, 12:19:53 PM
I know it's been asked hundreds of times, however, I can't seem to find the answer that I'm looking for.

I'm on SMF 2.0.2 and I have SP 2.3.4 and I have an issue with the Forum staff block.

I want the block to oder the staff in order of rank authority, starting at Owner, then Senior adminitratior, administrator, and finally operator.

Unfortunatelly I can't seem to do this and it's placing my operators above the Senior Administrators (which looks rather odd)

A link to the site: http://www.area-32.net/index.php

Thanks for the help from anyone, and by the way, I'm not too good at php, i'm still learning, so if it requires an edit, can whoever replies try and be simple? thanks!
Title: Re: Ordering Forum Staff Block
Post by: AngelinaBelle on April 23, 2012, 04:15:43 PM
I very much encourage you to move up to simpleportal 2.3.5, if at all possible.  It has several nice bug fixes, and some nice features added.

In simpleportal 2.3.5, in PortalBlocks.php, on line 2291, you can see that the key for the array is first -- account type (1=admin, 2=global mod, 3=local mod), and then the user id.

So all admins should come first, followed by all global moderators, followed by all local moderators.
Have you made any chages to portalblocks.php to change this behavior? You have added the operator group to this?
On line 2314, the array is sorted according to the key.




Title: Re: Ordering Forum Staff Block
Post by: Kiwiee on April 24, 2012, 11:49:27 AM
Unfortunately all Admin, Senior Admin, and Operator are global moderators on the forums. Their rank seniority is related to a different server set entirely, they all require global moderation status and are sorted in user id mode. Hence the issue.

Is there a way to sort the users by "Head of Administration" first, "Senior Administrator" second, "Administrator" third, and "Operator" last. And is there a way to sort the users alphabetically after the initial sort, so that all operators are alphabetically ordered as well as being after administrators, for example?

I've also updated to 2.3.5. I must admit I was slow to decide to do so.

Edit: I'm aware since I've changed the administration around a little it looks slightly fixed, but it isn't.
Title: Re: Ordering Forum Staff Block
Post by: AngelinaBelle on April 24, 2012, 02:23:44 PM
Admin would come before the rest of the global mods, which would come before any local mods.

If your group of users is not changing, the easiest way to handle this is to just hard-code a couple of lines to sort them the way you like.

Otherwise, I would say that you could
1) Create different groups for different purposes (senior admin, admin, operator)
2) Add some code in function sp_staff to put every one of these groups in the output array
3) Assign codes 1-whatever based on the group they belong to
4) let sp_staff sort by code/userid as it does now.
Title: Re: Ordering Forum Staff Block
Post by: Kiwiee on April 24, 2012, 02:27:59 PM
The second option sounds much easier, I have a feeling my staff will change over time.

Just a few questions. If I were to make new groups, what code would I add within sp_staff and order them by code? Really sorry for asking but I'm hopeless at php.
Title: Re: Ordering Forum Staff Block
Post by: AngelinaBelle on April 24, 2012, 03:09:00 PM
I'm confident it could be done, but I haven't worked it out just yet. :)

the way I see it, right before $global_mods=
you would have to add some code to pull back members from a couple of groups, and merge that into the $all_staff array.
Then, during the SQL query pulling back all staff, it would have to pull the mg.group_id as well.

That group id would be used in coming up with $row['type'].

And that's it.

Mind if I move this to a customization board?
Title: Re: Ordering Forum Staff Block
Post by: Kiwiee on April 24, 2012, 03:33:48 PM
I have no issue with this being moved to a customisation board if it can help other people and myself. If I'm honest I'm tempted to make a suggestion thread to have the forum staff block developed further. IE having the ability to choose which ranks to show, and in which way to order them as I know many people who would wish to have seperate "respected" or "featured" members for different reasons who may not all have moderator status.
SimplePortal 2.3.8 © 2008-2024, SimplePortal