Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: SDMCC on September 13, 2013, 02:36:09 PM

Title: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 13, 2013, 02:36:09 PM
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.

Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on September 13, 2013, 02:39:29 PM
you would need to edit who.php or maybe who.template.php
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 13, 2013, 03:24:14 PM
I edited the who.template.php by removing all the guests references (3) but it made no difference.  :(
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on September 13, 2013, 03:26:56 PM
did you clear your forum cache after changing the template file?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 14, 2013, 06:56:15 AM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: mashby on September 14, 2013, 06:55:51 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 15, 2013, 11:15:14 AM
Unfortunately I can't find Sources/Subs-MembersOnline.php or anything similar.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: mashby on September 15, 2013, 11:25:31 AM
Where are you looking?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 15, 2013, 03:05:56 PM
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
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: mashby on September 15, 2013, 03:10:49 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on September 15, 2013, 03:32:25 PM
I will go into the file manager.
I have always taken the precaution of copying and pasting what I am about to modify.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: ziycon on October 10, 2013, 06:27:42 AM
Did you get what you wanted done?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on October 10, 2013, 11:37:03 AM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on October 29, 2013, 02:12:54 PM
Were you able to find the file Sources/Subs-MembersOnline.php  in your Sources directory?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on October 29, 2013, 02:21:33 PM
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.  :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Oldiesmann on October 29, 2013, 02:23:02 PM
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 ;)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on October 29, 2013, 03:52:53 PM
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'];

Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on October 29, 2013, 03:56:02 PM
http://us2.php.net/echo
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle 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.

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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 03, 2013, 04:41:39 AM
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?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on November 03, 2013, 07:44:03 AM
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)....
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 03, 2013, 12:01:39 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: 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.

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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 03, 2013, 01:18:28 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on November 04, 2013, 10:34:50 AM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Arantor on November 04, 2013, 10:58:57 AM
I thought you had to use index.php?action=who;show_top=members
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on November 12, 2013, 09:57:22 AM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 12, 2013, 11:29:10 AM
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?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Arantor on November 12, 2013, 11:30:33 AM
As opposed to doing what we suggested that would just convert the link to that page into pointing to the Members Only item anyway...?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on November 12, 2013, 12:24:23 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Arantor on November 12, 2013, 12:35:45 PM
Sorry, that was from debugging.

http://www.simplemachines.org/community/index.php?action=who;show=members consistently goes to members only (notice: show not show_top)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 12, 2013, 01:13:05 PM
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".

:)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on November 12, 2013, 01:24:06 PM
Quote from: Arantor on November 12, 2013, 12:35:45 PM
http://www.simplemachines.org/community/index.php?action=who;show=members

Aye.  Thanks.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 15, 2013, 01:48:17 PM
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.


Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 02:15:34 PM
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...
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 02:20:33 PM
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...
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 02:39:56 PM
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>
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 02:43:37 PM
Nope. Brain's fried. Let's hope someone can put me out of my misery.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: 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';
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 03:13:16 PM
:) Ta, Oldies!
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 15, 2013, 03:20:19 PM
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.   ;)

Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 15, 2013, 03:26:30 PM
Just in case you're not familiar with the terminology, he means that Who.php is in the "sources" directory. ;)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 15, 2013, 05:33:03 PM
Thanks for  that extra bit of info Kindred.  :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on November 15, 2013, 05:47:53 PM
I think you mean K@....   :P

I've got a red badge, he's got a green one... lol
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 16, 2013, 03:04:43 AM
Oh dear, another mistake.  ;)  ;D
Sorry K@   :-[
Sorry Kindred  :-[
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 16, 2013, 05:42:22 AM
No sweat, mate! :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Kindred on November 16, 2013, 08:51:20 AM
no worries :D
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 17, 2013, 11:14:31 AM
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.   :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 17, 2013, 12:05:17 PM
I'm a bit busy, today, doing the ol' "Ferry the demented mother-in-law around the country doing Christmas crap" thing, today. (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.katzy.dsl.pipex.com%2FSmileys%2Frollseyes.gif&hash=0c56a4703040798386c5cc96680c3d3290e8afe7)

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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle 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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 19, 2013, 03:32:44 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: Angelina Belle on November 19, 2013, 04:14:15 PM
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.
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 21, 2013, 01:21:21 PM
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?  :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 28, 2013, 02:37:19 PM
Apologies. I forgot about this one.

However... I really can't see why the edit that Oldies suggested didn't work. :(
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 28, 2013, 05:11:06 PM
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?
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 28, 2013, 05:15:11 PM
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. :)
Title: Re: I want to remove Guests showing in Users Online > Users
Post by: SDMCC on November 28, 2013, 05:44:35 PM
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.  :)

Title: Re: I want to remove Guests showing in Users Online > Users
Post by: kat on November 29, 2013, 08:30:46 AM
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.