Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Rearrange Order Of List of Forums for Guests vs Members
Avatar
D Barber
Member
Free Members
sp_UserOfflineSmall Offline
Jun 26, 2014 - 11:20 pm

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!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 27, 2014 - 1:51 am

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...

Avatar
D Barber
Member
Free Members
sp_UserOfflineSmall Offline
Jun 27, 2014 - 5:38 pm

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)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 27, 2014 - 7:26 pm
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626