The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Registration fields INSERT into another dbase also?
I would like for my custom fields that I have added through the admin cp to INSERT into my custom database upon registration.
I have successfully hacked into the register.php and the functions_login.php to get it all to work on the 'pre-defined' fields...but the custom fields seems to have an array code that is over my head. Basically, I have only added firstname and lastname fields, and I have another table in my database that is customized to use for my classifieds section, which is running a different custom software. I am able to INSERT the username and password just fine tapping into the vBullein->userinfo stuff...and the GPC array. However, my problem is it seems like the custom stuff is all inserted into one array and then that full array is inserted into the vb_ table all at once... I know how to summon on row of an array using array['desiredinfo'] syntax... but what if the desiredinfo is an array ?? seems like I want something like array['desiredinfoArray']['desired_info_inside_this_array'] OR alternatively -- can someone just give me the best way to have the registration custom added fields be INSERTed into the vb database, AND into another database upon registration.... thanks. |
#2
|
|||
|
|||
I need to know this also. No one on forums seems to know how, it's been asked several times.
|
#3
|
|||
|
|||
Well, I just finally solved this on my own.
I am so used to the phpBB open source world where every user is so helpful and everyone works so well together.... the catch is they NEED to be, cuz the software requires all that help...hahaha. I love this vBulletin deal --- MUCHO.... $vbulletin->GPC['userfield']["field5"] $vbulletin->GPC['userfield']["field6"] are the values you need to insert for your custom fields...assuming these are the first two cusstom fields you added.... for me it was 5 -= first name and 6 =- last name and I inserted them into another database table upon regisration....so they hit userfield5 and 6 in the vb_userfield tables....or usertext not sure which.... and they also hit my database table PHP Code:
|
#4
|
|||
|
|||
Can you explain where to put this??
Sorry, new to vbulletin ways of doing things and this is something I need to do asap. Thanks in advance |
#5
|
|||
|
|||
register.php starting around line 307
PHP Code:
Hope you understand the sprintf php command - if not do a google for sprintf and php.... |
#6
|
|||
|
|||
There is no need to modify vbulletin's files to achieve this. vB have a hook system of which allows you to execute external code at many different locations within vB's files, such as the registration or activation process.
See: What is a hook? With regard to adding custom fields to a seperate db table upon registration - all you need to do is add a plug-in at the correct hook location (via the AdminCP), and include the code you wish to run. In this instance, you would add a hook at the following location: "register_addmember_complete" and include the database code you wish to run. Similarly, if you only want to copy user details upon activation, you would use the hook, "register_activate_process". Hope this helps! |
#7
|
|||
|
|||
DUDE --- WHERE HAVE YOU BEEN!!!! This is great information....I am so used to OSCommerce and phpBB -- just hacking away at the actual code ---
MarkPW's way sounds much much better!!! |
#8
|
|||
|
|||
No problem
|
#9
|
|||
|
|||
One more quick one -- this has revolutionized my thinking, but I cannot quite wrap my head around it....
So I go to Add New Plugin--- and insert my custom php code in that box on that screen, and toggle the drop down to the location I want....and that is it?? Do I need to add a product or anything like that? I am thinking I am going to remove all my customizations from the register.php and the functions_login.php files and put them in hooks so I can upgrade easier... But I am not quite comprehending the whole process. I think it is so simple, I am just having a hard time believing it. I attached a pdf screen grab of the page I am talking about. No chance you could just walk me through a very simple one from start to finish... something like, add this 123TEXT to this HOOK location and then watch the page refresh and see your text.... REALLY appreciate.... |
#10
|
|||
|
|||
Please do tell..we (a group) are trying to accomplish this very task.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|