News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Allow to see all members of groups

Started by JerzyLS, May 23, 2016, 05:45:03 AM

Previous topic - Next topic

JerzyLS

Hello,

I'm looking for the modification to allow the users to see all members of the group "Citizens" for example. When the members have the group "Citizens" set as additional, I want to the users can see them in group list.
Now only moderators and admins can see full list of members.

It's possible?

Illori

nope it is not possible by default. when a group is secondary/additional only those that can assign them the group or moderate the group can view who is in the group.

the purpose of having the group as additional is to have it hidden.

i dont know if any mods that add this feature.

JerzyLS

Pff...

Here is the solution (thanks to my friends).

./Sources/Groups.php:

// The where on the query is interesting. Non-moderators should only see people who are in this group as primary.
if ($context['group']['can_moderate'])
$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group} OR FIND_IN_SET({int:group}, additional_groups) != 0';
else
$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group}';


Rewrite to:

// The where on the query is interesting. Non-moderators should only see people who are in this group as primary.
//if ($context['group']['can_moderate'])
$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group} OR FIND_IN_SET({int:group}, additional_groups) != 0';
//else
//$where = $context['group']['is_post_group'] ? 'id_post_group = {int:group}' : 'id_group = {int:group}';

Grammy

I was just wondering, since it's hard for me to see things, sometimes...  how are those two blocks of code different, other than a couple of extra "//"s?  I don't know anything about coding, but I'm always trying to learn; what does "//" do?   ???

Illori

it comments out the code, so it does not "work".

Grammy

Quote from: Illori on May 31, 2016, 07:58:02 AM
it comments out the code, so it does not "work".

Oh!  I thought it had to be something like /* comments  */.  Are there different styles, depending on whether you have multi or single lines to comment out?  (Thanks for explaining it.)   :)

Arantor

// means treat the rest of this line as a comment.
/* and */ indicate an entire block, across multiple lines, should be treated as a comment.

Grammy

Quote from: Arantor on May 31, 2016, 08:24:46 AM
// means treat the rest of this line as a comment.
/* and */ indicate an entire block, across multiple lines, should be treated as a comment.


I always learn something new frequenting this forum!  Thanks so much.   :) 

Advertisement: