do not end up with an error if no profile fields defined...

git-svn-id: file:///svn/phpbb/trunk@4755 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2004-01-12 13:13:00 +00:00
parent 7a7cbc14ff
commit 41e56c8fa6
2 changed files with 18 additions and 12 deletions

View file

@ -268,6 +268,8 @@ class ucp_profile extends module
$db->sql_query($sql);
// Update Custom Fields
if (sizeof($cp_data))
{
$sql = 'UPDATE phpbb_profile_fields_data
SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
WHERE user_id = ' . $user->data['user_id'];
@ -279,6 +281,7 @@ class ucp_profile extends module
$db->sql_query('INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp_data));
$db->return_on_error = false;
}
}
meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode");
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');

View file

@ -190,9 +190,12 @@ class ucp_register extends module
$user_id = $db->sql_nextid();
// Insert Custom Profile Fields
if (sizeof($cp_data))
{
$cp_data['user_id'] = (int) $user_id;
$sql = 'INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
$db->sql_query($sql);
}
// Place into appropriate group, either REGISTERED(_COPPA) or INACTIVE(_COPPA) depending on config
$group_reg = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED';