I can’t seem to get the Stats module to give me the total number of logged in users. I keep getting 0.
I’m using EE 2.2.2, I haven’t used it before this revision so I can’t say it’s inherent to this release.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
September 20, 2011 10:30pm
Subscribe [3]#1 / Sep 20, 2011 10:30pm
I can’t seem to get the Stats module to give me the total number of logged in users. I keep getting 0.
I’m using EE 2.2.2, I haven’t used it before this revision so I can’t say it’s inherent to this release.
#2 / Sep 21, 2011 11:29am
Hi NAlbuquerque,
Can you possibly show us some code that you are using to do this?
You should have something like :
{exp:stats}
Total number of logged in users = {total_logged_in}
{/exp:stats}Is that the code you are using or something else?
Thanks,
Mark
#3 / Sep 21, 2011 11:53am
Yep, similar code with some of the other available variables such as {total_members} and {most_visitors} and those all work fine. Although I neglected to mention we are using the Solspace User module, but I’m not sure how that would conflict with this.
{exp:stats}
<li><label>Total Members:</label> {total_members}</li>
<li><label>Most Visitors:</label>{most_visitors} members on {most_visitor_date format="%m/%d/%Y %h:%i %a"}</li>
{!--<li><label>Currently Logged In:</label> {total_logged_in}</li>--}
<li><label>Currently Online Members:</label>
{if member_names}
<ul class="simple-list">
{member_names}
<li><a href="http://{member_path=member/profile}">{name}</a></li>
{/member_names}
</ul>
{/if}
</li>
{/exp:stats}#4 / Sep 22, 2011 4:22am
NAlbuquerque,
Can you confirm that you have Enable Online User Tracking? turned on
Admin -> Security & Privacy -> Tracking Preferences
Are you testing this with yourself as a signed in SuperAdmin or with members from your Members Group?
Take a look at this thread where Sue explains the ins and outs of logged in users
#5 / Sep 22, 2011 11:54am
I have verified that Online User Tracking is enabled, here is a screenshot.
http://cl.ly/0r280m2u1o0n3h311U1u
I looked at the thread, but Seb appears to be having issues showing the names of the online members. I am able to display a list of online users, but I am unable to get the count to display.
#6 / Sep 22, 2011 12:24pm
Also, I added the anon checkbox into the exp:member:login_form and it still doesn’t show the total # of logged in users. I did notice that the exp_online_users table shows the ‘anon’ column set to ‘y’ whether I check the box or not.
<input class='checkbox' type='checkbox' name='anon' value='1' checked='checked' />#7 / Sep 23, 2011 10:35am
Hi NAlbuquerque,
Could you do me a favour and just use the bare code that I posted above and place that in a template. Could you then log out of the site completely and visit the template.
You should then get Total number of logged in users = 0 showing.
If you now log back into the Control Panel again and revisit that page you should instead get Total number of logged in users = 1 showing.
Then could you refresh that template once more and see if you get it reverting back to 0 again?
I think there might be something up here but just need someone else to check it out with me if that’s okay with you?
Thanks,
Mark
#8 / Sep 23, 2011 11:35am
Mark, I experienced the same exact thing. There is something definitely funky going on in there.
#9 / Sep 23, 2011 12:29pm
Hi NAlbuquerque,
As we’re both experiencing the same behaviour on two separate installs I’ve gone ahead and reported this as a bug here.
If you subscribe to that report then you will be able to follow the progress of it.
Does that help?
Thanks,
Mark
#10 / Sep 23, 2011 1:46pm
Excellent, thanks Mark.
#11 / Sep 24, 2011 10:19am
Hi NAlbuquerque,
I’m going to close this thread out now but if you are subscribed to that bug report then you will get notified of any updates to it.
If anything else crops up then please don’t hesitate to post again as needed.
Thanks,
Mark