Hello.
I created closed (hiden) group and would like to keep it fully private.
I want to invite only active sitemembers (and allow it to do only by Administrator or SuperUser).
Can you give any advice?
1) We created some "Landing page" (article) that said: "We have some private group, but only active users can join it. Please come back there again when you will get 500 user points and write comment... So admin will invite you."
1) Seems SuperUser can invite only friends. So first I need to add user as friend.
2) Then I need to use "Invite" button and sent invitation to my new friend?
Because if I just send him link to the group, he will not see groups cover and "Join" button.
I only worry about this:
Group's member can invite his friends that didn't get 500 user points.
So as result it's not fully hiden group. And if we has "Rat-user" inside group, so anybody can get access to group with his help :(
What should I do to prevent it?
The best way - is to ask for improvement :) Add inside group's settings "option: allow/disallow users to invite friends" (but always allow it for admin and superuser). Or may me make it as default: "only admin can invite members to closed HIDEN group". Can you please discuss it?
Another way - is to hide "invite friend button" with CSS. But I have no idea how to hide both buttons (and do it only for registered users).
May be I can do it with "Red invite button"
<!-- invite friend button -->
<a href="javascript:" class="joms-focus__button--add" onclick="joms.api.groupInvite('162')">
Invite</a>
But can't do the same for Invite button inside GEAR-icon.
Hi, Dmitry.
Thank you for contacting us.
You took a wrong approach :) If only Admin or SU may assign users to group then you should do that from backend.
In Backend -> Components -> JomSocial -> Monitor -> Members you have button to assign members to group
prntscr.com/fwbgyq
You may customize single group layout file and hide invite buttons with php (add condition to hide invite options for closed groups).
Can you please provide part of code for "Condition"? To hide code if group is private (closed) or display code if group is publick.Michał wrote: You may customize single group layout file and hide invite buttons with php (add condition to hide invite options for closed groups).
Privet Dmitry.
Try this:
<?php if($group->approvals == COMMUNITY_PRIVATE_GROUP) { ?>
button code
<?php } ?>
Thanks you very much for help :)
I had to use:
<?php if($group->approvals == COMMUNITY_PUBLIC_GROUP && $isAdmin || $isSuperAdmin) { ?>
Now only admin / superuser can invite new members with frontend :)
But not group's admin or group's creator :( I don't know how allow them to do it in frontend.
Privet Dmitry.
$isAdmin should work as this stands for group admin:
$isAdmin = $groupModel->isAdmin($my->id, $group->id);