FREE Get a FREE template when you purchase Social bundle 🚀 ⚡️

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
  Support is offline

PHP code

Philippe · ·
8:32 PM Monday, 20 August 2018
None
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
The replies under this section are restricted to logged in users or users with an active subscription with us