Hello,
I integrated a button to join a specific Group, outside the Group.
This is what I pasted into the file
/modules/mod_easysocial_quickpost/tmpl/default.php :
<a class="btn btn-es-default-o btn-sm" href="javascript:void(0);" data-es-groups-join data-id="2" data-page-reload="1">
<div class="o-loader o-loader--sm"></div>
<?php echo JText::_('COM_EASYSOCIAL_GROUPS_JOIN_GROUP');?>
</a>
The button works. By clicking on it, the user automatically joins the Group
However,
I would like this button to appear only if the user is not yet a member of the specified group.
Would you have any idea of the php code that I can use to check this, and decide whether or not to display this button ?
A code like for example :
<?php if ($this->my->getAccess()->get('groups.allow.join') && !$group->isInviteOnly() && !$group->isMember() && !$group->isPendingMember() && !$group->isInvited()) { ?>
<a class="btn btn-es-default-o btn-sm" href="javascript:void(0);" data-es-groups-join data-id="2" data-page-reload="1">
<div class="o-loader o-loader--sm"></div>
<?php echo JText::_('COM_EASYSOCIAL_GROUPS_JOIN_GROUP');?>
</a>
<?php } ?>
But it would be necessary to specify the Group id concerned in the PHP code...
Thank your for your help
Philippe