The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Impex mod for custom field import from IBP2
I am trying to import an additional data column from my IPB 2.3.6 source. I found a number of posts on modifications to the 004.php fle in the Impex system, but none of the suggestions work for me.
First I tried the following: $this->add_custom_field($Db_target, $tdt, $ttp, 'loginname','name'); $try->add_custom_value('loginname', $user_details['name']); This didn't create the loginname column, and obviously didn't populate it. I then manually created the loginname column as varchar 255. I commented out the add_custom_field command and ran the import but no data filled the loginname column. I then tried the following: $try->add_default_value('loginname', $user_details['name']); This also resulted in no data inserted in the column. I know there is valid data in the 'name' field as it is the standard value to be imported to the username column and it is working. I'm able to change the source field going into the username column at will as well, having assigned it to members_display_name. I just cannot get the new column to populate using Impex. With no modifications to the 004.php file the import takes 30 seconds, but any changes this goes up to 120 seconds. Impex is trying to do something, but I don't know what. On this site, the only file I have edited is impex/systems/ipb2/004.php. Any suggestions? |
#2
|
|||
|
|||
I am trying to add data to a new field/column named 'loginname' in the user table.
I made some progress by dropping previous examples and hacking at it myself. In the ipb2/004.php file I made the following changes in the data assignment section at line 129: // hack // $try->set_value('mandatory', 'username', $user_details['name']); $try->set_value('mandatory', 'username', $user_details['members_display_name']); $try->set_value('mandatory', 'loginname', $user_details['name']); // end hack I also hacked the results display section at line 266 to display the new datafield 'loginname': // hack // $displayobject->display_now('<br /><span class="isucc"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['user'] . ' -> ' . $try->get_value('mandatory','username')); $displayobject->display_now('<br /><span class="isucc"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['user'] . ' -> ' . $try->get_value('mandatory','username') . ' -> ' . $try->get_value('mandatory','loginname')); // end hack Lastly, I added a record to the vbfields table for the 'loginname' field in the users table. When I REDO the user import now, the correct information is displaying on the screen, meaning both the username and loginname fields are displayed with the correct data. But I am still not getting the loginname into the users table. The set_value function working at least to the point of having the data where the get_value function can read it to be displayed. What I haven't found is the code that is updating the table. --------------- Added [DATE]1281036061[/DATE] at [TIME]1281036061[/TIME] --------------- I finally resolved my problem by finding the import_user function in the ImpExDatabaseCore.php file (not to be confused with the deceptively similar function in ImpExDatabase.php) and added the loginname field to the sql update statement. Now I get to move on and deploy my blind loginname hack and test it with the imported userdata. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|