The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to SQL auto add profile field?
I want write plugin (SQL cmd) auto add profile field to Profile Field Manager
|
#2
|
|||
|
|||
Code:
INSERT INTO `profilefield` (`profilefieldid`, `profilefieldcategoryid`, `required`, `hidden`, `maxlength`, `size`, `displayorder`, `editable`, `type`, `data`, `height`, `def`, `optional`, `searchable`, `memberlist`, `regex`, `form`, `html`, `perline`) VALUES ('5', '0', '0', '0', '250', '25', '5', '1', 'input', '', '0', '0', '0', '1', '1', '', '0', '0', '0') |
Благодарность от: | ||
Easy5s.net |
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
maybe you should google the answers before you start this way you will learn more
|
#5
|
|||
|
|||
The best thing might be to look at the file admincp/profilefield.php, around line 400, the section that starts like this:
Code:
// ###################### Start Insert / Update ####################### if ($_POST['do'] == 'update') { In a nutshell, it looks like you have to add a row to the profilefield table (sort of like is shown above in ForceHSS's post except the value for profilefieldid should be NULL). Then add a column to the userfield table using the profilefieldid that was generated by the row you inserted (which you can get it by calling $db->insert_id()) to create the column name. Then you need to add two phrases to the phrase table, one for the title and one for the description (also using the profilefieldid to create the names). Like I mentioned, it's probably best to look at that file. The values for the profilefield table depends on what type the field is, and there's a fetch_query_sql() function that builds the sql from the form parameters, so that might be a little complicated to figure out. But if you're only interested in creating one specific field (like when installing a product), then you could create the field then copy the values from the database (but use NULL in place of the profielfieldid). I know that was long, but I hope it makes some sense. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|