Hide bots

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
jugoncan
Registered User
Posts: 9
Joined: Sat Nov 10, 2007 10:23 am
Location: Sevilla - España
Contact:

Hide bots

Post by jugoncan »

Hello
I want to hide the bots in my phpbb3 forum, I don't want that they appear in the users online list, but I want that they are actives.
Thanks.

Sorry if you don't understand me, but I'm Spanish :roll:
Last edited by pentapenguin on Mon Mar 31, 2008 5:00 pm, edited 1 time in total.
Reason: Topic icon changed
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: Hide bots

Post by Raimon »

Open: includes/functions.php

search:

Code: Select all

    $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
                            $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;    
replace with:

Code: Select all

    if ($row['user_type'] <> USER_IGNORE)
                            {
                            $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
                            $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
                            }
                            else 
                            {
                                $user_online_link = '';
                                $online_userlist .= '';
                            }    
will hide the bots on the viewonline legend.
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!
jugoncan
Registered User
Posts: 9
Joined: Sat Nov 10, 2007 10:23 am
Location: Sevilla - España
Contact:

Re: Hide bots

Post by jugoncan »

Thanks, it works perfectly ;)
coffeetalkforums.com
Registered User
Posts: 100
Joined: Mon Feb 04, 2008 9:45 pm

Re: Hide bots

Post by coffeetalkforums.com »

Works perfectly! Thank you so much for this :D
Ciao121
Registered User
Posts: 239
Joined: Wed Jan 28, 2004 1:08 pm

Re: Hide bots

Post by Ciao121 »

It works but if there is 1 registered user and 1 bot connected it shows only 1 username but the number of registered users online is 2... any idea how to correct this?
Apri il tuo forum gratuito in 1 minuto.
Tarabass
Registered User
Posts: 44
Joined: Mon Mar 31, 2008 7:45 pm
Location: Elburg, Gelderland, The Netherlands
Contact:

Re: Hide bots

Post by Tarabass »

Ciao121 wrote:It works but if there is 1 registered user and 1 bot connected it shows only 1 username but the number of registered users online is 2... any idea how to correct this?
A hidden user is also counted. So this does exactly what it must do.

Thanks for the snippet mate!!

It is also possible to hide bots only for guests and registered users, so that admins and moderators can see the bots online..

Find this in includes/functions.php

Code: Select all

if (($row['session_viewonline']) || $auth->acl_get('u_viewonline'))
Replace is with this

Code: Select all

if (($row['session_viewonline'] || $auth->acl_get('u_viewonline')) && $row['user_type'] <> USER_IGNORE) 
Cheers :ugeek:
Ciao121
Registered User
Posts: 239
Joined: Wed Jan 28, 2004 1:08 pm

Re: Hide bots

Post by Ciao121 »

Tarabass wrote:A hidden user is also counted. So this does exactly what it must do.
Thanks for the snippet mate!!
Right now I have 19 conected users: 11 registered users, 0 hidden and 8 guest.
The user's list shows 9 usernames.
Apri il tuo forum gratuito in 1 minuto.
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Hide bots

Post by Eelke »

Tarabass wrote:A hidden user is also counted. So this does exactly what it must do.
Well, it's what it does for any hidden user, so the modification listed above is apparently hiding bots correctly. Whether hidden users should be counted... not entirely sure about that. It's like telling people to go hide in the woods, but they should always carry a flag so you can still see they are there... Anyway, that's a different matter.
David Sims
Registered User
Posts: 112
Joined: Fri Apr 25, 2008 12:26 am

Re: Hide bots

Post by David Sims »

Raimon wrote:Open: includes/functions.php
I cannot find where this is. Any pointers for a relative newbie please?
David
My board > http://www.mgs2000.co.uk < many thanks for all of your help & assistance!
Ciao121
Registered User
Posts: 239
Joined: Wed Jan 28, 2004 1:08 pm

Re: Hide bots

Post by Ciao121 »

Maybe I misundersttod something.. but

19 conected users: 11 registered users, 0 hidden and 8 guest.
I should see 11 usernames.

I only see 9. I think this is because there are 2 spiders hidden from the usernames but not in the counter showing 11 registered / 0 hidden (I think it should be 9 registered, 2 hidden....)
Apri il tuo forum gratuito in 1 minuto.
ithica
Registered User
Posts: 24
Joined: Fri Apr 25, 2008 4:28 pm
Location: Round Rock, TX
Contact:

Re: Hide bots

Post by ithica »

you uploaded the "includes" folder to your host or server, in that folder is "functions.php", thats what you open with a text editor probably provided by your host.
David Sims
Registered User
Posts: 112
Joined: Fri Apr 25, 2008 12:26 am

Re: Hide bots

Post by David Sims »

Thanks, I'll give it a go tomorrow as it's a little late now to start doing that kind of task!

I'll let you know how I get on. ;)
David
My board > http://www.mgs2000.co.uk < many thanks for all of your help & assistance!
twodayslate
Registered User
Posts: 210
Joined: Mon Jan 22, 2007 11:27 pm

Re: Hide bots

Post by twodayslate »

Code: Select all

I believe you meant:
if ($row['session_viewonline'])
not
if (($row['session_viewonline']) || $auth->acl_get('u_viewonline'))


if (($row['session_viewonline']) || $auth->acl_get('u_viewonline')) wasn't in my functions.php
Will post if I find any other errors or bugs. Very nice though.
twodayslate WPblog | PbGunTrader The Paintball Buy, Sell, Trade | DreamHost Quality Hosting
formmailer
Registered User
Posts: 11
Joined: Tue Apr 29, 2008 4:17 pm

Re: Hide bots

Post by formmailer »

Ciao121 wrote:Maybe I misundersttod something.. but

19 conected users: 11 registered users, 0 hidden and 8 guest.
I should see 11 usernames.

I only see 9. I think this is because there are 2 spiders hidden from the usernames but not in the counter showing 11 registered / 0 hidden (I think it should be 9 registered, 2 hidden....)
I must say that what you are saying makes sense to me. As far as I know are registred users who log in with a hidden status usually not counted as registred users, but as hidden users. Are we wrong in this?
formmailer
Registered User
Posts: 11
Joined: Tue Apr 29, 2008 4:17 pm

Re: Hide bots

Post by formmailer »

Tarabass wrote:It is also possible to hide bots only for guests and registered users, so that admins and moderators can see the bots online..

Find this in includes/functions.php

Code: Select all

if (($row['session_viewonline']) || $auth->acl_get('u_viewonline'))
Replace is with this

Code: Select all

if (($row['session_viewonline'] || $auth->acl_get('u_viewonline')) && $row['user_type'] <> USER_IGNORE) 
I can't find the first code snippet either, but I also doubt if the second snipped is okay, since it has ) at the end, but I don't see the ( .
Locked

Return to “[3.0.x] Support Forum”