Hello Arlex,
Is the above description something you can implement easily ?
Yes, but still need to apply this following customization code but less code and only involved a few files.
This is what my ideas :
1. Create one of the profile type which set "Allow Community Access" to NO.
2. Set all your Payplans Easysocial profile type app inactive state to this profile type, mean once the user subscription already expired, he will under this profile type which unable to access anything on the Easysocial pages except edit user profile page.
3. Apply this following codes into these files :
Group - JoomlaFolder/components/com_easysocial/views/groups/view.html.php
[gist type="php"]
// do not allow other user access non-community access cluster owner page
$groupCreatorHasCommunityAccess = ES::user($group->creator_uid)->hasCommunityAccess();
if (!$groupCreatorHasCommunityAccess) {
ES::raiseError(404, JText::_('Unable to access because the clusters owner subscription already expired and blablabla.'));
}
[/gist]
Refer my attached screenshot - group code.png
Event - JoomlaFolder/components/com_easysocial/views/events/view.html.php
[gist type="php"]
// do not allow other user access non-community access cluster owner page
$eventCreatorHasCommunityAccess = ES::user($event->creator_uid)->hasCommunityAccess();
if (!$eventCreatorHasCommunityAccess) {
ES::raiseError(404, JText::_('Unable to access because the clusters owner subscription already expired and blablabla.'));
}
[/gist]
Refer my attached screenshot - Event code.png
Page - JoomlaFolder/components/com_easysocial/views/pages/view.html.php
[gist type="php"]
// do not allow other user access non-community access cluster owner page
$pageCreatorHasCommunityAccess = ES::user($page->creator_uid)->hasCommunityAccess();
if (!$pageCreatorHasCommunityAccess) {
ES::raiseError(404, JText::_('Unable to access because the clusters owner subscription already expired and blablabla.'));
}
[/gist]
Refer my attached screenshot - Page code.png
Note: you can modify those sentences word to language constants e.g. you can simply put this
COM_ES_CUSTOM_MESSAGE_BLABLABLA then override these language constants into your site backend language override section.
For example :
ES::raiseError(404, JText::_('COM_ES_CUSTOM_MESSAGE_BLABLABLA'));
4. Those group, event and page will not unpublish it, it will still show on the listing page, but when someone trying to view it, it will show the error message.
5. If the owner already renew the subscription, everyone can able to access it as usual.