Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: SleePy - joulukuu 28, 2005, 05:28:50 IP

Otsikko: show hidden users to a certain group
Kirjoitti: SleePy - joulukuu 28, 2005, 05:28:50 IP
how would i show the hidden users to a group? the group doesn't have global moderator. but most of them got moderator to 1 or 2 boards.
I have looked around display.template.php and i can't find nothing or when i look in the permissions thing for that group there is nothing telling me to allow this group to view hidden users.

Thanks.
Otsikko: Re: show hidden users to a certain group
Kirjoitti: Dannii - joulukuu 28, 2005, 10:40:06 IP
I think you need to give the group the manage_members permission, although I'm not sure.
Otsikko: Re: show hidden users to a certain group
Kirjoitti: SleePy - joulukuu 29, 2005, 01:25:37 AP
i thought i could some were in the BoardIndex.template.php i could add it in to allow them to view it.
i see the place were it shows the hidden users but i see no if statements on it that let admins and global mods see them.
Otsikko: Re: show hidden users to a certain group
Kirjoitti: Dannii - joulukuu 29, 2005, 02:03:15 AP
BoardIndex.php
elseif (empty($row['showOnline']) && !allowedTo('moderate_forum'))I think if you modified that line so that it will only be true if empty($row[etc && !allowedTo(etc and not in the group you want to be able to view hidden members.
Otsikko: Re: show hidden users to a certain group
Kirjoitti: SleePy - joulukuu 29, 2005, 03:19:22 IP
yea i found that. how would i get it to only do it if they are in a group? or additional groups would this work?

elseif (empty($row['showOnline']) && !allowedTo('moderate_forum') && !$context['member']['group'] == '3')

i dont know how to find out what group the user is in or those additional groups.
Otsikko: Re: show hidden users to a certain group
Kirjoitti: Dannii - joulukuu 29, 2005, 10:34:07 IP
You won't be able to test for group 3 (moderators).

But for other groups:
Lainaus käyttäjältä: [Unknown] - elokuu 13, 2004, 07:27:04 APif (in_array(##, $GLOBALS['user_info'][groups']))

Where ## is the ID_GROUP of the group you're checking for - 4 is Newbie, 1 is Administrator, etc.

-[Unknown]
Otsikko: Re: show hidden users to a certain group
Kirjoitti: SleePy - joulukuu 29, 2005, 11:03:12 IP
theres and error in tht i had to fix
$GLOBALS['user_info'][groups']
should be
$GLOBALS['user_info']['groups']

but it did not work...  :(

elseif (empty($row['showOnline']) && !allowedTo('moderate_forum') && $GLOBALS['user_info']['groups'] != '16')
Otsikko: Re: show hidden users to a certain group
Kirjoitti: Dannii - joulukuu 29, 2005, 11:09:00 IP
Hmmm does $context['user_info']['groups'] work? That was an old post of [Unknown] so the code would have changed.