Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: SDMCC on September 03, 2013, 09:40:39 AM

Title: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 03, 2013, 09:40:39 AM
Regarding the feature at the bottom of the Board Index page> 'Most Online Today: 7. Most Online Ever: 59 (June 07, 2013, 08:36:00 AM)'
How can I set the 59 back to zero?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Kindred on September 03, 2013, 12:22:05 PM
I do not think it can be easily accomplished...
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Arantor on September 03, 2013, 12:32:20 PM
Yay for direct changes to the database.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 04, 2013, 04:08:28 AM
So it's not possible then?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Burke ♞ Knight on September 04, 2013, 04:44:27 AM
I personally have no idea why you'd want to.
Me? I'd like to make all my sites show more. :)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Shambles on September 04, 2013, 04:47:00 AM
Quote from: SDMCC
So it's not possible then?

Yes, it's possible. The inference was that you need to do a direct update to the correct database table. You comfortable doing that, say, using phpMyAdmin (or equivalent)?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Acans on September 04, 2013, 04:50:10 AM
Quote from: Shambles on September 04, 2013, 04:47:00 AM
Yes, it's possible. The inference was that you need to do a direct update to the correct database table. You comfortable doing that, say, using phpMyAdmin (or equivalent)?

If you are, run this query:

UPDATE  `database_name`.`smf_settings` SET  `value` =  '0' WHERE  `smf_settings`.`variable` =  'mostOnline';

Remember to update database_name to whatever your database is called, and change smf_ if you choose a different prefix while installing SMF.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Arantor on September 04, 2013, 06:19:10 PM
Um, what is 20_settings and what does it have to do with `database_name`.`smf_settings` ? ;)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Burke ♞ Knight on September 04, 2013, 06:21:02 PM
Can't you just go into the database and set it to 0 from there?
If so, where is the Most Online located in the DB?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Acans on September 04, 2013, 11:18:14 PM
Woops, forgot to change 20 to smf :P

Quote from: BurkeKnight on September 04, 2013, 06:21:02 PM
Can't you just go into the database and set it to 0 from there?
If so, where is the Most Online located in the DB?

Yes you can do that too :)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Shambles on September 05, 2013, 03:00:42 AM
Quote from: BurkeKnight
If so, where is the Most Online located in the DB?
It's shown in ѕησω's post above.

{db_prefix}settings ("mostOnline","value")
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 06, 2013, 07:21:22 AM
If you are, run this query:
UPDATE  `database_name`.`smf_settings` SET  `value` =  '0' WHERE  `smf_settings`.`variable` =  'mostOnline';

So if put in the above code and change the 20 to 0 that will do it, yes?

How do I find where to put this in, the idiot guide please.

I cannot install phpMyAdmin (or equivalent)? What is the equivalent?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: margarett on September 06, 2013, 07:53:52 AM
You don't have phpmyadmin? Now that's strange...
You have to have a way to manage your databases, no?

What about FTP? If you cannot do it directly in MySQL, maybe using SSI. But that requires you to access your files
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 07, 2013, 03:42:08 AM
Quote from: margarett on September 06, 2013, 07:53:52 AM
You don't have phpmyadmin? Now that's strange...
You have to have a way to manage your databases, no?

What about FTP? If you cannot do it directly in MySQL, maybe using SSI. But that requires you to access your files
phpmy won't install.
I don't understand this "You have to have a way to manage your databases, no?"
How do I access the database to change it?
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Branko. on September 07, 2013, 04:35:38 AM
Your host account CPanel>phpmyadmin
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 09, 2013, 10:09:42 AM
Most Online Today: 6. Most Online Ever: 59.

Here is the code for Most Online Today and Most Online Ever, can you tell me please what I have to change to get both the 6 and the 59 back to zero.

</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>';
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Arantor on September 09, 2013, 10:10:26 AM
For the n'th time, it's NOT IN THERE. You have to change the database, changing the code will have precisely no effect.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 09, 2013, 10:38:11 AM
Calm down dear!  ;D
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: margarett on September 09, 2013, 10:39:05 AM
And, you still didn't tell us if you have FTP (or any kind of file manager) access to your files. Not to mention the direct access to the database...
You see, there are some ways to solve your problem, but we need to know what resources you can access...
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Arantor on September 09, 2013, 10:39:47 AM
I'll calm down when you listen to what's being said ;)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 09, 2013, 05:37:31 PM
Quote from: margarett on September 09, 2013, 10:39:05 AM
And, you still didn't tell us if you have FTP (or any kind of file manager) access to your files. Not to mention the direct access to the database...
You see, there are some ways to solve your problem, but we need to know what resources you can access...
A FTP account could be available for me to use.
I don't have any file manager.
I have tried using phpMyAdmin but is much to difficult.

Your advice is appreciated for this old man.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: margarett on September 09, 2013, 06:17:36 PM
phpmyadmin is not that difficult :P Come on...

If your database is named "smf2", and your table prefix is "smf205_" (mine is :P )
Look at the first image:
- open table "sfm205_settings" (1)
- click "Browse" (2)
- edit the row signalled in (3) so that all data in the table is sent at once. After this, press ENTER (will reload the table data)

After reloading, search for the 3 rows in the second image. Put "0" (without quotes) in all 3.

Txaram!!! :)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: Shambles on September 10, 2013, 03:03:01 AM
.. or just PM me your logon credentials and I'll do it for you.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 10, 2013, 06:02:41 AM
Thank you all for your patience here, particularly Shambles for offering to do it for me, and more so for Margarett for urging me to have a go, which I did most successfully by using the excellent instructions, thank you.

Is there a way by using phpMyAdmin to remove 'Guests'?
Near the bottom of the Board Index page is 'Users Online' with the amount of Guests and Users online, I want to remove the word Guests.
This small forum is totally private but I still get Guests showing as being online, we don't have Guests they are just irritating spambots.
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: margarett on September 10, 2013, 07:16:40 AM
Yes, you can.
But that's different (and should have its own topic, but who cares? :P )

Edit BoardIndex.template.php
and remove the "Guests" part from this:

', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

Change it to this:

', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '',comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: SDMCC on September 10, 2013, 07:59:49 AM
It worked just fine.
Thanks, thanks, thanks, thanks and thanks.  :)  :)  :)  :)  :)
Title: Re: Setting 'Most Online Ever' back to zero.
Post by: margarett on September 10, 2013, 08:08:27 AM
Mark it as solved, then ;)