2009-11-19, 04:00 PM
Current Beta 5 doesn't support user avatars when merging from phpbb3. This patch fixes it.
(You can download attachment instead off editing code manually but you still need to copy images - steps 4. and 5.)
1. In file covnert/boards/phpbb3/users.php after this (line 37):
2. In file covnert/boards/phpbb3/users.php after this (line 84):
3. In file covnert/boards/phpbb3/users.php replace this (line 101):
4. Copy all directories from PHPBB3_ROOT/images/avatars/gallery/ to MYBB_ROOT/images/avatars/ (only if you used galleries in phpbb3)
5. Copy all files from PHPBB3_ROOT/images/avatars/upload/ to MYBB_ROOT/uploads/avatars/
(You can download attachment instead off editing code manually but you still need to copy images - steps 4. and 5.)
1. In file covnert/boards/phpbb3/users.php after this (line 37):
// Get number of members
if(!isset($import_session['total_users']))
{
$query = $this->old_db->simple_select("users", "COUNT(*) as count", "user_id > 0 AND username != 'Anonymous' AND group_id != 6");
$import_session['total_users'] = $this->old_db->fetch_field($query, 'count');
$this->old_db->free_result($query);
}
Add this: if(!isset($import_session['phpbb3_avatar_salt']))
{
$query = $this->old_db->simple_select("config", "config_value", "config_name = 'avatar_salt'", array('limit' => 1));
$import_session['phpbb3_avatar_salt'] = $this->old_db->fetch_field($query, 'config_value');
$this->old_db->free_result($query);
}
2. In file covnert/boards/phpbb3/users.php after this (line 84):
function convert_data($data)
{
Add this: global $import_session;
3. In file covnert/boards/phpbb3/users.php replace this (line 101):
$insert_data['avatardimensions'] = $data['user_avatar_width'].'|'.$data['user_avatar_height'];
if($insert_data['avatardimensions'] == '0x0')
{
$insert_data['avatardimensions'] = '';
}
$insert_data['avatar'] = $data['avatar'];
With this: switch($data['user_avatar_type'])
{
case 1:
$insert_data['avatartype'] = 'upload';
$insert_data['avatar'] = './uploads/avatars/'.$import_session['phpbb3_avatar_salt'].'_'.intval($data['user_avatar']).strrchr($data['user_avatar'],'.');
$insert_data['avatardimensions'] = $data['user_avatar_width'].'|'.$data['user_avatar_height'];
break;
case 2:
$insert_data['avatartype'] = 'remote';
$insert_data['avatar'] = $data['user_avatar'];
$insert_data['avatardimensions'] = $data['user_avatar_width'].'|'.$data['user_avatar_height'];
break;
case 3:
$insert_data['avatartype'] = 'gallery';
$insert_data['avatar'] = 'images/avatars/'.$data['user_avatar'];
$insert_data['avatardimensions'] = $data['user_avatar_width'].'|'.$data['user_avatar_height'];
break;
}
4. Copy all directories from PHPBB3_ROOT/images/avatars/gallery/ to MYBB_ROOT/images/avatars/ (only if you used galleries in phpbb3)
5. Copy all files from PHPBB3_ROOT/images/avatars/upload/ to MYBB_ROOT/uploads/avatars/