Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Mesum
Useless


Joined: Aug 23, 2002
Posts: 213
Location: Chicago

PostPosted: Thu Jan 20, 2005 3:23 pm Reply with quote

OK, this is another problem that I am having while playing with aMember, NSN Groups and 7.4.

aMember adds the new user to database just fine but won't let me add same user to NSN Groups.
This is what I have so far, I am doing something wrong?

Code:


function phpnuke_added($member_id, $product_id,
    $member){
    global $db, $config, $plugin_config;
    $product = get_product($product_id);
    if (!$product->config['phpnuke_access']) return;
   
    $this_config = $plugin_config['protect']['phpnuke'];
    $nuke_db = $this_config['db'];

    $q = $db->query("SELECT user_password, user_level
    FROM {$nuke_db}users
    WHERE username='$member[login]'
    ");
    $mm = $member;
    list($p,$ul) = mysql_fetch_row($q);
    foreach ($member as $k=>$v)
        $member[$k] = $db->escape($v);
    $dat = date('M d, Y');
    $pass = md5($member['pass']);
    if (!$ul){ //user not exists
        $db->query($s = "INSERT INTO {$nuke_db}users
        (name, username, user_email, user_regdate, user_password, storynum,
        commentmax, user_level, broadcast)
        VALUES
        ('$member[name_f] $member[name_l]',
         '$member[login]',
         '$member[email]', '$dat',
         '$pass',
         10, 4096, 1, 1
         )
        ");
      $db->query($s = "INSERT INTO {$nuke_db}nsngr_users
      (gid, uid, uname, email, sdate, edate)
      VALUES
      ($gid, $n_user_id, '$l', '$e', '{$nuke_start[$gid]}', '$expire')");
    } else {
        $db->query($s = "UPDATE {$nuke_db}users
        SET user_password='$pass',
        user_email='$user_email'
        WHERE username='$member[login]'
        ");
    }
    phpnuke_update_membership($mm);
#    print "Added: $member[login] ";
}

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
BobMarion
Former Admin in Good Standing


Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Fri Jan 21, 2005 2:56 am Reply with quote

I don't have it therefore I can't truely guide in building the proper queries. What you have looks like it should work but I have no way of testing it to see for sure.

_________________
Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©