PDA

View Full Version : Impex 3.0.x > 3.5.0 -> Profilefields gone



Whissi
Sun 16th Oct '05, 10:12am
We just updated our forum, using the "clean install way" running impex.
I just noticed, that all our custom fields aren't imported...

Can you fix it please?

Jerry
Mon 17th Oct '05, 3:33pm
ImpEx only imports default data, you will have to modify the code or ideally upgrade opposed to import.

Whissi
Mon 17th Oct '05, 7:02pm
Okay. I thought it would be nice, If it would be default... but, I can do it for my own :)

schford
Tue 18th Oct '05, 2:05pm
I too need this function....I tried upgrading but ended up with a bunch of errors where as a clean import worked fine for everything other than custom profile fields.

Could anyone modify the code to help with this?

Thanks

Stuart

Jerry
Tue 18th Oct '05, 4:53pm
You'll need to enter two bits of code to import custom fields.

If you look at impex/systems/ubb_classic/003.php, lines 79 to 91 that shows you how to add the custom fields.

For example :



$tdt = $sessionobject->get_session_var('targetdatabasetype');
$ttp = $sessionobject->get_session_var('targettableprefix');

$this->add_custom_field($Db_target, $tdt, $ttp, 'pet','the pet type');
$this->add_custom_field($Db_target, $tdt, $ttp, 'name','the pet name');


(I use $tdt and $ttp to make it more readable)

You will have to add that and as many add_custom_field()'s as you need to the init function of impex/004.php.

Lines 190-193 show how the userfield data is imported in, though its custom so opposed to add_default_value() you'll have to add the lines :



$try->add_custom_value('pet', $userfield[$user_id]['field5']);
$try->add_custom_value('name', $userfield[$user_id]['field6']);


All you'll have to do is substitute "pet" and "name" for the names of your custom fields and then make sure you have the correct field numbers, i.e. field5, field6, field7 etc in the add_custom_value() call.

schford
Tue 18th Oct '05, 4:58pm
Just to check is UBB classic - right I am going from VB 3.0x to VB 3.5

thanks

Stuart

Jerry
Tue 18th Oct '05, 5:01pm
I was using ubb_classic as an example if you want to see the code in action, though the code in the post above is for a vB3.x.x import as a source.

schford
Tue 18th Oct '05, 5:04pm
ok so I make the change the number associated with VB3 - could you just explain to a simplteon what

(I use $tdt and $ttp to make it more readable) means

ta

Stuart

Jerry
Tue 18th Oct '05, 6:54pm
ok so I make the change the number associated with VB3 - could you just explain to a simplteon what

(I use $tdt and $ttp to make it more readable) means

ta

Stuart

Just copy and paste that code into the file on the lines I mentioned, the varnames aren't important.