Skip to content

Commit

Permalink
WIP #185 edituid not converted
Browse files Browse the repository at this point in the history
MyBB, SMF 1, SMF 2
  • Loading branch information
JN-Jones committed Oct 28, 2015
1 parent 0f47a86 commit 6347355
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions boards/mybb/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function convert_data($data)
$insert_data['username'] = $this->get_import->username($data['uid'], $data['username']);
$insert_data['subject'] = encode_to_utf8($data['subject'], "posts", "posts");
$insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert($data['message']), "posts", "posts");
$insert_data['edituid'] = $this->get_import->uid($data['edituid']);
$insert_data['editreason'] = encode_to_utf8($data['editreason'], "posts", "posts");

return $insert_data;
}
Expand Down
14 changes: 7 additions & 7 deletions boards/smf/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ function convert_data($data)
}

// Get edit name
$insert_data['edituid'] = 0;
if(!empty($data['modifiedName']))
{
$query = $db->simple_select("users", "uid", "username='".$db->escape_string($data['modifiedName'])."'", array('limit' => 1));
$insert_data['edituid'] = $db->fetch_field($query, "uid");
$db->free_result($query);
}
else
{
$insert_data['edituid'] = 0;
$query = $this->old_db->simple_select('members', 'ID_MEMBER', "memberName='".$this->old_db->escape_string($data['modifiedName'])."'");
if($this->old_db->num_rows($query) == 1)
{
$insert_data['edituid'] = $this->get_import->uid($this->old_db->fetch_field($query, 'ID_MEMBER'));
}
$this->old_db->free_result($query);
}

$insert_data['edittime'] = $data['modifiedTime'];
Expand Down
14 changes: 7 additions & 7 deletions boards/smf2/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ function convert_data($data)
}

// Get edit name
$insert_data['edituid'] = 0;
if(!empty($data['modified_name']))
{
$query = $db->simple_select("users", "uid", "username='".$db->escape_string($data['modified_name'])."'", array('limit' => 1));
$insert_data['edituid'] = $db->fetch_field($query, "uid");
$db->free_result($query);
}
else
{
$insert_data['edituid'] = 0;
$query = $this->old_db->simple_select('members', 'id_member', "member_name='".$this->old_db->escape_string($data['modified_name'])."'");
if($this->old_db->num_rows($query) == 1)
{
$insert_data['edituid'] = $this->get_import->uid($this->old_db->fetch_field($query, 'id_member'));
}
$this->old_db->free_result($query);
}

$insert_data['edittime'] = $data['modified_time'];
Expand Down

0 comments on commit 6347355

Please sign in to comment.