1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 How can I hide the current members online from unregistered guests?

Discussion in 'Styling and Customization Questions' started by Jason M., Aug 28, 2015.

  1. Jason M.

    Jason M. Member

    I only want the registered members to see the list of who is currently on line. Seems simple but I don't see how to do this easily. What css would I need to add to make this work? Thanks and sorry if posted in the wrong area.
     
  2. Martok

    Martok Well-Known Member

    You can do this with a conditional statement. See this guide for more information.

    Conditional Statements

    As a note, I used to do this but now show members online to everyone. I thought it was better to show the site was active, guests expect to see who is online from other forum software.
     
  3. Jason M.

    Jason M. Member

    Thank you Martok. I'm not sure that we will implement this. I tend to agree with your opinion on activity, but a few members have asked about this ability as opposed to hiding their online visibility.
     
  4. jamalfree

    jamalfree Active Member

    template sidebar_visitor_panel



    <xen:if is="!{$visitor.is_admin}">
    <style> .membersOnline {display:none} </style>
    </xen:if>


    put this code top
    <xen:include template="ad_sidebar_below_visitor_panel" />
     
    Jason M. likes this.
  5. Martok

    Martok Well-Known Member

    That's not the right way to do it at all, especially using display: none. Also your code would only make it available to administrators, the OP wants to hide it from guests only.

    This is the correct code.

    1. How can I show content just to logged in members and hide it from guests?
    <xen:if is="{$visitor.user_id}">
    This content will show to logged in members
    </xen:if>
     
    Jason M. likes this.
  6. jamalfree

    jamalfree Active Member

    lol :D i put my code without change; i don't want any member show members online
     
    Jason M. likes this.

Share This Page