The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
In the vB announcements forum, it says: "Naturally, plugins can attach themselves to the data managers, allowing you to add code that runs before or after saving, or even to add new fields."
Has anyone figured out the add new fields bit yet? |
#2
|
||||
|
||||
![]()
Nope, as far as I can see you have to hack the DM class(s) to add new fields, if this is not the case then someone please tell me how to do it, because I have had to do it this way.
|
#3
|
||||
|
||||
![]()
For every Datamanager there is a name_start Hook where you can add custom fields.
Example for the User Datamanager : Hook: userdata_start Code: PHP Code:
|
#4
|
||||
|
||||
![]()
endquote,
You are currently showing up as unlicensed. To be able to download hacks and/or receive support here at vBulletin.org, we ask you to please click here (vB-germany users click here) and enter your email address, to show us that you are licensed. You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive. The update of your account may take up to one hour. Thank you. |
#5
|
|||
|
|||
![]() Quote:
|
#6
|
||||
|
||||
![]() Quote:
Code:
$this->validfields['myfield'] = array(TYPE_STR, REQ_NO[high], 'if ($data != 'notallowed') { return true; } else {return false; }')[/high]); |
#7
|
||||
|
||||
![]()
Right. Slight mistake on my end.
But at least I was willing to post the correct code ![]() Of course the fieldname must be the key. |
#8
|
|||
|
|||
![]()
Finally got some license issues sorted out so now I can view the code.
![]() Another question would be... I don't suppose there's any way to automatically add fields to the actual db tables with a plugin? At least not without checking if the field was there every time your DM ran, which would be dumb. Can that be done with the "plugin definitions xml file"? I haven't really looked into that yet. |
#9
|
|||
|
|||
![]()
Sounds like you'll have to get the user to manually run an install script or query unfortunatly.
Its a good idea to be able to add "run once" queries though. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|