Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: ohhhdear - elokuu 29, 2011, 03:28:05 IP

Otsikko: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 29, 2011, 03:28:05 IP
Hi all,

I am using 1.1.13- and updated to 1.1.14.

My "users online"  and "most online" is not accurate.

For example, I just logged on--- and it said MOST ONLINE TODAY is 15.
But under the USERS ONLINE--it said 15 users, 1 guest.  So the most online today should have been at least 16, because all were logged in at the same time.

The other day it had 22 guests and  2 users, but it still only showed 15 for "most online today" and that should have read at least 24 for most online.

How can I fix this?
Thank you for any info.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 29, 2011, 06:29:26 IP
Any mods installed? Does it always read 15? Wondering if the BoardIndex.template.php isn't right or something.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 29, 2011, 06:43:51 IP
Oh hi Mashby!  I got my hero!  Remember me? I'm the little 'ole lady. :)

It's read 15 for quite some time now. I can't remember when it started.
And I just checked the site again--it says now:

19 guests, 2 users
But still says 15  for "most online today".

The mods I have installed are:
1.    Google Analytics Code    1.3    
2.    Global Headers Footers    2.0    
3.    Avatar Verification    1.4.2
4.    SMF 1.1.14 Update    1.0
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 29, 2011, 06:46:03 IP
Mind downloading and attaching Themes/default/BoardIndex.template.php? I'm curious as to that file. And yeah, I remember you! :) None of those mods should be affecting what you are seeing.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 29, 2011, 07:16:55 IP
Mashby,

I don't see the board index. I have the "index template".

And I don't know how to  download that. I could copy and paste.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 29, 2011, 07:24:22 IP
Are you using FTP?
How do I use FTP? / What is FTP? (http://wiki.simplemachines.org/smf/How_do_I_use_FTP)
That will help quite a bit. Editing files from within SMF is troublesome at best. :)
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 29, 2011, 07:29:42 IP
Oh brother--not this again.  I have to remember how to do that. I will get back with you as soon as I can remember how to do this.. :)

Trying to attach file. See attached. Hope this works.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: Illori - elokuu 30, 2011, 07:39:41 IP
that is your index.php file you were going to attach your index.template.php file which would be in your themes/<themename> folder
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 30, 2011, 07:42:41 IP
Actually we will need to see the BoardIndex.template.php file. That should tell us what is being displayed there in the info center.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 30, 2011, 09:05:08 IP
Thank you.

I am trying to find this file and I am trying to get help from Bluehost. They are saying the index.php is the right one and that is the one I sent, but that doesn't look right.

All I see on the server is the index.php and another similar with index.php~

Can I just copy and paste and if so-- what line should I start on?
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 30, 2011, 09:06:51 IP
Look in Themes/default/
Those will be folders in FTP.
Inside there you should see BoardIndex.template.php. Download that to your computer and attach it here.
:)
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 30, 2011, 09:48:51 IP
I think I have it!  I hope!

Found the index.template.php

Could not find the board index.

JUST Found the board index!   Will attach.

Please see attached.
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 30, 2011, 10:10:01 IP
You sure do have it. The file you attached looks fine to me. Next thing to look at is Sources/BoardIndex.php. Mind having a fun time finding that one and attaching to a reply? You'll get some good practice on FTP. I am still not positive that the next requested file is the culprit, but it's worth looking at. This bunch of stuff is where mostOnlineToday is generated:
// Track most online statistics?
if (!empty($modSettings['trackStats']))
{
// Determine the most users online - both all time and per day.
$total_users = $context['num_guests'] + $context['num_users_online'];

// More members on now than ever were?  Update it!
if (!isset($modSettings['mostOnline']) || $total_users >= $modSettings['mostOnline'])
updateSettings(array('mostOnline' => $total_users, 'mostDate' => time()));

$date = strftime('%Y-%m-%d', forum_time(false));

// One or more stats are not up-to-date?
if (!isset($modSettings['mostOnlineUpdated']) || $modSettings['mostOnlineUpdated'] != $date)
{
$request = db_query("
SELECT mostOn
FROM {$db_prefix}log_activity
WHERE date = '$date'
LIMIT 1", __FILE__, __LINE__);

// The log_activity hasn't got an entry for today?
if (mysql_num_rows($request) == 0)
{
db_query("
INSERT IGNORE INTO {$db_prefix}log_activity
(date, mostOn)
VALUES ('$date', $total_users)", __FILE__, __LINE__);
}
// There's an entry in log_activity on today...
else
{
list ($modSettings['mostOnlineToday']) = mysql_fetch_row($request);

if ($total_users > $modSettings['mostOnlineToday'])
trackStats(array('mostOn' => $total_users));

$total_users = max($total_users, $modSettings['mostOnlineToday']);
}
mysql_free_result($request);

updateSettings(array('mostOnlineUpdated' => $date, 'mostOnlineToday' => $total_users));
}
// Highest number of users online today?
elseif ($total_users > $modSettings['mostOnlineToday'])
{
trackStats(array('mostOn' => $total_users));
updateSettings(array('mostOnlineUpdated' => $date, 'mostOnlineToday' => $total_users));
}
}
Of particular note is the first part:
if (!empty($modSettings['trackStats']))In Admin > Features and Options, is Track daily statistics checked on your site?
index.php?action=featuresettings
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 30, 2011, 10:31:05 IP
Uh, I'm not sure how to tell you this-- but no, I didn't have "track daily statistics" checked. It was unchecked. I just checked it and now it looks all good.

It is matching up now. But I do have some other issues, which might mean I need to start a new thread.

I am going to try to find that sources/boardindex for practice. But it might take me days to find that. I will try and see.
But, Do you think all is good now?

I think I found the board index under Sources. Is this right? See attached. If so, I am getting real good! :)
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 30, 2011, 10:33:30 IP
Yep. That box being unchecked meant that the last time that box was checked, 15 users was the most online today at that time. I can tell you have it checked now as I see 24 at this point in time. Don't spend any more days looking for that file, but feel free to mark this topic solved and create a new one with any other issues you may have. I bet we'll get you sorted. :)
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 30, 2011, 10:41:16 IP
Thanks Mashby!

But wait-- will you look and see if I found the right file that you were asking for? I just modified my post and added it as an attachment.

I went to sources and found a board  index. Wanting to make sure I got that right. Thanks so much!
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: mashby - elokuu 30, 2011, 10:44:20 IP
You sure did find and attach the right file. But after I looked at mine, that's when I realized the issue wasn't really with any of the files, but rather just that one check box. The bright side of all of this is two fold:
1. You now have a dynamic Most Online Today stat.
2. You are much more familiar with FTP which is way more important.
I applaud you! :)
Otsikko: Re: USERS ONLINE & MOST ONLINE is not accurate--How do I fix it?
Kirjoitti: ohhhdear - elokuu 30, 2011, 10:47:12 IP
Thank you so much!

Wow! I can't believe I am learning this ftp thingie.

Thanks so much for your help.