Adding a user manually

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bkbelew
    New Member
    • Sep 2004
    • 9

    Adding a user manually

    I have seen a few people trying to do this, but haven't seen any code to do it successfully. I built a cms, i'm trying to make it where when a user is added they are automatically added to the vbulletin database. No matter what I try I cannot get it to work. Any ideas anyone?

    Thank you

    Code:
    PHP Code:
     require('inc/admins/forumconnect.php');

     
    $saltlength 3;
     
    $salt '';
     for (
    $i 0$i $saltlength$i++)
     
    $salt .= chr(rand(32126));


      
    $pass md5(md5($password) . $salt);

    $date strtotime("now");
    $forumquery mysql_query("INSERT INTO user ( username, password, email, usergroupid, options, passworddate, salt ) 
                                   VALUES('
    $username','$pass','$email','2','7','$date','$salt')");

    // Get userid

        
    $clientquery mysql_query("SELECT * FROM user WHERE username = '$username' ");
        
       while (
    $client mysql_fetch_array($client_query)) {


    // Insert the users userid into the userfield table

     
    $userfield mysql_query("INSERT INTO userfield ( userid, field1 ) 
                                   VALUES('
    $client[userid]','NULL')");


    // Insert the users userid into the usertextfield table

     
    $usertextfield mysql_query("INSERT INTO usertextfield ( userid, subfolders, pmfolders, buddylist, ignorelist, signature, searchprefs ) 
                                    VALUES('
    $client[userid]','NULL','NULL','NULL','NULL','NULL','NULL')");



  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    We do not provide official support for custom coding. However you can try asking for this kind of help over at the vB mod site: http://www.vbulletin.org/forum/
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...