в ucp_register.php
перед
Код: Выделить всё
}
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],Код: Выделить всё
case 'profile_sp':
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$cp = new custom_profile();
$cp_data = $cp_error = array();
$data = array(
'nick100sp' => utf8_normalize_nfc(request_var('nick100sp', $user->data['sp_nick100sp'], true)),
'fio' => utf8_normalize_nfc(request_var('fio', $user->data['sp_fio'], true)),
'tel' => request_var('tel', $user->data['sp_tel']),
'words' => utf8_normalize_nfc(request_var('words', $user->data['sp_words'], true)),
);
add_form_key('ucp_profile_sp');
if ($submit)
{
$validate_array = array(
'nick100sp' => array('string', true, 1, 100),
'fio' => array('string', true, 2, 255),
'tel' => array(
array('string', true, 3, 15),
array('match', true, '#^[0-9]+$#i')),
'words' => array('string', true, 1, 100),
);
$error = validate_data($data, $validate_array);
// validate custom profile fields
$cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error);
if (sizeof($cp_error))
{
$error = array_merge($error, $cp_error);
}
if (!check_form_key('ucp_profile_sp'))
{
$error[] = 'FORM_INVALID';
}
if (!sizeof($error))
{
$sql_ary = array(
'sp_nick100sp' => $data['nick100sp'],
'sp_fio' => $data['fio'],
'sp_tel' => $data['tel'],
'sp_words' => $data['words'],
);
$sql = 'UPDATE ' . phpbb_sp . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
// Update Custom Fields
$cp->update_profile_field_data($user->data['user_id'], $cp_data);
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'NICK100SP' => $data['nick100sp'],
'FIO' => $data['fio'],
'TEL' => $data['tel'],
'WORDS' => $data['words'],
));
// Get additional profile fields and assign them to the template block var 'profile_fields'
$user->get_profile_fields($user->data['user_id']);
$cp->generate_profile_fields('profile', $user->get_iso_lang_id());
break;после
Код: Выделить всё
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),Код: Выделить всё
'profile_sp' => array('title' => 'UCP_PROFILE_SP', 'auth' => 'acl_u_sp', 'cat' => array('UCP_PROFILE')),в ucp_profile_profile_sp.html вставил
Код: Выделить всё
<dl>
<dt><label for="nick100sp">{L_UCP_NICK100SP}:</label></dt>
<dd><input name="nick100sp" id="nick100sp" class="inputbox" maxlength="100">{NICK100SP}</></dd>
</dl>
<dl>
<dt><label for="fio">{L_UCP_FIO}:</label></dt>
<dd><input name="fio" id="fio" class="inputbox" maxlength="100">{FIO}</></dd>
</dl>Код: Выделить всё
CREATE TABLE IF NOT EXISTS `phpbb_sp` (
`sp_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`user_id` mediumint(8) unsigned NOT NULL,
`sp_login` varchar(100) COLLATE utf8_bin NOT NULL DEFAULT '',
`sp_nick100sp` varchar(30) COLLATE utf8_bin NOT NULL DEFAULT '',
`sp_tel` varchar(15) COLLATE utf8_bin NOT NULL DEFAULT '',
`sp_fio` varchar(225) COLLATE utf8_bin NOT NULL DEFAULT '',
`sp_words` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
PRIMARY KEY (`sp_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;Код: Выделить всё
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_id = 2' at line 3 [1064]
SQL
INSERT phpbb_sp SET sp_nick100sp = NULL, sp_fio = NULL, sp_tel = NULL, sp_words = NULL WHERE user_id = 2
BACKTRACE
