News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Most Online Ever and Most Online Today does not work

Started by Cola-Coca, April 21, 2020, 06:50:32 PM

Previous topic - Next topic

Cola-Coca

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.
I LOVE SMF

vbgamer45

Do you have a url? any mods installed?  How long has it been that way?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Cola-Coca

Quote from: vbgamer45 on April 21, 2020, 08:16:57 PM
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.
I LOVE SMF


Cola-Coca

I LOVE SMF

drewactual

admin>configuration>features and options

check the box for 'enable who is online' and 'track daily stats'...

Sir Osis of Liver

The stats OP is referring to are unaffected by those settings.  Try Admin -> Forum Maintenance  -> Recount all forum totals and statistics.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual


Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

m4z

Quote from: Sir Osis of Liver on April 22, 2020, 10:55:30 PM
'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.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Sir Osis of Liver

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?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

m4z

I don't know. It might be tracked as a 2.1 bug somewhere; don't know about 2.0.x tho.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Cola-Coca

Quote from: drewactual on April 22, 2020, 08:13:33 PM
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
I LOVE SMF

vbgamer45

Glad you have it working! Simple fix.  I agree with that information being  not shown if the setting is disabled.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Cola-Coca

Unfortunately, it shows numbers from the moment the option is off.

Thank you all for your help.
I LOVE SMF

Kindred

until the stats CHANGE, it's not going to update....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

that's a SEPARATE issue....   now that the OP has turned Stats ON, they will not change until a different value is recorded.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor


Cola-Coca

Quote from: Sir Osis of Liver on April 24, 2020, 12:30:21 PM
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.  :)
I LOVE SMF

Sir Osis of Liver

Quote from: Arantor on April 24, 2020, 12:45:12 PM
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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Cola-Coca

Quote from: Sir Osis of Liver on April 24, 2020, 08:55:12 PM
Quote from: Arantor on April 24, 2020, 12:45:12 PM
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 LOVE SMF

drewactual

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..

Sir Osis of Liver

  >:( 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>';


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual

Slap an elseif after it void of the text calls and it should?

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

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.

Sir Osis of Liver

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'].


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor


Sir Osis of Liver

#32
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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: