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

hide Forum statistics from sidebar ?

Discussion in 'XenForo Questions and Support' started by erich37, Jan 22, 2012.

  1. erich37

    erich37 Well-Known Member

    Hello,

    1)
    I would like to hide "Members Online Now" and "Forum Statistics" in the sidebar. I want to hide it both for members and visitors.

    2)
    I would like to put the blocks "Find Member", "Highest Posting Members" and "Newest Members" to the Sidebar at the Homepage. Exactly the same blocks as are being shown at the "Members Page".
    I want to have these blocks positioned atop the "Share this Page"-block (in the Sidebar) at the Homepage.

    Could you please give me a quick help on this?

    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    For 1, add to EXTRA.css:
    Code:
    #boardStats {
    display: none;
    }
     
    .sidebar .userList {
    display: none;
    }
    For 2, what homepage are you using?
    If this is a portal, you will need to ask in the add-on thread as I don't have any installed.
     
    Webby, Rho Delta and erich37 like this.
  3. erich37

    erich37 Well-Known Member

    Hi Brogan,

    I am just using XF default. The Forum-Nodes are the Homepage. Not using any portal or any custom design.
    Appreciate your kind help! Thanks!
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Ah, you mean the forum list.
    The data from the members page isn't exposed to work on the forum list page.
     
  5. erich37

    erich37 Well-Known Member

    oooops..... would be great if XF could implement this possibility.
    Thanks!
     
  6. erich37

    erich37 Well-Known Member



    Borbole's great Add-ons actually solved my above request:

    http://xenforo.com/community/resources/authors/borbole.512/
     
  7. erich37

    erich37 Well-Known Member

    To hide the forum stats for guests you'll need to modify the forum_stats block in the forum_list template.

    Add this code at the top:
    Code:
    <xen:if is="{$visitor.user_id}">

    Add this code at the bottom:
    Code:
    </xen:if>

    so that it will look like this:
    Code:
    <!-- block: forum_stats -->
        <xen:if is="{$visitor.user_id}">
            <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>
        </xen:if>
            <!-- end block: forum_stats -->
     
  8. 51463

    51463 Well-Known Member

    Last edited: Oct 12, 2013
  9. LuvMeSumZen

    LuvMeSumZen Active Member

    Paul, I just tried this to hide the core stats because I'm using an addon for stats and don't want both stat fields in the sidebar (they do not match anyway). It didn't work - is it no longer a valid edit for 1.4?
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    That is still valid for the default block.

    You will need to ask in the add-on thread.
     
  11. LuvMeSumZen

    LuvMeSumZen Active Member

    I have the addon disabled. I am asking about the core stat field here.
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    As above, the code is still valid for both blocks.
     
  13. LuvMeSumZen

    LuvMeSumZen Active Member

    Hmm. Wonder what I am doing wrong then. I copied your code and placed it in the said template and the stat box is still there. Any idea why it might not be working?

    extra css.jpg

    That shows the codes both on the same lines, but I tried it exactly as you had it shown also and it didn't make a difference.
     
  14. Steve F

    Steve F Well-Known Member

    You really shouldn't be editing the master style as the changes will be overwritten on updates.
     
  15. LuvMeSumZen

    LuvMeSumZen Active Member

    Okay, I deleted the code and saved it as a bank page, because I wasn't sure that the 'Delete Template' option would only delete the edit.

    So should I not use that code for editing individual themes either?
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    That is the correct code if you want to hide those blocks in the sidebar.

    It needs to be added to the EXTRA.css template for each (parent) style.
     
  17. Steve F

    Steve F Well-Known Member

    The code is fine, and yes delete template would delete it when editing the master style.
     
  18. LuvMeSumZen

    LuvMeSumZen Active Member

    I'm not asking the right questions I realize. Let me try it this way. I want to hide the core stat field . . . .
    side stats1.jpg

    . . . . so that I can enable the AO that I have which shows more statistics. I would like to hide the core field and show the AO field once I enable it. How can I do this?
     
  19. Brogan

    Brogan XenForo Moderator Staff Member

    Once again, the code above will hide the default statistics block on the sidebar.

    If you are using a custom style, you may need to use different selectors.
     
  20. LuvMeSumZen

    LuvMeSumZen Active Member

    Okay I did that, but it hid everything in the sidebar except the Staff Online field. I won't trouble y'all with this further it's a little beyond my grasp so I will ask my tech to do this for me. Thanks for the help guys I appreciate it.
     

Share This Page