Our site is set up so that it simply consists of one membership level, no products per se. So we would like to make an option (preferably on the member's Profile page) where they can delete their account if they desire. We are presenting it so they must receive our email communications as long as they are a member, but if they don't want to receive our emails they need to and "can" delete their accounts. Can you give me some code to place on the member's profile page that they could hit a button and do this? Thank you, Claudia
Theres already an option to not receive email on the members page- generally a bad idea to delete an account- this is proof that they opted in to start with, in case they later claimed you are spamming them. David
here is how you can delete current logged in user in aMember: PHP: $db->delete_user($_SESSION[_amember_id]);
I want to add an Link to delete membership in useful links on member_main.html page, so that every user can delete his membership himself. Do you have an Idea to resolve this?
This can be done using get_left_member_links hook: PHP: setup_plugin_hook("get_left_member_links", "show_link");function show_link($user){ global $config; return "<a href='".$config[root_url]."/delete.php'>Delete membership</a>";}
Hello We are using 3.4.2PRO. Can you please tell me where and in which file I need to put the above code please. Thanks
Thanks, I can see the link. However what needs to be put in delete.php ? I created it and pasted this into the file $db->delete_user($_SESSION[_amember_id]); However, I get an error : Notice: Undefined variable: db in /sites/LV1VGK/amember/delete.php on line 2 Fatal error: Call to a member function delete_user() on a non-object in /sites/LV1VGK/amember/delete.php on line 2 I am no php guru sorry ! Having a delete account link on the site is a legal obligation in France, so any help you can give me would be great. Thanks
use PHP: global $db; before your code. Nedless to say to have to include amember's config.inc.php as well
Thanks I now have this : PHP: <?php$rd = dirname(__FILE__);include($rd.'/config.inc.php');global $db;$db->delete_user($_SESSION[_amember_id]);echo '<div style="text-align: center; font-family: Verdana;">Votre compte et toutes vous données ont été supprimés.<br>Cliquez <a style="font-weight: bold;"href="http://www.linuxelearning.com">ici</a> pour retourner à l\'accueil du site.<br></div>';?> And it seems to work fine Regards
Hello again We are moving to Amember v2. Can you tell me how and where to add code to get the same delete function ? Thanks in advance