Support Forum

Rearrange Order Of List of Forums for Guests vs Members

DB D Barber
D Barber
Member

How do you make a Group of Forums go from the top of the screen when people are unlogged in as guests, go to the bottom of the screen for logged in members such as the Non-Members Area listed on this forum?

That’s one of the neatest features I’ve ever seen.    Never seen any other forum like that. 

Thanks in Advance!

3 Answers

New Answer

MP Mr Papa
Mr Papa
Member

It all has to do with the arguments to the group class generation…  so in your theme, you likely see this:

            if (sp_has_groups()) : while (sp_loop_groups()) : sp_the_group();

but we use some optional ordering arguments to the sp_has_group() function call…  like this:

            $gIds = '';
            if(!$spThisUser->member) $gIds = '19,17,6';
            if (sp_has_groups($gIds, true)) : while (sp_loop_groups()) : sp_the_group();

so if the current user is not a member, we specifically order the group ids 19 then 17 then 6…  notice the change in sp_has_groups() where we now pass the optional ids and the true parameter telling it to order by these IDs…

so for logged in users, it orders it by the order you see on forum – forums – manage groups and forums… when a non member visiting, we order it differently by the specified group ids…

DB D Barber
D Barber
Member

Wow thanks so much!   This works like a charm. 

I again have to say this is the most distinct feature I’ve ever noticed on a message forum.

That and the faded effect for the other forums for guests.  (I’m still trying to work on figuring that one out)

MP Mr Papa
Mr Papa
Member

the opacity effect:  https://simple-press.com/support-forum/sp5-general-topics/problem-with-post-edit-buttonow-do-you-make-faded-out-effect-for-members-sections-for-guests/