The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
how can add new field by db code
hello,
I have this code in my plugin: PHP Code:
and another thing : I want displayorder column = profilefieldid like when I add a field by admincp/profilefield.php I try to insert phrase to be like this: varname: fieldx_title (which x is field id but I don't know how to find it) fieldname: cprofilefield I need help please |
#2
|
||||
|
||||
Did you try looking at the code that vb uses when creating a profile field?
After you insert the profilefield, you may grab the profilefield id: PHP Code:
|
#3
|
||||
|
||||
you are great Lynne
thanks a lot --------------- Added [DATE]1234846546[/DATE] at [TIME]1234846546[/TIME] --------------- I have another problem if I want to delete these rows I will use this: PHP Code:
is that becuase $id is not recognized ? cause the first code in install code section and this one in uninstall code ? |
#4
|
||||
|
||||
$id just grabs the id of the last row entered into the database. So, you can only use it if you just added a row into the database and then grabbed the id of that row. Install and Uninstall queries are not run one after the other. They are totally separate because you are either installing or uninstalling.
|
#5
|
||||
|
||||
ok, but I need that id to use it with other plugin in my product is there an method to save it?
like $myid = $id ? |
#6
|
||||
|
||||
The ID is usually provided by the user or another database field (e.g. a user clicking a link). Not sure what you're trying to achieve.
|
#7
|
||||
|
||||
hi Dismounted and thanx
I want to build a user field automaticly when my product is uploaded via plugins system. I success to build it gree Lynne. Now I can't use the information inside the field if I don't know the id? you got it! I succeed to build a full field with title and desc because id help me .. now I want that id to be with me all the time not just after added a row.. This is my problem. |
#8
|
||||
|
||||
It sounds like you will have to do a query to ask what the field id is before you go and delete the fields.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|