Announcement

Collapse
No announcement yet.

Remove Active Members Statistic

Collapse
X
Collapse
First Prev Next Last
  • Filter
  • Time
  • Show
Clear All
new posts

    [Official - Free] Remove Active Members Statistic

    For forum sites that are not that active or are just starting, showing the Active Members statistic is not good for members to see.

    It would have been easy to hide it via CSS as you normally would but the way the statistics are displayed, it's not possible as they are all inside a <div> tag and doesn't have its own tag. See sample below: I found a way to hide a statistic without editing widget_statistics template or adding some crazy Javascript. So ignore all the code below and head over to this thread.


    HTML Code:
    You need to be logged in to view the code. Login or Register now!
    This prevents you to hide some parts of the div content as that is not possible in CSS. It would have been possible if each statistic is in its own tag like below:

    HTML Code:
    You need to be logged in to view the code. Login or Register now!
    In the code above, you could have targeted the 4th span in CSS and hide it.

    Now that you've seen what the problem is, here are possible solutions:

    For self-hosted version:

    1. Edit widget_statistics template in Style Manager in AdminCP.
    2. Find this line:
    Code:
    You need to be logged in to view the code. Login or Register now!
    3. Remove it by commenting it out. You do it by enclosing the code in <vb:comment> </vb:comment> tags:
    Code:
    You need to be logged in to view the code. Login or Register now!
    4. Save.
    5. Repeat for every active theme/style you are using.


    For vBCloud:

    1. Go to homepage or where the Forum Statistics module is.
    2. Find out the widget id of the Forum Statistics module by right clicking on it and inspecting the element.
    3. Look for id="widget_XXXX" where XXXX is a number. Take note of this widget id.
    4. Enable Sitebuilder (Edit Site ON)
    5. Click Edit Page.
    6. Drag and drop Static HTML module onto the page right BELOW the Forum Statistics module.
    7. Edit the Static HTML module configuration.
    8. Uncheck all the 3 checkboxes for the "Show module at these screen sizes" option.
    9. Copy and paste the code below to the "Module HTML" option.
    Code:
    You need to be logged in to view the code. Login or Register now!
    10. Change the value of the statsWidgetId variable with the value you got from Step 3. Do not remove the quotes around it.
    11. Change the value of the activeMembersLabel variable as needed. If you are using non-English language, you need to change this accordingly. If you are using multiple languages, you need to add them like this:
    Code:
    You need to be logged in to view the code. Login or Register now!
    12. Save the module and page as you normally would.


    That's it! Enjoy!
    Last edited by glennrocksvb; 06-13-2018, 01:05 AM. Reason: Linked to a new and better solution. Original code not recommended anymore.

    #2
    Glenn that worked beautifully
    Happy New Year and BAG the coffee.. Dinner is on it's way
    Thanks for all your free help throughout the year

    Comment


    • glennrocksvb
      glennrocksvb commented
      Editing a comment
      Glad to help!

    • glennrocksvb
      glennrocksvb commented
      Editing a comment
      Thanks for the treat as always!

    #3
    I think I will give this a try. I did not like that was placed there to begin with.

    Update: Nice

    Comment


      #4
      I'm still thankful that Glenn was able to come up with this fix

      Comment


        #5
        The original code is not recommended anymore as I found a better solution. First post updated with link to a new solution.

        Comment

        Working...
        X