The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Adding user profile fields with a product
Hi all,
I am creating a product that I'd like to share with the community, but it requires a user-definable option that is placed within the UserCP. It is quite easy to add this manually via the User Profile Field Manager but I'm not finding a way to automate this during installation. I did see almanni's article on Adding user options in usercp for mod's but frankly I'm still a bit confused and it doesn't seem as clean/easy as using the User Profile Field Manager. I could simply make it part of the instructions for the installation, but I would love to be able to automate it to make it easier for the community. Thanks! |
#2
|
||||
|
||||
Well, I've figured out this much on my own from tearing apart the admincp/profilefield.php script.
PHP Code:
I need to be able to know which field is created with this process so that I can reference it later within the template as well as the uninstall script. I know that it is stored during the install as $vbulletin->GPC['profilefieldid'], but is there any way I can "store" that? It would be very convenient if there was a way I could reference that variable when creating the TEMPLATE. The only thing I can think of is creating another db table that stores it, but that seems like overkill to me, and certainly isn't something I would want to add to something that hooks into the ShowThread_complete hook. Any other suggestions? |
#3
|
|||
|
|||
Create a VB Option for it and set it to hidden? And then alter it's value whilst your doing the rest of this stuff?
|
#4
|
|||
|
|||
That ^ seems like your best option imo.
Would you mind writing this up as an article once you've got it fully figured out; its something I may want to do in the future and having an easy to find reference would be great. |
#5
|
||||
|
||||
Quote:
Quote:
But yes, yes I will |
#6
|
|||
|
|||
Quote:
I've not really tried anything like it myself but looking in the DB I can see that settings you create through the method described above get added into the settings DB table. So I'd have thought you could just run a query to UPDATE the value field of the setting you create and searching by varname with whatever you call it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|