News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

I want to remove Guests showing in Users Online > Users

Started by SDMCC, September 13, 2013, 02:36:09 PM

Previous topic - Next topic

SDMCC

Regarding the feature at the bottom of the Board Index page is Users Online and beneath that is Users, I only have Users showing, Guests have been removed with a mod.

When I click on Users to see who is online, there will be the users showing but there will also be offline guests/spambots showing.
How can stop showing these guests showing as they are affecting the user count.

I have no need for guests, this small forum is totally private and always will be.


Kindred

you would need to edit who.php or maybe who.template.php
Сл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."

SDMCC

I edited the who.template.php by removing all the guests references (3) but it made no difference.  :(

Kindred

did you clear your forum cache after changing the template file?
Сл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."

SDMCC

It's probable that I didn't remove all of the intricacy's of the guest codes, what exactly has to be removed, there are so many, commas, brackets etc.
At my next attempt I will clear the cache first.

mashby

I think you'll want to be looking in Sources/Subs-MembersOnline.php instead. That's where the fun is I'm thinking.
Line 58:
'num_guests' => 0,

Lines 93 and 94:
// Guests are only nice for statistics.
$membersOnlineStats['num_guests']++;


I'm not sure what you're removing exactly, but I think the above is what is making guests appear in the info center.
Always be a little kinder than necessary.
- James M. Barrie

SDMCC

Unfortunately I can't find Sources/Subs-MembersOnline.php or anything similar.

mashby

Always be a little kinder than necessary.
- James M. Barrie

SDMCC

Modify themes and then Browse the templates and files in this theme, there are 3 themes
1) SMF Default Theme - Curve (2.0)
2) Core Theme (2.0) 
3) OmegaRedish

mashby

I don't recommend using that interface...there isn't an Undo option there. A misplaced ; or an open }, and then what? :)

You should really be using SMF or File Manager. And Notepad++ or something similar to edit your files.
Always be a little kinder than necessary.
- James M. Barrie

SDMCC

I will go into the file manager.
I have always taken the precaution of copying and pasting what I am about to modify.

ziycon


SDMCC

I have managed to stop guests affecting the user count thank you, but what I really want is not to have any guests showing in the Who's Online feature.

Angelina Belle

Were you able to find the file Sources/Subs-MembersOnline.php  in your Sources directory?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

I did attempt find the file Sources/Subs-MembersOnline.php but I couldn't,  :( however I intend to try again later when my brain is up to it.  :)

Oldiesmann

There's actually a hidden feature in SMF that will allow you to only see members, so it might be easier to just change that link in the template. Just add ";members" after "action=who" in the URL and SMF won't show you guests ;)
Michael Eshom
Christian Metal Fans

SDMCC

I have found the required text in the Board Index Template, see below. However I have 2 groups the same, is it to do with the word 'echo' as 'echo' appears twice as well, what does this 'echo' mean? I have seen it lots of times before.

Not quite sure what to do regarding inserting members, do I make ?action=who">' into ?action=who members">'

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

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


Kindred

Сл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."

Angelina Belle

SDMCC,

Now that you have read what the echo statement does, it should be a little bit easier to understand Oldiesmann's instructions.

Change ?action=who" to ?action=who;members

The ; is crucial to constructing the URL; a space cannot do the job.

I hope that helps. Doing this kind of customization before you have reached a certain level of proficiency with php and HTML is tough going, but don't despair.  You can learn a lot doing a simple project like this.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

Quote from: AngelinaBelle on October 31, 2013, 04:42:22 AM
SDMCC,
Now that you have read what the echo statement does, it should be a little bit easier to understand Oldiesmann's instructions.
It should be a little bit easier if I could understand it though.  ;D

Thank you very much AngelinaBelle, I did as instructed regarding the Users Online feature, however when I click on User/Users to check who is watching the forum I still get some guests showing up.
There is an improvement most of the time but then all of sudden I get a bunch of guests.
Is there something else I should be doing?

Advertisement: