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.

Private Network & Invite Users

10 years 11 months ago
  • Andre's Avatar
    Topic Author
  • Andre
  • Offline
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Licenses:
JomSocial Expired

Hello team,

I'm currently developing a private social network but have bumped into a "leaky" issue that I need help resolving. My community (so far) is set with 2 profiles; coordinators & crew and several private groups managed by coordinators (each one for it's own group).

So far so good but I do not want crew profile users to be able to send invites via email as this will be done privately by an administrator via mailing component or by a coordinator via Jomsocial (if fpossible).

My ideal scenario would be;
coordinator profile members allowed to invite users into their group via email/jomsocial tool
crew profile members, once invited and added to a group/jomsocial to have the ability to search and request to be friends with users inside the community.

If ideal scenario is not possible than I can do with no email invitations at all but with users still being able to search and add friends already in the community.

I have searched and tried a few of the solutions posted in the Forum but it seems that things are slightly different with Jomsocial 3.2, which is my version. As an examnple, with one of the solutions from the Forum, invites were fully disabled but I no longer could search and add friends within the community...

I have already unpublished Invite Friend from the main menu, but the function remains in the submenu and in the Groups hero area.

Can you please advise how it can be achieved and if possible via overrides rather than hacks?

I look forward to hearing back from you.

Thanks,
Andre

10 years 11 months ago
Licenses:

Hi, Andre.

You always could ask developers for help: www.jomsocial.com/jomsocial-developers

If you want to remove "Invite Friends" completely you'll need to hack JomSocial core file:

ROOT/components/com_community/views/friends/view.html.php

Just comment line 33 like this:

//$this->addSubmenuItem('index.php?option=com_community&view=friends&task=invite', JText::_('COM_COMMUNITY_INVITE_FRIENDS'));

With Groups it should be easier. Copy this file:

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

to

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

Edit file in line 47

