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.

 

Need help with AcyMailing

Need help with AcyMailing

I was hoping to hide the newsletter subscribe module once the user has subscribed to the newsletter.

Is this possible?

Any direction will be greatly appreciated.

Thanks in advance

sbcarlos
Beginner Modder
ranks
useravatar
Offline
2 Posts
User info in posts
Administrator has disabled public posting

Re: Need help with AcyMailing

Hi sbcarlos,

I've just downloaded AcyMailing to take a look at it. It doesn't look too hard.

Try this, remembering to replace XXX with the module id of the module that you want to be displayed in each case. (user is not logged in, or user is logged in but has not yet subscribed).


if ($user->id == 0) return XXX; // module to show if user is not logged in
$query = "select ls.status
  from #__acymailing_subscriber s,
  #__acymailing_listsub ls
  where
  ls.subid = s.subid
  and s.userid = " . (int)$user->id;
$db->setQuery($query);
$result = $db->loadResult();
if ($result != 1) return XXX; // module to show if user is NOT subscribed


Now, I noticed that there are other controls inside AcyMailing controlling whether the user is enabled, confirmed, and/or "can receive mail". If you want to check for those you can modify the $query line above like this:

$query = "select ls.status
  from
  #__acymailing_subscriber s,
  #__acymailing_listsub ls
  where
  ls.subid = s.subid
  and s.userid = " . (int)$user->id . "
  and s.confirmed = 1
  and s.enabled = 1
  and s.accept = 1";


Hope that helps,
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: Need help with AcyMailing

That worked like a charm. Also, I cant believe you responded same day! I just today if there was any response and to my surprise you had posted the answer same day.

Thank you so much Stephen. This helped me a lot.

Carlos

sbcarlos
Beginner Modder
ranks
useravatar
Offline
2 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5530
Newest User:
lawfood2
Members Online:
0
Guests Online:
100

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