Help making a profile selection box

Started by nay27uk, August 06, 2009, 07:26:01 PM

Previous topic - Next topic

nay27uk

Hi all i have added a table to the database called smf_countries that has countries in it.
Im now trying to create the profile field in admin but am stuck with the code to put in the option field to pull the information from the smf_countries table.

Could anyone give me the code i need to enter as the first option to pull the data from the smf_countries table in the database

Tyrsson

I am kinda lost. This is a default feature in 2.0. Just enable custom profile fields and configure it as you wish in the admincp.

admincp>Core features (To enable)

After you have enabled them just click on the title in the same screen and will redirect you to the configuration area :)

Or am I missing something?
PM at your own risk, some I answer, if they are interesting, some I ignore.

nay27uk

#2
Quote from: Tyrsson on August 06, 2009, 07:38:48 PM
I am kinda lost. This is a default feature in 2.0. Just enable custom profile fields and configure it as you wish in the admincp.

admincp>Core features (To enable)

After you have enabled them just click on the title in the same screen and will redirect you to the configuration area :)

Or am I missing something?

What I am saying is I alredy have custom profile fields  turned on in admin I have been to it and entered all the info and chose a type as selection box I then have to add the selections to it, I want some code to put in that first selection field that will pull the data from a table I created in my database called smf_countries as there is nothing in the creation of the custom profile fields for selecting data from a table in the data base.

Basicaly Im trying to make a dropdown and populate it from the database so I can use this instead of the current text based LOCATION

Arantor

Short of completely rewriting the custom profile setup, you would just be quicker filling the details in the Custom Profile Field screen.

nay27uk

oh poo im not having much luck tonight, what a tedious job filling all thoes countries out

Arantor


nay27uk

Quote from: Arantor on August 06, 2009, 08:41:30 PM
But you only have to do it once.

Thats true i may release this as a mod for others that wish to use it

Arantor

Except that that would be prohibitively difficult to do. (And I really mean that, speaking as a mod author myself)

nay27uk


Arantor

It makes no difference, whether you publish it as a tip or a mod, it's not substantively more difficult to package a tip into a mod.

If you want to document modifying the custom profile setup severely, go for it, but in reality it's a modification that will likely take longer to perform than to simply enter the data unless you have thousands of entries, in which case a dropdown box is neither recommended nor the most efficient solution.

Advertisement: