You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 258 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Adding User to Group via SQL [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
smirl.Reverend
Guest






PostPosted: Wed Nov 02, 2005 2:45 am Reply with quoteBack to top

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:
Code:

$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);
if (!mysql_num_rows($groupresult))
{
   $sql = 'INSERT INTO `nuke_user_group` (user_id, group_id, user_pending) VALUES ($userid,$group_id,0)';
   mysql_query($sql);
}


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:
group_id
user_id
user_pending
(which correspond to the sql queries used in groupcp.php)

Rows for nuke_bbgroups:
group_id
group_type
group_name
group_description
group_moderator
group_single_user

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?
Find all posts by Anonymous
Guest







PostPosted: Wed Nov 02, 2005 2:57 am Reply with quoteBack to top

Nevermind... found the real table: nuke_bbuser_group
Find all posts by Anonymous
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-friendly view
View previous topic Log in to check your private messages View next topic
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.036 Seconds - 430 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::