The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I've created a new table in the vB database and plan to store certain information for users in it.
Is it possible to use vB's datamanager to input data into it? i.e. similar to the code below - or do I need to use plain MySQL and php to enter it? If anyone could point me in the right direction I'd be very grateful. PHP Code:
|
#2
|
|||
|
|||
![]()
It looks like you could almost - but not quite - use plugins to modify the user data manager to handle fields in another table. The problem seems to me to be the do_set() function (in includes/class_dm_user.php, around line 1587). There's a hook (userdata_doset) that could be used to set the table that a custom field is in, but unfortunately the code below that seems to depend on the class having a variable named the same as the table ([S]and I don't believe you can add a variable to a class via a plugin[/S] - oops, see below).
There still maybe some way to use the existing hooks to get your values saved at the same time as the existing user tables, I just don't see a way to make it work the same as the other tables. Edit: Actually, I'm embarrassed to say that I appear to be completely wrong - it looks like you can add a variable to an object just by setting it. So, you should be able to use hook userdata_start to add your valid fields to the $validfields array, then use hook userdata_doset to add your table to the tables array if $fieldname is one of your fields. There may be other things you have to do to get it to work - I haven't actually tried it all yet. |
#3
|
|||
|
|||
![]()
Thank you
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|