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.

 

Metamod with AEC recipe question

Re: Metamod with AEC recipe question

Sure, I'd be glad to take a look. I'm PM you my e-mail address.

Cheers,
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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Metamod with AEC recipe question

Hi Derek,

Here's some code which retrieves the AEC subscription and plan for a given logged-in user. You can use it to determine if the user has a subscription to a particular AEC Plan, or any valid subscription.

Is this what you're after? I know you were talking about "groups", but I have a feeling that you might have meant Plans.


if ($user->id) {
  $plan = null;
  require_once( JPATH_SITE . "/components/com_acctexp/acctexp.class.php" );
  $metaUser = new metaUser( $user->id );
  if ($metaUser->hasSubscription) {
    $sub = $metaUser->focusSubscription;
    if ($sub and !$sub->is_expired()) {
      $plan = $sub->plan;
    }
  }
  if ($plan == AAA) return BBB;
  if ($plan == CCC) return DDD;
  // replace AAA & CCC with the plan ids to check for,
  // and BBB & DDD with the modules to use for people
  // in those plans
}


Please let me know if this is now working as required :-)

Cheers,
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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5939
Dormant:
User Info:
 
Total Users:
6046
Newest User:
estaglobal
Members Online:
0
Guests Online:
148

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