vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Qurrie Challenge... (https://vborg.vbsupport.ru/showthread.php?t=79895)

RichieBoy67 04-13-2005 11:33 PM

Qurrie Challenge...
 
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

PHP Code:

// 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')),'$PasswordDate','$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

Zachery 04-14-2005 12:46 AM

Quote:

Originally Posted by RichieBoy67
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

PHP Code:

// 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')),'$PasswordDate','$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

Are you upading the other tables? there are at LEAST 3 tables you need to insert new data into.

RichieBoy67 04-14-2005 01:17 AM

Could you please eloborate??? Members will not be registering through VBs registration page--just the sites main page... That is why I didn't think the other tables were needed......

Zachary.... Isn't there a hack somewhere that adds you to credits or something???? I am going to have to install that. You have helped me so many times!!!

Thanks!!

tnguy3n 04-14-2005 01:49 AM

I think you need to insert into passwordhistory + session table.

RichieBoy67 04-14-2005 02:00 AM

wow- I am way off on this one I guess.....

It seemed that everything worked fine after updating counters.... I thought it was just a usergroup querrie that was needed similiar to the querrie added to the user table....

Link14716 04-14-2005 03:25 AM

Quote:

Originally Posted by RichieBoy67
Could you please eloborate??? Members will not be registering through VBs registration page--just the sites main page... That is why I didn't think the other tables were needed......

Zachary.... Isn't there a hack somewhere that adds you to credits or something???? I am going to have to install that. You have helped me so many times!!!


Thanks!!

Those other tables are needed since vB always assumes the row will be there.

RichieBoy67 04-14-2005 11:12 AM

That makes sense....

Could I bother you to be more specific though and tell me which querries etc are needed????? I am very confused with all of this....

So I guess I was at least on the right track. A querrie does have to be added to usergroups but what other tables???? userfields??

Thanks

Zachery 04-14-2005 03:05 PM

user
userfield
usertextfield

I think.

RichieBoy67 04-14-2005 03:45 PM

Thanks Zachary!!

Closer than I was but still having a hard time with this.... Tough one I guess...

By any chance.... did you see my post on the other site???? Maybe you can help me there...... Should be an easy one for you.....

I'm adding you to credits tonight by the way.... you deserve it Zachary... seriously man.. I am not just kissing but... you really have helped me so many dam times...... I appreciate it man.. Thanks


All times are GMT. The time now is 09:34 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03188 seconds
  • Memory Usage 1,782KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete