Greetings. I'm setting up Paypal automation on my nuke site. My Instant Payment Notification (IPN) script does the following things:
1. Recieves Secure Payment Info from Paypal
2. Checks to see if it is a new subscription, a renewal, or a cancellation.
3. Generates a new username/key for our software if none already
4. Adds username/key to our auth database
5. Email the buyer the username/key and confirmation of their subscription/renewal/cancellation.
6. Add user to the VIP forum user group
I am having problem with #6; understanding what needs to be done to add user to the user group to get immediate access to our private forum.
Here is the code I am using:
$sql = 'SELECT * FROM `nuke_user_group` ug, `nuke_users` u'
. ' WHERE u.user_id = $user_id'
. ' AND ug.user_id = u.user_id'
. ' AND ug.group_id = $group_id'
. ' LIMIT 0 , 1';
$groupresult = mysql_query($sql);
$sql = 'INSERT INTO `nuke_user_group` (user_id, group_id, user_pending) VALUES ($userid,$group_id,0)';
I based my sql query's off the ones i found in the Add action of the groupcp.php file in the forums module.
I checked and verified that a new row is generated in the nuke_user_groups table, but that is the only record in the table, and my test forum account was not added to the group (according to nuke).
I'm using Nuke Platinum, don't know if that makes a difference.
I did find what appear to be the actual group records stored in nuke_bbgroups, and i would use that table except it doesn't have the same fields as what is used in groupcp.php.
Rows for nuke_users_group:
(which correspond to the sql queries used in groupcp.php)
Rows for nuke_bbgroups:
So I'm guessing that the nuke_user_group table is a table for pending user additions, so what other transaction am I missing to make my account actually appear in this forum group?
Wed Nov 02, 2005 2:57 am
Nevermind... found the real table: nuke_bbuser_group