• Welcome to Simple Machines Community Forum. Please login or sign up.
November 29, 2021, 05:07:55 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Custom Profile Fields

Started by ptmuldoon, March 10, 2010, 05:12:41 PM

Previous topic - Next topic

ptmuldoon

I just converted my users and forums over from phpbb3 to a SMF.   Now I have another database that has some additional user info for a game/match rankings such as wins/losses, etc.

I've setup custom user fields for this information.  Now I would like to try and import this info from my non-phpbb database into SMF.

Can anyone provide any information on creating a brief, custom import for this?  I believe I'll need to do something of the following.

Query the SMF user's table to get the user ID and name.
Query my custom table to get the user name and win/loss, etc.

Match them by name.

Than insert into the smf_themes table, the user_id, id_theme, variable (custom field) and the value of the win/loss.

I may try and start looking at this over the weekend, but any help in creating something would be helpful, and I could than modify to include the appropriate queries, etc.

And I can copy the table into the SMF database to make the connection and transfer easier as well.

Thanks
PT

Norv

Quote from: ptmuldoon on March 10, 2010, 05:12:41 PM
Query the SMF user's table to get the user ID and name.
Query my custom table to get the user name and win/loss, etc.

Match them by name.

Than insert into the smf_themes table, the user_id, id_theme, variable (custom field) and the value of the win/loss.

It sounds correct to me, the essentials to make it work seem exactly these. Will you want to use the converter for this ? You could add extra steps in the data file, but you will need to make sure you keep the format, nothing is random there, including comment-like lines and whatnot. Unfortunately there is no available documentation about the format, and the parsing in convert.php is very unforgiving to anything.
You could also run the queries manually I suppose, unless your database is huge (if you have like 100,000 members you will really want to do it with the help of convert.php and a data file, like the rest, because it makes it in chunks).

I will not be available over the weekend, but if you can use assistance I will see next week.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

ptmuldoon

Right.  I was just thinking to try and create a quick php file of the necessary queries info, and than upload it, run it, and than be set.

I'm in the complete testing and learning mode at the moment, finally getting back into learning more on php after about 2 years away from it.

Advertisement: