Hide Memberlist but show Team and Who's online

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

ssl wrote: Tue Mar 05, 2024 6:29 pm Finally, at a given moment, users of a forum who do not have access to the list of members will not spend hours with our friend Google to get around the problem.
Because with your prohibition methods each user ID is listed in the code to prohibit access to the profile, imagine if this manipulation had to be done on this forum?
I was asking on technical aspect. Admin's user_id is usually 2. so I am just hiding profile of id number 2.
My question was whether its ok to change code like this. Will it affect somewhere else or not.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26702
Joined: Fri Aug 29, 2008 9:49 am

Re: Hide Memberlist but show Team and Who's online

Post by Mick »

It’ll affect you come update time, you’ll have to do it all again.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel©
🇬🇧
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Mick wrote: Tue Mar 05, 2024 7:00 pm It’ll affect you come update time, you’ll have to do it all again.
:shock: I need to keep the track.
Thank you.
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Need code to hide admin in who is online list, other than - Hide my online status this session - during login.
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide Memberlist but show Team and Who's online

Post by warmweer »

exemplary1 wrote: Thu Mar 07, 2024 12:43 pm Need code to hide admin in who is online list, other than - Hide my online status this session - during login.
admin= ? (someone with username "admin"? is not necessarily an administrator)
the founder only?
All members of the group Administrators?
+ there's the "last active" section in viewprofile which is updated regularly
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

warmweer wrote: Thu Mar 07, 2024 1:31 pm admin= ? (someone with username "admin"? is not necessarily an administrator)
the founder only?
All members of the group Administrators?
The founder, I have only one administrator account.
warmweer wrote: Thu Mar 07, 2024 1:31 pm + there's the "last active" section in viewprofile which is updated regularly
Is it visible anywhere ?

Btw, I have updated sql query in viewonline.php file ( using chatgpt ) to exclude admin from showing online.
the query is under // Whois requested

Code: Select all

$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
    FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
    WHERE s.session_id = '" . $db->sql_escape($session_id) . "'
    AND u.user_id = s.session_user_id
    AND u.user_type NOT IN (" . USER_FOUNDER . ", " . USER_IGNORE . ")";
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide Memberlist but show Team and Who's online

Post by warmweer »

exemplary1 wrote: Thu Mar 07, 2024 1:52 pm
warmweer wrote: Thu Mar 07, 2024 1:31 pm + there's the "last active" section in viewprofile which is updated regularly
Is it visible anywhere ?
Click on a username in the post_profile area.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

warmweer wrote: Thu Mar 07, 2024 1:58 pm Click on a username in the post_profile area.
Only if Admin has ever posted , right ?
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

exemplary1 wrote: Thu Mar 07, 2024 1:52 pm Btw, I have updated sql query in viewonline.php file ( using chatgpt ) to exclude admin from showing online.
the query is under // Whois requested

Code: Select all

$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
    FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
    WHERE s.session_id = '" . $db->sql_escape($session_id) . "'
    AND u.user_id = s.session_user_id
    AND u.user_type NOT IN (" . USER_FOUNDER . ", " . USER_IGNORE . ")";
This is not working though. Initially I thought it worked.
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide Memberlist but show Team and Who's online

Post by warmweer »

exemplary1 wrote: Thu Mar 07, 2024 2:01 pm
warmweer wrote: Thu Mar 07, 2024 1:58 pm Click on a username in the post_profile area.
Only if Admin has ever posted , right ?
AFAIR it updated with session renewal (so less accurate that the WhoIsOnline info which refreshes as set in the configuration).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53480
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Hide Memberlist but show Team and Who's online

Post by Brf »

exemplary1 wrote: Thu Mar 07, 2024 1:52 pm Btw, I have updated sql query in viewonline.php file ( using chatgpt ) to exclude admin from showing online.
the query is under // Whois requested
That is the query that is looking up the user that goes with a particular session. If you want to affect the viewonline list you want the query after // Get user list
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Brf wrote: Thu Mar 07, 2024 2:59 pm That is the query that is looking up the user that goes with a particular session. If you want to affect the viewonline list you want the query after // Get user list
Added in the query.

Code: Select all

	AND u.user_type NOT IN (" . USER_FOUNDER . ", " . USER_IGNORE .
Doesnt seem like working.

Code: Select all

// Get user list
$sql_ary = array(
	'SELECT'	=> 'u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id',
	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		SESSIONS_TABLE	=> 's',
	),
	'WHERE'		=> 'u.user_id = s.session_user_id
	AND u.user_type NOT IN (" . USER_FOUNDER . ", " . USER_IGNORE .
		AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
		((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : ''),
	'ORDER_BY'	=> $order_by,
);
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53480
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Hide Memberlist but show Team and Who's online

Post by Brf »

Your are missing a ' ) after .USER_IGNORE.
Also you should be using ' rather than " since that is the punctuation used in that query

Code: Select all

	AND u.user_type NOT IN (' . USER_FOUNDER . ', ' . USER_IGNORE . ')
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Thank you for pointing it out, but still not working.

Now I have set user_allow_viewonline to 0 for admin user in phpbbxx_users table to make it work.
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

One more admin leak fixed.
Disabled live searches under 'Load Settings' through which admin becomes visible in member list search.

Return to “phpBB Custom Coding”