Author Topic: amember plug in  (Read 6283 times)

orders1

  • Posts: 14
    • View Profile
amember plug in
« on: January 19, 2008, 05:42:41 pm »
I have my listmail set up so their is a pre opt-in list (list 1) before a purchase for a free guide. If the user then makes a purchase I have amember put them into list 2.

I also set listmail so that if a user gets inserted into list 2 they are removed from list 1. However, thats not happening. I end up with the email in both lists.

I have done this before with other sites and had no problem. However this is the first time I have tried to do this with amember. Is it because we use amember to opt-into the second list this does not remove from the first list? Is there a way to fix that?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
amember plug in
« Reply #1 on: January 22, 2008, 08:14:47 am »
It would seem the aMember plugin does not use the standard ListMail signup procedure such as used in our custom PHP user addition script.  It must do it's own MySQL "INSERT" statement to add the user to the ListMail database.  Therefore, the plugin would have to have it's own code to remove users from other lists, send welcome messages, etc.  The benefits of their method is the purchase list can be "Closed" from non-buyers which gives added security.  I am still considering how to implement "password" or "identification" strings on signup forms and/or lists that could allow secure signup with more "open" lists so such plugins are easier and more functional.

Right now, all I can suggest is writing your own plugin or modifying theirs to use the PHP insertion code we provide (above link) which would enable all of the features on the List Settings page.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
amember plug in
« Reply #2 on: January 22, 2008, 08:17:09 am »
One more suggestion would be to add a single line to their plugin to remove the user (by email address) from the first list.

Something like this, to remove users from list 1:

Code: [Select]
mysql_query("DELETE FROM lm_users WHERE list = '1' AND email = '".addslashes($aMemberEmail)."';",$listmailDBLink) or die(mysql_error());
The variables $aMemberEmail and $listmailDBLink are an example and would need to be replaced with the variable names used by their plugin.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

orders1

  • Posts: 14
    • View Profile
amember plug in
« Reply #3 on: January 22, 2008, 08:31:18 pm »
Where would I add that? What part of the listmail.inc.php file?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
amember plug in
« Reply #4 on: January 25, 2008, 05:06:47 pm »
I recommend it be placed just before the INSERT statement they use to insert the user.  You should be able to use the same email and database-link variables they use for that query.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

orders1

  • Posts: 14
    • View Profile
amember plug in
« Reply #5 on: February 11, 2008, 06:00:59 pm »
Is this something I can hire you to do? I am not much of a programmer and didnt have much luck trying to set this up myself.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
amember plug in
« Reply #6 on: February 12, 2008, 07:51:54 am »
I couldn't put a dollar amount on just one line of code. Please send me an email at dean@... with the listmail.inc.php file attached and a link back to this forum post.  I will then be able to offer advice on what to place and where.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
amember plug in
« Reply #7 on: February 14, 2008, 04:43:14 am »
OK, I received the code.  After this:
Code: [Select]
       $db->query($s = "INSERT INTO {$lm_db}users
        (uid,list,fname,lname,email,cseq,cdel,cnf,dateadd,htmail)
        VALUES
        ('$us',$list_id,'$member[name_f]', '$member[name_l]',
        '$member[email]',  1, 0, 1, '$dat', 1
        )
        ");

Try adding this:
Code: [Select]
       $remove_list = 2;
        $db->query($s = "DELETE FROM {$lm_db}users
        WHERE list = '$remove_list' AND email = '$member[email]';");

Note that this will be in effect for ALL aMember purchases, not just ones to your paid list.

To run it only for a specific list it might look like this:
Code: [Select]
       $paid_list = 3;
        $remove_list = 2;
        if($list_id==$paid_list){
         $db->query($s = "DELETE FROM {$lm_db}users
         WHERE list = '$remove_list' AND email = '$member[email]';");
        }

Fingers crossed I didn't make a syntax error. :D

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

carlyn

  • Posts: 10
    • View Profile
Thank You!
« Reply #8 on: March 31, 2008, 01:05:13 pm »
I just wanted to say thank you for posting the solution to this issue. I was encountering the very same problem and your code worked perfectly (I used the code for specifically one paid list).

I'm a new user of ListMail and I'm very impressed with the power of this script - and your willingness to help customize further. Thanks!