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?

Kindred

SDMCC,
DO NOT delete a post and then repost the same thing just to bump a thread (but try to make it LOOK like you did not)....
Сл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

How dare you to talk to me like that.  >:(
Let's get thing one thing straight, I did not delete the post and repost it to bump a thread, it's not in my nature to do or even think of such a thing.
I realized I had made a silly mistake (a senior moment) and put a reply post in the wrong topic and I then reposted in the correct topic, I currently have more than one topic in this forum.
I made a mistake, have you never made a mistake, maybe not because you are an expert, certainly not an expert in manners though.

Kindred

actually, the delete logs show exactly what you deleted.....   
yes you posted one answer in the incorrect thread. However, you ALSO posted the content here and then deleted THAT and reposted the one above.

As for manners... I merely told you not to do something. I was not insulting or rude about it. If you found my post insulting or rude, then I recommend leaving the internet, since, if you stay on, you'll have to deal with others who will be ACTUALLY insulting or rude.
Сл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

Quote from: Kindred on November 03, 2013, 12:59:03 PM
actually, the delete logs show exactly what you deleted.....   
yes you posted one answer in the incorrect thread. However, you ALSO posted the content here and then deleted THAT and reposted the one above.
I will say it again, I made a mistake, a mistake, a mistake, I got mixed up, I am not an expert, doing this sort of stuff is difficult.

Quote
As for manners... I merely told you not to do something. I was not insulting or rude about it. If you found my post insulting or rude, then I recommend leaving the internet, since, if you stay on, you'll have to deal with others who will be ACTUALLY insulting or rude.
Earlier you said "but try to make it LOOK like you did not" I call that rude, questioning my honesty. I have been on he internet a long while and this first time I have had to respond in this manner.

Angelina Belle

SDMCC,

I am sorry to hear you had a misunderstanding above.  Frequently, people do exactly what you were accused of, simply to get their topics bumped up to the top of the forum and attract more attention.  It is an understandable misunderstanding.

I just tested out what Oldiesmann suggested right here are SimpleMachines.org

http://www.simplemachines.org/community/index.php?action=who;members

Interestingly, I also found many, many, many guests listed.  Fewer than when I did http://www.simplemachines.org/community/index.php?action=who

I suspect that the ;members does not actually give a list of only members online.
I am not sure what ;members is supposed to do.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Arantor

I thought you had to use index.php?action=who;show_top=members

Angelina Belle

Interestingly, just testing that here, I see a long list of Guest unless I use the drop-down to show only members.
There seems to be more to it than just the query-string.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

This might be an easier solution, of course I don't how to do I though.  ;)  ;D

Info Centre – Users Online, when we click on the Users or User we then get the users who on line, at the far bottom right there is the little drop down menu – Show – Everyone/Members Only/Guests Only.

Would it be possible to just disable/modify Everyone or Guests Only and just leave Members Only, or maybe somehow lock Members Only?

Arantor

As opposed to doing what we suggested that would just convert the link to that page into pointing to the Members Only item anyway...?

Angelina Belle

Can we do that? index.php?action=who;show_top=members  does not show "members only", unless you select "members only" from the drop-down.


For example, at http://www.simplemachines.org/community/index.php?action=who;show_top=members , by default, shows me everyone.
After I select "members only", then I see only members forever after, unless I again make a selection from the drop-down.
Similarly, If I select "guest only", that's what I see forever after; these query-string options do not seem to enforce "member only" behavior.

I assume this choice is stored in my cookie.

If I log out, then log back in again, http://www.simplemachines.org/community/index.php?action=who;show_top=members  goes back to showing me the default -- everyone -- both members and guests.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Arantor


kat

Just an aside... (I may be WAAAAY wrong, here)

If you don't need guests around, why not prevent them from even accessing the board?

If that'd do the job, go to Admin>Features and options and deselect "Allow guests to browse the forum".

:)

Angelina Belle

Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

What with one thing and another and some hosting issues I have only just been able to use the file manager. 
I have made the changes as suggested by Arantor and yourself, it did something but not enough.

Just below the Users Online banner, as is normal it  used to show the number of members and the number of guests online.

The good news is it now only shows the number of members, the guests are gone.

The bad news is that when I click on 'User' to see who is online it still shows guests.

I suppose it shows these unwanted guests about 50% of the time I visit Users Online.

Any more ideas how to get rid of these pesky guests please.



kat

Do you mean on this page?

http://www.simplemachines.org/community/index.php?action=who

If so, there's a selector wotist, where you can select "Everyone", "Members only", or "Guests" only.

So, I would assume that "Members only" could be the default setting and "Guests" could be removed from that list.

I'll see if I can figure-out how to do that...

kat

OK. I've figured-out the file.

I suspect that it's this bit, of Who.template.php:

<div class="selectbox floatright">', $txt['who_show1'], '
<select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';

