Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Registration date for users assigned to multiple groups

Registration date for users assigned to multiple groups

Hello all!

Thanks and success to Stephen and Metamod! An exceptional gift to the world!

That's my case:

I offer online courses and want to be able to gradually release content. User management is got by a third-pay system (Amember), which has a plugin to Joomla 3.1. Amember manages users, includes them in Joomla groups when they subscribe and excludes them from that specific group after number of weeks has ended.

So I needed to control modules with 2 parameters: user groups and registration date and I got it, except for this point:

Any user can be assigned to multiple groups, with different registration dates for the specific groups.

Ex. a user can register for non-paid membership and joomla records his registration date.

In the future, he can by some product and be assigned simultaneously to another group, ex. Course 1, which will remain for ex. 4 weeks.

So far I was able to display incremental content, but only based on first registration date, regardless of group assigned. Joomla only records this first information, which is passed from Amember.

Is there any way to get these registration dates for the individual user in their specific user groups?

It can be a component, plugin or customized code, anything you could suggest I would be very grateful.

That's a sample of code:

if ($core_genius->check("groups = Curso Crianças")) { // ensure that there's a logged in user
  $days = $core_genius->info( 'days_since_registration' );
  if ($days >= 8) return 291; // for all users reg for 1 week or more
return 169; // user has been registered from 0-7 days
}

Regards!
Cc

cca
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Registration date for users assigned to multiple groups

Hi Cc,

I've just been looking at the amember API and I haven't yet found where you get access to group information. However, would it work for you to simply be able to determine if they are in a certain group or not? If you don't need to know how much longer they have left in a certain group(/subscription) then you should be able to use the core_genius check for groups.

Or do you need to do incremental content even within each group/subscription?

The only thing I found which might be able to help is this code:


require_once '/home/me/public_html/amember/bootstrap.php'; // replace with correct path to amember/bootstrap.php
$u = Am_Di::getInstance()->auth->getUser(); // returns User object or null
var_dump($u); // display the object

Can you try that and see if this displays any subscription info including dates of subscriptions? You of course need to get the path right for your site.

If not, it's probably going to require a database call. In that case can you possibly send me a copy of amembers so I can install and make the right query for you?

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Registration date for users assigned to multiple groups

Hello Stephen, Thanks so much for answering!

That's the point - the only information Amember passes to Joomla is user's assignment to one or more groups. That's the only configuration possible in the integration plugin.

What I need is a way to control content access depending on both: user group and time since registration in the group.

So I decided to try Akeeba Subscriptions, as it is already integrated with Joomla. Thanks for offering to help me solve this with Amember, but that was not the only problem I had to solve, so I decided to quit it - obviously, accepting help regarding Akeeba!.

Akeeba has a plugin that controls access but has strong restrictions - it can limit only access to parts of article's, ex. not their titles. And does not control modules.

The plugin is: Akeeba Timed control release. A full description from user's manual is bellow.

So if you could help me to get METAMOD able to retrive 'subscription date to XXX group' from Akeeba it would be perfect!

Best regards,

Cc

===========================

7. Timed content release

Displayed in the Plugins Manager as: Content - Akeeba Subscriptions Timed Release

This content plugin allows you to show parts of your content only to specific subscribers, depending on how many
days they are on particular subscription levels, or how many days remain in their subscription to perticular subscription
levels. This is a very powerful feature that allows you to "drip feed" information to your subscribers.

Practical use case: e-Learning sites. On an e-learning site a user usually subscribes to a course which lasts for weeks.
Typically, you only want your student to see certain information every few days/weeks, disallowing them to peek
through to the end of the course. This plugin will help do exactly that.

Another practical use case: showing coupon codes to your subscribers as the end of their subscription expiration comes
near, e.g. during the last 30 days of their subscription.

Note
Like the content restriction plugin, it cannot "hide" entire articles, e.g. not show them at all to people outside
the specified time constraints. At best, only the title will be shown.

Its syntax is:

{astimedrelease expression }Your content{/astimedrelease}

This means that "Your content" will only be displayed to users whose subscriptions satisfy the expression. In the
simplest form, expression is just the name of a subscription level, e.g.

{astimedrelease LEVEL1}Your content{/astimedrelease}

In this form it will only show the content if the user has or has ever had a subscription on the LEVEL1 subscription
level. It gets infinitely more useful appending time expressions after the subscription level.

Time expressions follow the subscription level, are enclosed in parentheses and consist of one or two arguments. Since
it's hard to explain this otherwise, let's take some examples:

LEVEL1(10) The user must have more than 10 days of presence in the LEVEL1 subscription level

LEVEL1(X,10) The user must have less than 10 days of presence in the LEVEL1 subscription level

(=============== other examples ==================smile

cca
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Registration date for users assigned to multiple groups

Hi, can you possibly e-mail me a copy of AS, that includes these plugins? Hopefully they should make it fairly easy to work out how to do the same thing with modules.


Thanks,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11577
Newest User:
owens65784
Members Online:
0
Guests Online:
167

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked