XF 2.1 show Members online (but not the member list)

-Eric-

Member
same permission enables/disables both "Members online" and "Menu members"
I want to show "Members online" to everyone and prevent the members list, is this possible?

For now I have hidden the "Menu Members" for guest, but with the URL (forum/members) access is allowed.
 
As far as I can tell you will have to remove the check for canViewMemberList() in file XF\Widget\MembersOnline function render()
once you have revoked the can view member list to guests.
 
As far as I can tell you will have to remove the check for canViewMemberList() in file XF\Widget\MembersOnline function render()
once you have revoked the can view member list to guests.
Thank you so much for that information. This helped me greatly with this issue.

For everyone that is wanting to do this, all I did is comment out that 'canViewMemberList()' check in MembersOnline.php file in the path that @Bespoke mentioned above.

One thing to keep in mind when doing this is if you upgrade versions there is a possibility of this change being overridden and you'll need to make the change again.

Here is what the commented out code will look like:

PHP:
        /** if (!\XF::visitor()->canViewMemberList())
        {
            return '';
        } */


As you can see this session there is nobody logged in and the member list can be viewed

1595984953326.png

Thank you again @Bespoke for that insight!
 

Attachments

  • 1595984802654.webp
    1595984802654.webp
    11.1 KB · Views: 1
Last edited:
Top Bottom