UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

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!
It is currently a public holiday for us from where we are at.

There may be a delay in our responses but rest assured that we will be back at full speed when we are back to the office.
  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