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

XF 1.5 Merging guests and robots count in Members Online Now?

#1
Any way I can merge the guests and robots count in Members Online Now so robots get added to the guests count? I don't want my visitors to see the robots count. But it would be nice if they are added to the guests count. Any way possible to do that? http://prntscr.com/ea3wg0

Secondly, Options > Online Status Timeout (minutes). Does this option mean for how long after being idle the member will still be shown in the Members Online Now? Suppose, I want a user to stay in Members Online Now until 24 hours since they last interacted. Should I just set minutes to 1440?
 

Amaury

Well-known member
#2
For your first question, I'm guessing it would require custom development.

The relevant code is:

Code:
<div class="footnote">
            {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
        </div>
In the sidebar_online_users template. I tried playing around with it to no avail. You can still remove the robots count, though, by removing this:

Code:
, 'robots={xen:number $onlineUsers.robots}'
For your second question, yes. The default setting is 15 minutes. After 15 minutes, the user will no longer be shown under Members Online Now or the Current Visitors page. However, the page they were last viewing will continue to show for at least up to an hour. After that, it can take up to two hours before the cron tasks runs to clear the page they were last viewing and you only see the time of their last activity. The setting cannot be set higher than 60 minutes by XenForo design. Anything higher than 60 minutes is detrimental to the server.
 
#3
For your first question, I'm guessing it would require custom development.

The relevant code is:

Code:
<div class="footnote">
            {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
        </div>
In the sidebar_online_users template. I tried playing around with it to no avail. You can still remove the robots count, though, by removing this:

Code:
, 'robots={xen:number $onlineUsers.robots}'
For your second question, yes. The default setting is 15 minutes. After 15 minutes, the user will no longer be shown under Members Online Now or the Current Visitors page. However, the page they were last viewing will continue to show for at least up to an hour. After that, it can take up to two hours before the cron tasks runs to clear the page they were last viewing and you only see the time of their last activity. The setting cannot be set higher than 60 minutes by XenForo design. Anything higher than 60 minutes is detrimental to the server.
The minutes set on vB currently are 1440 (24 hours). So you're saying we can't have the same setting on XF?
 

Brogan

XenForo moderator
Staff member
#8
You can use xen:calc to add together the guests and robots counts.

In the sidebar_online_users template, replace this:
Code:
<div class="footnote">
    {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
</div>

With this:
Code:
<div class="footnote">
    Total: {xen:number $onlineUsers.total} (members: {xen:number $onlineUsers.members}, guests: {xen:number {xen:calc '{$onlineUsers.guests} + {$onlineUsers.robots}'}})
</div>
 
#9
You can use xen:calc to add together the guests and robots counts.

In the sidebar_online_users template, replace this:
Code:
<div class="footnote">
    {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
</div>

With this:
Code:
<div class="footnote">
    Total: {xen:number $onlineUsers.total} (members: {xen:number $onlineUsers.members}, guests: {xen:number {xen:calc '{$onlineUsers.guests} + {$onlineUsers.robots}'}})
</div>
this doesn't work for me .. shows still users and guests only without adding the bots to the guests