Change this:
<?php if($isMember) { ?>

to this:
<?php if($isAdmin || $isSuperAdmin || $isMine) { ?>

So now Admins, Super Admins and Group owners could send invitations.


- 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 11 months ago
  • Andre's Avatar
    Topic Author
  • Andre
  • Offline
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Michal,

Not quite solved yet...I have tried the Group override first and;

- When user first visited the private group the hero button said "Join Group"
- After user requested to join and was accepted, the text/function of the hero button didn't show "Invite Friends" anymore (override worked) and instead showed "Join Group" which could cause a bit of confusion once the user has already joined but ok...
- The problem with this approach is that the user still could "Invite Friends" via the Group "Options" menu

So I've decided to take a radical approach (even though not the ideal) and disable Invites altogether and;

- "Invite Friends" no longer shows under Friends submenu
- BUT user still could "Invite Friends" via the "Options" menu

Any suggestions?

Thanks,
Andre

10 years 11 months ago
Licenses:

Hi, Andre.

No, enable invite friends. Here is how to remove that option from menu.
In the same file: ROOT/components/com_community/templates/default/groups.viewgroup.php

Replace this:

<div class="nav-collapse collapse js-collapse">
            <ul class="nav">
          <?php if ($config->get('enablesharethis')  == 1 ) { ?>
            <li><a href="javascript:void(0);" onClick="joms.bookmarks.show('<?php echo CRoute::getExternalURL( 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id ); ?>')"><i class="joms-icon-share"></i><?php echo JText::_('COM_COMMUNITY_SHARE')?></a></li>
          <?php } ?>
          <?php if($isLikeEnabled){?>
            <li id='like-groups-<?php echo $group->id; ?>'><a href="javascript:void(0);" onclick="<?php echo ($isUserLiked) == 1 ? 'joms.like.newDislike(this)' : 'joms.like.newLike(this)' ?>" class="<?php if($isUserLiked == 1){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $totalLikes; ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE')?></a></li>
          <?php }?>
          <li><span><i class="joms-icon-eye"></i><?php echo ($group->hits > 1) ? JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT_MANY',$group->hits) : JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT',$group->hits); ?></span></li>
          <?php if(($config->get('enablereporting') == 1 && $my->id != 0) || ( $config->get('enablereporting') == 1 && $config->get('enableguestreporting') == 1 && $my->id == 0)){?>
            <li><a href="javascript:void(0);" onclick="joms.report.emptyMessage = '<?php echo JText::_('COM_COMMUNITY_REPORT_MESSAGE_CANNOT_BE_EMPTY'); ?>';joms.report.showWindow('groups,reportGroup','[<?php echo $group->id ?>]');" ><i class="js-icon-warning-sign"></i><?php echo JText::_('COM_COMMUNITY_REPORT_GROUP'); ?></a></li>
              <?php }?>
            </ul>
            <?php if($isMember && !$isBanned || $isSuperAdmin){?>
            <ul class="nav pull-right">
              <li class="dropup">
                <a href="#" class="js-navbar-options"><?php echo JText::_('COM_COMMUNITY_GROUP_OPTIONS')?></a>
                <ul class="dropdown-menu pull-right">
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=adddiscussion&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_DISCUSSION_CREATE'); ?></a></li>
            <!-- Show events -->
            <?php if($showEvents){?>
              <?php if ( ($eventPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=create&groupid=' . $group->id);?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_CREATE_EVENT'); ?></a></li>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=import&groupid=' . $group->id);?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_IMPORT_EVENT'); ?></a></li>
              <?php } ?>
            <?php } ?>
                  <?php if( ($isMember) && (!$isMine) && !($waitingApproval) && (COwnerHelper::isRegisteredUser()) ) { ?>
                <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.groups.leave('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_LEAVE');?></a></li>
                  <?php } ?>

                <?php if($isAdmin || $isSuperAdmin || $isMine) { ?>
                  <li><a href="javascript:void(0)" onclick="joms.photos.uploadAvatar('profile','<?php echo $profile->id?>')"><?php echo JText::_('COM_COMMUNITY_CHANGE_AVATAR')?></a></li>
                  <!-- Change cover button -->
                  <?php if(!$group->defaultCover) {?>
                  <li class="hidden-desktop">
                    <a href="javascript:void(0)" data-cover-context="group" onclick="joms.cover.reposition(this, <?php echo $group->id; ?>,'<?php echo JText::_("COM_COMMUNITY_CANCEL_BUTTON")?>','<?php echo JText::_("COM_COMMUNITY_SAVE_BUTTON")?>');"><?php echo JText::_('COM_COMMUNITY_REPOSITION_COVER')?></a>
                  </li>
                  <?php } ?>
                  <li class="hidden-desktop">
                    <a href="javascript:void(0)" data-cover-context="group" onclick="joms.cover.select(this, <?php echo $group->id; ?>);" > <?php echo JText::_('COM_COMMUNITY_CHANGE_COVER'); ?></a>
                  </li>
                    <li class="divider"></li>
                <?php }?>

            <!-- Show photos -->
            <?php if($showPhotos){?>
              <?php if ( ($photoPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                <li class="visible-desktop"><a tabindex="-1" href="javascript:void(0);" onclick="joms.notifications.showUploadPhoto('','<?php echo $group->id; ?>'); return false;" ><?php echo JText::_('COM_COMMUNITY_PHOTOS_UPLOAD_PHOTOS'); ?></a></li>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=photos&groupid=' . $group->id . '&task=newalbum');?>"><?php echo JText::_('COM_COMMUNITY_PHOTOS_CREATE_ALBUM_BUTTON'); ?></a></li>
              <?php } ?>
            <?php } ?>
            <!-- Show videos -->
                  <?php if($showVideos){?>
              <?php if ( ($videoPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                    <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.videos.addVideo('<?php echo VIDEO_GROUP_TYPE; ?>', '<?php echo $group->id; ?>')"><?php echo JText::_('COM_COMMUNITY_VIDEOS_ADD'); ?></a></li>
              <?php } ?>
                  <?php }?>
                  <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 if( $isMine || $isSuperAdmin || $isAdmin ){?>
                    <li class="divider"></li>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=edit&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_EDIT'); ?></a></li>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=sendmail&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_SENDMAIL'); ?></a></li>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=addnews&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_BULLETIN_CREATE'); ?></a></li>
                    <?php if($isSuperAdmin){?>
                      <li><a tabindex="-1" href="javascript:void(0);" onclick="javascript:joms.groups.unpublish('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_UNPUBLISH'); ?></a></li>
                    <?php }?>
                    <li class="divider"></li>
                    <li><a tabindex="-1" href="javascript:void(0)" onclick="javascript:joms.groups.deleteGroup('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_DELETE_GROUP_BUTTON'); ?></a></li>
                  <?php }?>
              </ul>
              </li>
            </ul>
            <?php }?>
          </div><!-- /.nav-collapse -->

with this
<div class="nav-collapse collapse js-collapse">
            <ul class="nav">
          <?php if ($config->get('enablesharethis')  == 1 ) { ?>
            <li><a href="javascript:void(0);" onClick="joms.bookmarks.show('<?php echo CRoute::getExternalURL( 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id ); ?>')"><i class="joms-icon-share"></i><?php echo JText::_('COM_COMMUNITY_SHARE')?></a></li>
          <?php } ?>
          <?php if($isLikeEnabled){?>
            <li id='like-groups-<?php echo $group->id; ?>'><a href="javascript:void(0);" onclick="<?php echo ($isUserLiked) == 1 ? 'joms.like.newDislike(this)' : 'joms.like.newLike(this)' ?>" class="<?php if($isUserLiked == 1){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $totalLikes; ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE')?></a></li>
          <?php }?>
          <li><span><i class="joms-icon-eye"></i><?php echo ($group->hits > 1) ? JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT_MANY',$group->hits) : JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT',$group->hits); ?></span></li>
          <?php if(($config->get('enablereporting') == 1 && $my->id != 0) || ( $config->get('enablereporting') == 1 && $config->get('enableguestreporting') == 1 && $my->id == 0)){?>
            <li><a href="javascript:void(0);" onclick="joms.report.emptyMessage = '<?php echo JText::_('COM_COMMUNITY_REPORT_MESSAGE_CANNOT_BE_EMPTY'); ?>';joms.report.showWindow('groups,reportGroup','[<?php echo $group->id ?>]');" ><i class="js-icon-warning-sign"></i><?php echo JText::_('COM_COMMUNITY_REPORT_GROUP'); ?></a></li>
              <?php }?>
            </ul>
            <?php if($isMember && !$isBanned || $isSuperAdmin){?>
            <ul class="nav pull-right">
              <li class="dropup">
                <a href="#" class="js-navbar-options"><?php echo JText::_('COM_COMMUNITY_GROUP_OPTIONS')?></a>
                <ul class="dropdown-menu pull-right">
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=adddiscussion&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_DISCUSSION_CREATE'); ?></a></li>
            <!-- Show events -->
            <?php if($showEvents){?>
              <?php if ( ($eventPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=create&groupid=' . $group->id);?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_CREATE_EVENT'); ?></a></li>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=import&groupid=' . $group->id);?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_IMPORT_EVENT'); ?></a></li>
              <?php } ?>
            <?php } ?>
                  <?php if( ($isMember) && (!$isMine) && !($waitingApproval) && (COwnerHelper::isRegisteredUser()) ) { ?>
                <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.groups.leave('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_LEAVE');?></a></li>
                  <?php } ?>

                <?php if($isAdmin || $isSuperAdmin || $isMine) { ?>
                  <li><a href="javascript:void(0)" onclick="joms.photos.uploadAvatar('profile','<?php echo $profile->id?>')"><?php echo JText::_('COM_COMMUNITY_CHANGE_AVATAR')?></a></li>
                  <!-- Change cover button -->
                  <?php if(!$group->defaultCover) {?>
                  <li class="hidden-desktop">
                    <a href="javascript:void(0)" data-cover-context="group" onclick="joms.cover.reposition(this, <?php echo $group->id; ?>,'<?php echo JText::_("COM_COMMUNITY_CANCEL_BUTTON")?>','<?php echo JText::_("COM_COMMUNITY_SAVE_BUTTON")?>');"><?php echo JText::_('COM_COMMUNITY_REPOSITION_COVER')?></a>
                  </li>
                  <?php } ?>
                  <li class="hidden-desktop">
                    <a href="javascript:void(0)" data-cover-context="group" onclick="joms.cover.select(this, <?php echo $group->id; ?>);" > <?php echo JText::_('COM_COMMUNITY_CHANGE_COVER'); ?></a>
                  </li>
                <?php }?>

            <!-- Show photos -->
            <?php if($showPhotos){?>
              <?php if ( ($photoPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                <li class="visible-desktop"><a tabindex="-1" href="javascript:void(0);" onclick="joms.notifications.showUploadPhoto('','<?php echo $group->id; ?>'); return false;" ><?php echo JText::_('COM_COMMUNITY_PHOTOS_UPLOAD_PHOTOS'); ?></a></li>
                <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=photos&groupid=' . $group->id . '&task=newalbum');?>"><?php echo JText::_('COM_COMMUNITY_PHOTOS_CREATE_ALBUM_BUTTON'); ?></a></li>
              <?php } ?>
            <?php } ?>
            <!-- Show videos -->
                  <?php if($showVideos){?>
              <?php if ( ($videoPermission ==  1 && $isAdmin) || ($isMember == 2 && $isAdmin) ) { ?>
                    <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.videos.addVideo('<?php echo VIDEO_GROUP_TYPE; ?>', '<?php echo $group->id; ?>')"><?php echo JText::_('COM_COMMUNITY_VIDEOS_ADD'); ?></a></li>
              <?php } ?>
                  <?php }?>

                  <?php if( $isMine || $isSuperAdmin || $isAdmin ){?>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=edit&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_EDIT'); ?></a></li>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=sendmail&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_SENDMAIL'); ?></a></li>
                    <li><a tabindex="-1" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=addnews&groupid=' . $group->id );?>"><?php echo JText::_('COM_COMMUNITY_GROUPS_BULLETIN_CREATE'); ?></a></li>
                    <?php if($isSuperAdmin){?>
                      <li><a tabindex="-1" href="javascript:void(0);" onclick="javascript:joms.groups.unpublish('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_UNPUBLISH'); ?></a></li>
                    <?php }?>
                    <li class="divider"></li>
                    <li><a tabindex="-1" href="javascript:void(0)" onclick="javascript:joms.groups.deleteGroup('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_DELETE_GROUP_BUTTON'); ?></a></li>
                  <?php }?>
              </ul>
              </li>
            </ul>
            <?php }?>
          </div><!-- /.nav-collapse -->

Now Invite Friends should be gone from Options menu.


- 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 11 months ago
  • Andre's Avatar
    Topic Author
  • Andre
  • Offline
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Michal,

Reviving this topic a bit...Have applied the suggestions and a few more as Invite friends was still showing under Search Friends but overall it's all good and invite system is as desired.

Need one last thing to make it perfect though; at the moment when a user 1st visit a group the hero button says "Join Group" and after joining the button no longer says "Invite Friends" and shows "Join Group" which is confusing since user has already joined.

Question; how can I have the hero button displaying "Leave Group" for a user already in the group instead?

Thanks,
Andre

10 years 11 months ago
Licenses:

Hi, Andre.

Use this code:

<div class="btn btn-primary" onclick="joms.groups.leave(<?php echo $group->id;?>)"><i class="js-icon-user-add"></i><?php echo JText::_('COM_COMMUNITY_GROUPS_LEAVE'); ?></div>

in groups.viewgroup.php around line 41.


- 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 11 months ago
  • Andre's Avatar
    Topic Author
  • Andre
  • Offline
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Licenses:
JomSocial Expired

Thanks.

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