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 to get the "total online users count" globally

Discussion in 'XenForo Questions and Support' started by maxicep, Mar 6, 2016.

  1. maxicep

    maxicep Active Member


    I want to get "total online users now count" to my header in xenforo.
    Also, i wanna get the total online user count to my custom portal software too.

    Is there any add-on for that ? Or how is possible ?

    Last edited: Mar 6, 2016
  2. wang

    wang Well-Known Member


    Unless I am mistalen, the number of total users online now in the sidebar is included in xenforo. If that is not what you meant, can you please screenshot it?
  3. maxicep

    maxicep Active Member

    My mistake, i mean in header not sidebar sorry.

    I need get the numbers globally in header and my portal blog software both.
  4. wang

    wang Well-Known Member

    Can you please screenshot the places?
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Add this to the sidebar_online_users template:
    <xen:container var="$onlineUsers">{$onlineUsers.total}</xen:container>
    You can then call it in the PAGE_CONTAINER template using:
    {xen:number $onlineUsers}
    But it will only work for pages which load the sidebar_online_users template.
    It's really going to require custom development or an add-on to make it available everywhere.
    maxicep and eva2000 like this.
  6. maxicep

    maxicep Active Member

    And how is possible the call this counts in another php blog software ?
  7. Brogan

    Brogan XenForo Moderator Staff Member

  8. Melvin Garcia

    Melvin Garcia Member

  9. maxicep

    maxicep Active Member

    Thank you for your help, i will go a custom development for that which uses text file cache.

    Then for my portal software, i will get variables (current online visitors) from a text file in hosting that how many visitors online.

Share This Page