Hi,
I noticed that the statistics "Most Online Ever" and "Most Online Today" does not work.
For example, for "Most Online Today" I always have a number: 1768 and so every day. Does anyone know why I have this problem and how to fix it?
I leave my "BoardIndex.template.php" in attach.
Do you have a url? any mods installed? How long has it been that way?
Lainaus käyttäjältä: vbgamer45 - huhtikuu 21, 2020, 08:16:57 IP
Do you have a url? any mods installed? How long has it been that way?
For a long time, that's how it stands. I sent the link from the forum via PM message.
Stats turned off?
Lainaus käyttäjältä: drewactual - huhtikuu 21, 2020, 10:08:08 IP
Stats turned off?
I don't know if it is Stats turned off. How can I see this?
admin>configuration>features and options
check the box for 'enable who is online' and 'track daily stats'...
The stats OP is referring to are unaffected by those settings. Try Admin -> Forum Maintenance -> Recount all forum totals and statistics.
To track stats it has to be on.
Hmm, looks like 'Enable who's online list' just adds link next to 'Users Online' to view detailed list. 'Track daily statistics' doesn't seem to change anything, but 'Most Online Today' and 'Most Online Ever' shouldn't be displayed if they're not being tracked.
Doesn't look like that info is conditional on stats setting -
echo '
</p>
<p class="last smalltext">
', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
</p>';
It's displayed either way, so it should be tracking.
One odd thing, I'm not seeing the PM bar when logged in with stats disabled -
// If they are logged in, but statistical information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_stats_index'])
I know it works because I was asked to remove it on one forum, but not seeing it in test install.
Lainaus käyttäjältä: Sir Osis of Liver - huhtikuu 22, 2020, 10:55:30 IP
'Track daily statistics' doesn't seem to change anything, but 'Most Online Today' and 'Most Online Ever' shouldn't be displayed if they're not being tracked.
If the setting ever was enabled, when turning it off, the old values will not be cleared and/or hidden. Instead, the old values will be displayed forever. Which is exactly what drewactual was referring to.
Doesn't make sense to keep displaying old values, seems simple enough to make it conditional on stats setting. Wonder why it wasn't done that way?
I don't know. It might be tracked as a 2.1 bug somewhere; don't know about 2.0.x tho.
AFAIK it was never reported as a bug, but I believe it's come up in support several times. Seems to be a simple thing to fix.
Lainaus käyttäjältä: drewactual - huhtikuu 22, 2020, 08:13:33 IP
admin>configuration>features and options
check the box for 'enable who is online' and 'track daily stats'...
Thank you, my option was off. Now I turned it on and everything is working properly.
On the moment I turned off the option, the numbers remained from that moment, why? I don't know, maybe a bug.
My forum is on 2.0.15
Glad you have it working! Simple fix. I agree with that information being not shown if the setting is disabled.
Unfortunately, it shows numbers from the moment the option is off.
Thank you all for your help.
until the stats CHANGE, it's not going to update....
That's not the issue. If stats are disabled, it continues to display the last numbers indefinitely. Shouldn't be displayed at all until stats are re-enabled.
that's a SEPARATE issue.... now that the OP has turned Stats ON, they will not change until a different value is recorded.
Lainaus käyttäjältä: Kindred - huhtikuu 24, 2020, 12:31:47 IP
that's a SEPARATE issue....
Ok, yes. But why hasn't this been fixed?
Are we sure it's broken?
Lainaus käyttäjältä: Sir Osis of Liver - huhtikuu 24, 2020, 12:30:21 IP
That's not the issue. If stats are disabled, it continues to display the last numbers indefinitely. Shouldn't be displayed at all until stats are re-enabled.
If it's not a BUG then fine.
Anyway my stats are working now. :)
Lainaus käyttäjältä: Arantor - huhtikuu 24, 2020, 12:45:12 IP
Are we sure it's broken?
Actually, no. This is another one of those irritating little things that, for reasons unknown, was apparently done by design. It doesn't make sense to display those stats if they're not being updated, they're meaningless, and it's a simple fix to hide them if stats are disabled.
Lainaus käyttäjältä: Sir Osis of Liver - huhtikuu 24, 2020, 08:55:12 IP
Lainaus käyttäjältä: Arantor - huhtikuu 24, 2020, 12:45:12 IP
Are we sure it's broken?
Actually, no. This is another one of those irritating little things that, for reasons unknown, was apparently done by design. It doesn't make sense to display those stats if they're not being updated, they're meaningless, and it's a simple fix to hide them if stats are disabled.
I completely agree with you. If the statistics are off then SMF should not show Most Online Today: same number all days.
Regards.
I could see it being beneficial for admin/owner/manager having access or visibility of stats, and while not showing them to everyone/anyone...
It 'could' be a simple mod with "is admin" type conditional. Presumably, it would free up some resources too, except for the admin. I say that not knowing how hungry that function (stats) is.
As it is: Changing the template is easy enough, or adding a conditional... hiding with css can work, and if done with a html comment tag, would still be visible to anyone going through the trouble of viewing source... of these numbers are something an admin is concerned about it but doesn't feel need to shout about ..
There is a bunch of directions to go if its that great a concern. I agree that if its "off" then it likely shouldn't be shown... but that is yet another server call and yet another millisecond or so (being goofy.... somewhat)... so.... carve it out of the template and source code if it isn't being used... AND you don't anticipate using it.
Thing is, though, a lot of forum users are used to seeing these kinds of things shared.. not all, but some users... let's say 25%... so when they don't see it they may get a wrong impression? Or... maybe not... point is: it isn't a big deal one way or another..
>:( Why doesn't this work?
if ($settings['show_stats_index'])
echo '
</p>
<p class="last smalltext">
', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
</p>';
Slap an elseif after it void of the text calls and it should?
Thought of that but didn't try it, shouldn't be necessary should it? I'll have a look.
Nope, that's not it. It either shows it or doesn't show it, regardless of setting. Maybe it's linked to another setting.
Which setting do you think you've connected it to? So far you've connected it to a theme setting about showing the stats, not the $modSettings entry to disable it.
Well, yes, I'm using $settings['show_stats_index'] to try to remove it when Track daily statistics is disabled. But it either removes it from the theme or displays it with either option checked, so it's the wrong setting. Looks like the correct setting in db is trackStats, but that apparently isn't $settings['show_stats_index'].
No, it isn't. It's $modSettings['trackStats'].
Yep, just got it -
if ($modSettings['trackStats'])
echo '
</p>
<p class="last smalltext">
', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
</p>';
Thanks.
So it is simple to fix, that was my point.