Hi.. I have a huge site, a part of it is aMember I wanted to add the USEFUL links which is in member.html into my PHP based sidebar. So that the links will be available anytime on the sidebar. What file I must include and what is the code to get it done? Regs Jawahar
Probably easiest to use HTML code. You can use sessions to see if the user is logged in and then add the links. http://manual.amember.com/AMember_Session_Variables David
Hi David.. I wanted to add the affiliate page link. The Session variables cannot say if the user is an affiliate right?? Regs Jawahar
No, I dont think it is included in session info. I think you'll need to access the database then. include "/home/yoursite/public_html/amember/config.inc.php"; global $db; table amember_members field is_affiliate 1 is for an affiliate David
Hi David I have added it to session like this(in login.php page): $u = $db->get_user($_SESSION['_amember_user']['member_id']); if ($u['is_affiliate'] == '0') { $_SESSION['_amember_member_is_affiliate']='0'; } else { $_SESSION['_amember_member_is_affiliate']='1'; } Regs Jawahar
We must also replace this function in aff.php .. This will ensure that if the link is clicked to enable Affiliate Program, the session is set.. function enable_aff($member_id){ global $db, $config; if ($config['aff']['signup_type'] == 2) return; // signup disabled in config $u = $db->get_user($member_id); $u['is_affiliate'] = 1; $db->update_user($member_id, $u); $_SESSION['_amember_member_is_affiliate']='1'; $_SESSION['_amember_member_links'] = array(); $_SESSION['_amember_member_links'][] = plugin_get_member_links($_SESSION['_amember_user']); return true; }