foreach ($context['show_methods'] as $value => $label)
echo '
<option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
echo '
</select>
<noscript>
<input type="submit" name="submit_top" value="', $txt['go'], '" class="button_submit" />
</noscript>
</div>
</div>
<table class="table_grid" cellspacing="0">
<thead>
<tr class="catbg">
<th scope="col" class="lefttext first_th" width="40%"><a href="', $scripturl, '?action=who;start=', $context['start'], ';show=', $context['show_by'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '" rel="nofollow">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th scope="col" class="lefttext" width="10%"><a href="', $scripturl, '?action=who;start=', $context['start'], ';show=', $context['show_by'], ';sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '" rel="nofollow">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th scope="col" class="lefttext last_th" width="50%">', $txt['who_action'], '</th>
</tr>
</thead>
<tbody>';


Now, let me try a bit of the ol' "Trial and error", to see if I can figure this out...

kat

Grrr! I can't figure-out where, nor how "show=user" is defined.

The default seems to be "show=all" and we need to change that.

I can't check this, unfortunately. But, I think that getting rid of this, removes the selector, which is a start, I guess. Got to figure-out where to change the default setting of "all", now.

<div class="selectbox floatright">', $txt['who_show1'], '
<select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';

foreach ($context['show_methods'] as $value => $label)
echo '
<option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
echo '
</select>
<noscript>
<input type="submit" name="submit_top" value="', $txt['go'], '" class="button_submit" />
</noscript>
</div>

kat

Nope. Brain's fried. Let's hope someone can put me out of my misery.

Oldiesmann

Sources/Who.php

Find
$context['show_by'] = $_SESSION['who_online_filter'] = 'all';

Replace
$context['show_by'] = $_SESSION['who_online_filter'] = 'users';
Michael Eshom
Christian Metal Fans


SDMCC

Thanks Oldiesmann.  :)

The trouble is I tried to find sources/Who.php a while ago, but couldn't.  :(

However I'm older by a couple of weeks now and maybe wiser, I'll try to find it again tomorrow.   ;)


kat

Just in case you're not familiar with the terminology, he means that Who.php is in the "sources" directory. ;)

SDMCC


Kindred

I think you mean K@....   :P

I've got a red badge, he's got a green one... lol
Сл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

Oh dear, another mistake.  ;)  ;D
Sorry K@   :-[
Sorry Kindred  :-[


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

SDMCC

Quote from: Oldiesmann on November 15, 2013, 03:09:48 PM
Sources/Who.php

Find
$context['show_by'] = $_SESSION['who_online_filter'] = 'all';

Replace
$context['show_by'] = $_SESSION['who_online_filter'] = 'users';

Unfortunately the above did not work.

I also tried putting in 'members' as well as 'users' but still no luck.  :(
I checked and double checked I did it correct and I am sure I have.

Any more ideas please.   :)

kat

I'm a bit busy, today, doing the ol' "Ferry the demented mother-in-law around the country doing Christmas crap" thing, today.

Just had a few minutes to nip in, to see what's been going on.

If you don't get any response, before then, I'll have a fiddle-around, on the morrow, to see what I can figure out.

Angelina Belle

SDMCC,

Did you try logging out and logging back in while testing that?  I get the idea that there is a cookie involved somewhere.  If this change corrects it, you might need a new cookie.  If not, it would be necessary to learn more about hunting down that value and getting it out of the cookie.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

Quote from: AngelinaBelle on November 19, 2013, 02:53:40 PM
SDMCC,

Did you try logging out and logging back in while testing that?  I get the idea that there is a cookie involved somewhere.  If this change corrects it, you might need a new cookie.  If not, it would be necessary to learn more about hunting down that value and getting it out of the cookie.

I'm not sure about that, I'll give it another go and log out and log back in while testing.

Angelina Belle

I often find it useful, if I have another brand of browser running on the same desktop, to fire up another user account to test stuff while I work.  Please let us know what you discover.  I hope someone will be able to help you sort this out.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

SDMCC

I have done as suggested (I think) but no luck I'm afraid.  :(

I made the changes using IE and then and then checked my efforts on Firefox, is that what you mean or should it be Firefox and the IE?  :)

kat

Apologies. I forgot about this one.

However... I really can't see why the edit that Oldies suggested didn't work. :(

SDMCC

Oh never mind it's not the end of world.  :)
I might post again some time in the future about it, but I don't want to appear to be bumping. Will that be okay?

kat

Yeah, for sure. People only get miffed, if you bump within twenty four hours.

I'll try it out, myself, on my test site, in the morning, to see what I can figure out. :)

SDMCC

Guests that have been assigned to show and are genuinely online are fine, it's those pesky 'ghost guests spambots', although they show as being offline they are still a nuisance and seem to upset the counter.  :)


kat

Ah. I was only thinking of removing the guests from the display. If you want rid of them, entirely, just prevent them from browsing the forum, as I described, above.

Advertisement: