RichieBoy67
04-13-2005, 11:33 PM
OK, we are trying to import new members from an existing pages membersign on page to a vb database...
Right now there is the following
// VBulletin account creation
$PasswordDate = date("Y-m-d");
$JoinDate = time();
OpenDB("INSERT INTO vb_user
(usergroupid, username, password, passworddate, email, usertitle, joindate, showvbcode)
VALUES
(2,'$Username',md5(md5('$Password')),'$PasswordDat e','$Email','Junior Member',$JoinDate,2)");
// save user count and new user id to template
// get total members
$result = OpenDB("SELECT COUNT(*) AS users, MAX(userid) AS max FROM vb_user");
$row = mysql_fetch_assoc($result);
$members = $row['users'];
$maxmembers = $row['max'];
$result = OpenDB("SELECT userid, username FROM vb_user WHERE userid = $maxmembers");
$row = mysql_fetch_assoc($result);
$newestusername = $row['username'];
$newuserid = $row['userid'];
// make a little array with the data
$values = array(
'numbermembers' => $members,
'newusername' => $newestusername,
'newuserid' => $newuserid
);
OpenDB("REPLACE INTO vb_datastore (title, data) VALUES ('userstats', '" . serialize($values) . "')");
// End VBulletin account creation
/* ----------------------------------- */
This seems to work somehwhat but new registrants end up being only guests. My guess is that there needs to be another querrie sending user info into the usergroup table??? Am I on the right track here???
By the way--- This current script makes the new registrants guests but to fix all that needs to be done is counter updating....
I would really, really appreciate any input on this,
Thanks so much,
Rich
Right now there is the following
// VBulletin account creation
$PasswordDate = date("Y-m-d");
$JoinDate = time();
OpenDB("INSERT INTO vb_user
(usergroupid, username, password, passworddate, email, usertitle, joindate, showvbcode)
VALUES
(2,'$Username',md5(md5('$Password')),'$PasswordDat e','$Email','Junior Member',$JoinDate,2)");
// save user count and new user id to template
// get total members
$result = OpenDB("SELECT COUNT(*) AS users, MAX(userid) AS max FROM vb_user");
$row = mysql_fetch_assoc($result);
$members = $row['users'];
$maxmembers = $row['max'];
$result = OpenDB("SELECT userid, username FROM vb_user WHERE userid = $maxmembers");
$row = mysql_fetch_assoc($result);
$newestusername = $row['username'];
$newuserid = $row['userid'];
// make a little array with the data
$values = array(
'numbermembers' => $members,
'newusername' => $newestusername,
'newuserid' => $newuserid
);
OpenDB("REPLACE INTO vb_datastore (title, data) VALUES ('userstats', '" . serialize($values) . "')");
// End VBulletin account creation
/* ----------------------------------- */
This seems to work somehwhat but new registrants end up being only guests. My guess is that there needs to be another querrie sending user info into the usergroup table??? Am I on the right track here???
By the way--- This current script makes the new registrants guests but to fix all that needs to be done is counter updating....
I would really, really appreciate any input on this,
Thanks so much,
Rich