Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: ptmuldoon on March 10, 2010, 05:12:41 PM

Title: Custom Profile Fields
Post by: ptmuldoon on March 10, 2010, 05:12:41 PM
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
Title: Re: Custom Profile Fields
Post by: Norv on March 11, 2010, 05:27:33 PM
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.
Title: Re: Custom Profile Fields
Post by: ptmuldoon on March 11, 2010, 09:15:03 PM
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.