Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

supressing invites of private group

10 years 9 months ago
Licenses:
JomSocial Active

When setting up a private group is there a way to restrict members (of that private group) from inviting others?

10 years 9 months ago
Licenses:

Hi, karl.

No, you can't disable ti via administration panel.
You may try to remove this button (if you're familiar with php) by editing this file:

ROOT/components/com_community/templates/default/groups.viewgroup.php

copy it to:

ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)

replace (start from line 39):

<div class="span4 text-right">
              <!-- invite friend button -->
              <?php if($isMember) { ?>
                <div class="btn btn-primary" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></div>
              <?php } else { ?>
                <div class="btn btn-primary" onclick="joms.groups.join(<?php echo $group->id;?>)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_GROUPS_JOIN'); ?></div>
              <?php }?>
            </div>

with:
<div class="span4 text-right">
              <!-- invite friend button -->
              <?php if($isMember AND !$isPrivate) { ?>
                <div class="btn btn-primary" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></div>
              <?php } elseif(!$isMember) { ?>
                <div class="btn btn-primary" onclick="joms.groups.join(<?php echo $group->id;?>)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_GROUPS_JOIN'); ?></div>
              <?php }?>
            </div>

This will hide Invite Friends button for private groups.

EDIT:

This will remove also "Invite Friends" button under "Options" menu:

and in line 183 replace:
<li><a tabindex="-1" href="javascript:void(0);" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></a></li>

with:
                <?php if($isMember AND !$isPrivate) { ?>
                  <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></a></li>
                  <?php } ?>

This hack is from JomSocial 3.2.1.4


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
10 years 9 months ago
Licenses:

If you need more;

This hack will remove "Invite Friends" button in private groups for all users EXCEPT: group owner, Super User, Administrator:

ROOT/components/com_community/templates/default/groups.viewgroup.php

copy it to:

ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)

replace (start from line 39):

<div class="span4 text-right">
              <!-- invite friend button -->
              <?php if($isMember) { ?>
                <div class="btn btn-primary" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></div>
              <?php } else { ?>
                <div class="btn btn-primary" onclick="joms.groups.join(<?php echo $group->id;?>)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_GROUPS_JOIN'); ?></div>
              <?php }?>
            </div>

with:
<div class="span4 text-right">
              <!-- invite friend button -->
              <?php if($isMember AND !$isPrivate) { ?>
                <div class="btn btn-primary" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></div>
               <?php } elseif($isMine || $isSuperAdmin || $isAdmin AND $isPrivate) { ?>
                <div class="btn btn-primary" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></div>
              <?php } elseif(!$isMember) { ?>
                <div class="btn btn-primary" onclick="joms.groups.join(<?php echo $group->id;?>)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_GROUPS_JOIN'); ?></div>
              <?php }?>
            </div>

and in line 183 replace:
<li><a tabindex="-1" href="javascript:void(0);" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></a></li>

with:
                <?php if($isMember AND !$isPrivate) { ?>
                  <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></a></li>
                  <?php } elseif($isMine || $isSuperAdmin || $isAdmin AND $isPrivate) {?>
                  <?php if( $isMine || $isSuperAdmin || $isAdmin ){?>
                  <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.invitation.showForm(null,'groups,inviteUsers','<?php echo $group->id;?>',1,1)"><?php echo JText::_('COM_COMMUNITY_INVITE_FRIENDS'); ?></a></li>
                  <?php }?>


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: Karl Johan
10 years 9 months ago
Licenses:
JomSocial Active

hmm, I though it worked but now go this error when viewing a group:

Parse error: syntax error, unexpected '}' in /home/proutglo/public_html/resources/components/com_community/templates/default/groups.viewgroup.php on line 49

So I reverted it to the original.

Please advice.

10 years 9 months ago
Licenses:

Hi, Karl Johan.

It works 100%. :) You probably copied in wrong place, error says about missing }. Please try again.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
10 years 9 months ago
Licenses:
JomSocial Active

question: should I edit this file as well or just copy it?

ROOT/components/com_community/templates/default/groups.viewgroup.php

10 years 9 months ago
Licenses:

Hi, Karl Johan.

ROOT/components/com_community/templates/default/groups.viewgroup.php

copy it to:

ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
10 years 8 months ago
Licenses:
JomSocial Active

I followed those instructions but the invite still shows up for regular members :-(

10 years 8 months ago
Licenses:

Hi, Karl.

I'm sorry to say that - it means that you did something wrong. It works perfectly form me and also I get feedback from other users that successfully implemented this hack on their sites.

In spare time I upload a demo file here.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW