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

XF 1.4 Hide "Staff Online Now" and "Members Online Now" to Guests?

Discussion in 'Styling and Customization Questions' started by Demon, May 24, 2015.

  1. Demon

    Demon Active Member

    How do I hide "Staff Online Now" and "Members Online Now" to guests? I have tried editing the sidebar_online_users template. I added <xen:if is="{$visitor.user_id}"> and it did not change anything. Editing the forum_lst template didn't change anything either.
     
    Last edited: May 24, 2015
  2. mike406

    mike406 Member

    That seems to be working for me, where in the template are you placing it?
     
  3. rafass

    rafass Well-Known Member

    Clear the cache.
     
  4. AndyB

    AndyB Well-Known Member

  5. Amaury

    Amaury Well-Known Member

    Not everything requires an add-on. Conditionals can be used for this.
     
  6. Demon

    Demon Active Member

  7. Amaury

    Amaury Well-Known Member

    See Mike's reply above. Where did you place it in the template?

    This can be accomplished with a conditional, though.
     
  8. Demon

    Demon Active Member

    I installed the add-0ns that Andy listed above.

    For all 3, I put the conditional statements like this:
    Code:
    <xen:if is="{$visitor.user_id}">
    <!-- block: forum_stats -->
            <div class="section">
                <div class="secondaryContent statsList" id="boardStats">
                    <h3>{xen:phrase forum_statistics}</h3>
                    <div class="pairsJustified">
                        <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                            <dd>{xen:number $boardTotals.discussions}</dd></dl>
                        <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                            <dd>{xen:number $boardTotals.messages}</dd></dl>
                        <dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
                            <dd>{xen:number $boardTotals.users}</dd></dl>
                        <dl><dt>{xen:phrase latest_member}:</dt>
                            <dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
                        <!-- slot: forum_stats_extra -->
                    </div>
                </div>
            </div>
            <!-- end block: forum_stats -->
    </xen:if>
    
    Sorry, I didn't see your reply until after Andy's reply.
     
  9. mike406

    mike406 Member

    ^ That above works for the forum statistics.
     
  10. Demon

    Demon Active Member

    http://prntscr.com/78pic0

    That above code didn't work for me.

    EDIT: I know, I'm also trying to hide the forum statistics. But for the staff online now, members online now & forum statistics, I have to te conditional statements like that.
     
  11. mike406

    mike406 Member

    Ok, that code is for the sidebar only on the forum list. Are you viewing the forum list, or a page from another addon that includes the sidebar. For example, our forum uses a Portal addon that includes the sidebar but uses a different template for it.
     
  12. Demon

    Demon Active Member

    I'm viewing the index(no portal add-on) as a guest.
     
  13. mike406

    mike406 Member

    May I have a link to your forum? What is strange is that I try your exact code, and it works for me.
     
  14. Demon

    Demon Active Member

    I'll pm you.

    I'm using the Zipped style. I'll message Russ or Steve.
     

Share This Page