mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
r92
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@92 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
2da966d918
commit
11ee986643
7 changed files with 263 additions and 140 deletions
|
@ -57,8 +57,8 @@ $bb_cfg['css_ver'] = 1;
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.0.2';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r90';
|
||||
$bb_cfg['tp_release_date'] = '05-07-2011';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r92';
|
||||
$bb_cfg['tp_release_date'] = '11-07-2011';
|
||||
|
||||
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
||||
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";
|
||||
|
@ -297,7 +297,6 @@ $bb_cfg['last_visit_update_intrv'] = 3600; // sec
|
|||
$bb_cfg['new_user_reg_disabled'] = false; // Disable new user registrations
|
||||
$bb_cfg['unique_ip'] = false; // Deny registration of several accounts by one ip
|
||||
$bb_cfg['new_user_reg_restricted'] = false;
|
||||
$bb_cfg['reg_email_activation'] = false;
|
||||
|
||||
// Email
|
||||
$bb_cfg['emailer_disabled'] = false;
|
||||
|
|
|
@ -19,7 +19,7 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$
|
|||
$joined = bb_date($row['user_regdate'], $date_format);
|
||||
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
|
||||
|
||||
$poster_avatar = get_avatar($row['user_avatar'], $row['user_avatar_type'], !bf($row['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
//$poster_avatar = get_avatar($row['user_avatar'], $row['user_avatar_type'], !bf($row['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
|
||||
if ( bf($row['user_opt'], 'user_opt', 'viewemail') || $group_mod )
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ set_die_append_msg();
|
|||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$bb_cfg['reg_email_activation'] = false;
|
||||
$bb_cfg['require_activation'] = false;
|
||||
}
|
||||
|
||||
$can_register = (IS_GUEST || IS_ADMIN);
|
||||
|
@ -50,7 +50,7 @@ switch ($mode)
|
|||
}
|
||||
|
||||
// Отключение регистрации
|
||||
if ($bb_cfg['new_user_reg_disabled'] || ($bb_cfg['reg_email_activation'] && $bb_cfg['emailer_disabled']))
|
||||
if ($bb_cfg['new_user_reg_disabled'])
|
||||
{
|
||||
bb_die($lang['NEW_USER_REG_DISABLED']);
|
||||
}
|
||||
|
@ -101,13 +101,15 @@ switch ($mode)
|
|||
|
||||
// field => can_edit
|
||||
$profile_fields = array(
|
||||
'username' => IS_ADMIN,
|
||||
'username' => (IS_ADMIN || $bb_cfg['allow_namechange']),
|
||||
'user_password' => true,
|
||||
'user_email' => true, // должен быть после user_password
|
||||
'user_lang' => true,
|
||||
'user_gender' => true,
|
||||
'user_timezone' => true,
|
||||
'user_opt' => true,
|
||||
'user_email' => true, // должен быть после user_password
|
||||
'user_icq' => true,
|
||||
'user_skype' => true,
|
||||
'user_website' => true,
|
||||
'user_from' => true,
|
||||
'user_sig' => true,
|
||||
|
@ -132,6 +134,7 @@ switch ($mode)
|
|||
SELECT
|
||||
user_id,
|
||||
user_level,
|
||||
user_active,
|
||||
$profile_fields_sql
|
||||
FROM ". BB_USERS ."
|
||||
WHERE user_id = $pr_user_id
|
||||
|
@ -144,7 +147,7 @@ switch ($mode)
|
|||
|
||||
include(INC_DIR . 'ucp/usercp_avatar.php');
|
||||
|
||||
if ( !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar') && ( $bb_cfg['allow_avatar_upload'] || $bb_cfg['allow_avatar_local'] || $bb_cfg['allow_avatar_remote'] ) )
|
||||
if (!bf($pr_data['user_opt'], 'user_opt', 'allow_avatar') && ($bb_cfg['allow_avatar_upload'] || $bb_cfg['allow_avatar_local'] || $bb_cfg['allow_avatar_remote']))
|
||||
{
|
||||
$template->assign_block_vars('switch_avatar_block', array() );
|
||||
|
||||
|
@ -164,6 +167,10 @@ switch ($mode)
|
|||
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_block_vars('not_avatar_block', array() );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -286,11 +293,7 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
{
|
||||
if ($mode == 'register')
|
||||
{
|
||||
if (empty($email))
|
||||
{
|
||||
$errors[] = 'Вы должны указать e-mail';
|
||||
}
|
||||
if (!$errors AND $err = validate_email($email))
|
||||
if ($err = validate_email($email))
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
|
@ -300,12 +303,13 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
{
|
||||
if (!$cur_pass_valid)
|
||||
{
|
||||
$errors[] = 'Для изменения e-mail вы должны правильно указать текущий пароль';
|
||||
$errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
|
||||
}
|
||||
if (!$errors AND $err = validate_email($email))
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
$pr_data['user_active'] = '';
|
||||
$db_data['user_email'] = $email;
|
||||
}
|
||||
}
|
||||
|
@ -317,7 +321,7 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
*/
|
||||
case 'user_lang':
|
||||
$user_lang = isset($_POST['user_lang']) ? (string) $_POST['user_lang'] : $pr_data['user_lang'];
|
||||
if ($submit)
|
||||
if ($submit && $user_lang != $pr_data['user_lang'])
|
||||
{
|
||||
$pr_data['user_lang'] = $user_lang;
|
||||
$db_data['user_lang'] = $user_lang;
|
||||
|
@ -329,7 +333,7 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
*/
|
||||
case 'user_timezone':
|
||||
$user_timezone = isset($_POST['user_timezone']) ? (int) $_POST['user_timezone'] : $pr_data['user_timezone'];
|
||||
if ($submit)
|
||||
if ($submit && $user_timezone != $pr_data['user_timezone'])
|
||||
{
|
||||
if (isset($lang['TZ'][$user_timezone]) && $user_timezone != $pr_data['user_timezone'])
|
||||
{
|
||||
|
@ -339,6 +343,19 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* Язык (edit, reg)
|
||||
*/
|
||||
case 'user_gender':
|
||||
$gender = isset($_POST['user_gender']) ? (int) $_POST['user_gender'] : $pr_data['user_gender'];
|
||||
if ($submit && $gender != $pr_data['user_gender'])
|
||||
{
|
||||
$pr_data['user_gender'] = $gender;
|
||||
$db_data['user_gender'] = $gender;
|
||||
}
|
||||
$tp_data['USER_GENDER'] = build_select('user_gender', $lang['GENDER_SELECT'], $pr_data['user_gender']);
|
||||
break;
|
||||
|
||||
/**
|
||||
* opt (edit)
|
||||
*/
|
||||
|
@ -372,20 +389,17 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
*/
|
||||
case 'user_icq':
|
||||
$icq = isset($_POST['user_icq']) ? (string) $_POST['user_icq'] : $pr_data['user_icq'];
|
||||
if ($submit)
|
||||
if ($submit && $icq != $pr_data['user_icq'])
|
||||
{
|
||||
if ($icq != $pr_data['user_icq'])
|
||||
if ($icq == '' || preg_match('#^\d{6,15}$#', $icq))
|
||||
{
|
||||
if ($icq == '' || preg_match('#^\d{6,15}$#', $icq))
|
||||
{
|
||||
$pr_data['user_icq'] = $icq;
|
||||
$db_data['user_icq'] = (string) $icq;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_data['user_icq'] = '';
|
||||
$errors[] = htmlCHR('Поле "ICQ" может содержать только номер icq');
|
||||
}
|
||||
$pr_data['user_icq'] = $icq;
|
||||
$db_data['user_icq'] = (string) $icq;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_data['user_icq'] = '';
|
||||
$errors[] = htmlCHR('Поле "ICQ" может содержать только номер icq');
|
||||
}
|
||||
}
|
||||
$tp_data['USER_ICQ'] = $pr_data['user_icq'];
|
||||
|
@ -397,20 +411,16 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
case 'user_website':
|
||||
$website = isset($_POST['user_website']) ? (string) $_POST['user_website'] : $pr_data['user_website'];
|
||||
$website = htmlCHR($website);
|
||||
if ($submit)
|
||||
if ($submit && $website != $pr_data['user_website'])
|
||||
{
|
||||
if ($website != $pr_data['user_website'])
|
||||
if ($website == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $website))
|
||||
{
|
||||
if ($website == '' || preg_match('#^https?://[a-z0-9_:;?&=/.%~\-]+$#i', $website))
|
||||
{
|
||||
$pr_data['user_website'] = $website;
|
||||
$db_data['user_website'] = (string) $website;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_data['user_website'] = '';
|
||||
$errors[] = htmlCHR('Поле "Сайт" может содержать только http:// ссылку');
|
||||
}
|
||||
$pr_data['user_website'] = $website;
|
||||
$db_data['user_website'] = (string) $website;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = htmlCHR('Поле "Сайт" может содержать только http:// ссылку');
|
||||
}
|
||||
}
|
||||
$tp_data['USER_WEBSITE'] = $pr_data['user_website'];
|
||||
|
@ -422,13 +432,10 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
case 'user_from':
|
||||
$from = isset($_POST['user_from']) ? (string) $_POST['user_from'] : $pr_data['user_from'];
|
||||
$from = htmlCHR($from);
|
||||
if ($submit)
|
||||
if ($submit && $from != $pr_data['user_from'])
|
||||
{
|
||||
if ($from != $pr_data['user_from'])
|
||||
{
|
||||
$pr_data['user_from'] = $from;
|
||||
$db_data['user_from'] = (string) $from;
|
||||
}
|
||||
$pr_data['user_from'] = $from;
|
||||
$db_data['user_from'] = (string) $from;
|
||||
}
|
||||
$tp_data['USER_FROM'] = $pr_data['user_from'];
|
||||
break;
|
||||
|
@ -438,9 +445,9 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
*/
|
||||
case 'user_sig':
|
||||
$sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
|
||||
if ($submit)
|
||||
if ($submit && $sig != $pr_data['user_sig'])
|
||||
{
|
||||
$sig_esc = prepare_message($sig);
|
||||
$sig = prepare_message($sig);
|
||||
|
||||
if (mb_strlen($sig) > $bb_cfg['max_sig_chars'])
|
||||
{
|
||||
|
@ -450,11 +457,9 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
{
|
||||
$errors[] = $lang['SIGNATURE_ERROR_HTML'];
|
||||
}
|
||||
else if ($sig != $pr_data['user_sig'])
|
||||
{
|
||||
$pr_data['user_sig'] = $sig;
|
||||
$db_data['user_sig'] = (string) $sig;
|
||||
}
|
||||
|
||||
$pr_data['user_sig'] = $sig;
|
||||
$db_data['user_sig'] = (string) $sig;
|
||||
}
|
||||
$tp_data['USER_SIG'] = $pr_data['user_sig'];
|
||||
break;
|
||||
|
@ -465,13 +470,10 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
case 'user_occ':
|
||||
$occ = isset($_POST['user_occ']) ? (string) $_POST['user_occ'] : $pr_data['user_occ'];
|
||||
$occ = htmlCHR($occ);
|
||||
if ($submit)
|
||||
if ($submit && $occ != $pr_data['user_occ'])
|
||||
{
|
||||
if ($occ != $pr_data['user_occ'])
|
||||
{
|
||||
$pr_data['user_occ'] = $occ;
|
||||
$db_data['user_occ'] = (string) $occ;
|
||||
}
|
||||
$pr_data['user_occ'] = $occ;
|
||||
$db_data['user_occ'] = (string) $occ;
|
||||
}
|
||||
$tp_data['USER_OCC'] = $pr_data['user_occ'];
|
||||
break;
|
||||
|
@ -482,17 +484,32 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
case 'user_interests':
|
||||
$interests = isset($_POST['user_interests']) ? (string) $_POST['user_interests'] : $pr_data['user_interests'];
|
||||
$interests = htmlCHR($interests);
|
||||
if ($submit)
|
||||
if ($submit && $interests != $pr_data['user_interests'])
|
||||
{
|
||||
if ($interests != $pr_data['user_interests'])
|
||||
{
|
||||
$pr_data['user_interests'] = $interests;
|
||||
$db_data['user_interests'] = (string) $interests;
|
||||
}
|
||||
$pr_data['user_interests'] = $interests;
|
||||
$db_data['user_interests'] = (string) $interests;
|
||||
}
|
||||
$tp_data['USER_INTERESTS'] = $pr_data['user_interests'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Skype
|
||||
*/
|
||||
case 'user_skype':
|
||||
$skype = isset($_POST['user_skype']) ? (string) $_POST['user_skype'] : $pr_data['user_skype'];
|
||||
if ($submit && $skype != $pr_data['user_skype'])
|
||||
{
|
||||
if ( !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype))
|
||||
{
|
||||
$errors[] = $lang['SKYPE_ERROR'];
|
||||
}
|
||||
|
||||
$pr_data['user_skype'] = $skype;
|
||||
$db_data['user_skype'] = (string) $skype;
|
||||
}
|
||||
$tp_data['USER_SKYPE'] = $pr_data['user_skype'];
|
||||
break;
|
||||
|
||||
case 'user_avatar':
|
||||
case 'user_avatar_type':
|
||||
if( isset($_POST['avatargallery']) && !$errors )
|
||||
|
@ -636,16 +653,20 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
}
|
||||
|
||||
if($avatar)
|
||||
{
$user_avatar = $avatar['user_avatar'];
|
||||
{
|
||||
$user_avatar = $avatar['user_avatar'];
|
||||
$user_avatar_type = $avatar['user_avatar_type'];
|
||||
$hidden_vars = '';
|
||||
foreach($_POST as $name => $key)
|
||||
{
|
||||
$hidden_vars .= '<input type="hidden" name="'. $name .'" value="'. $key .'" />';
|
||||
}
|
||||
$tp_data['USER_AVATAR'] = get_avatar($user_avatar, $user_avatar_type) . $hidden_vars;
}
|
||||
$tp_data['USER_AVATAR'] = get_avatar($user_avatar, $user_avatar_type) . $hidden_vars;
|
||||
}
|
||||
else
|
||||
{
$tp_data['USER_AVATAR'] = get_avatar($pr_data['user_avatar'], $pr_data['user_avatar_type'], !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'));
}
|
||||
{
|
||||
$tp_data['USER_AVATAR'] = get_avatar($pr_data['user_avatar'], $pr_data['user_avatar_type'], !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
}
|
||||
if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'))
|
||||
{
|
||||
if ( $user_avatar != $pr_data['user_avatar'] || $user_avatar_type != $pr_data['user_avatar_type'])
|
||||
|
@ -672,17 +693,18 @@ if ($submit && !$errors)
|
|||
*/
|
||||
if ($mode == 'register')
|
||||
{
|
||||
if ($bb_cfg['reg_email_activation'])
|
||||
if ($bb_cfg['require_activation'] == USER_ACTIVATION_SELF || $bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN)
|
||||
{
|
||||
$db_data['user_active'] = 0;
|
||||
$user_actkey = make_rand_str(12);
|
||||
$db_data['user_active'] = 0;
|
||||
$db_data['user_actkey'] = $user_actkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db_data['user_active'] = 1;
|
||||
$user_actkey = '';
|
||||
$db_data['user_actkey'] = '';
|
||||
}
|
||||
$db_data['user_regdate'] = time();
|
||||
$db_data['user_regdate'] = TIMENOW;
|
||||
|
||||
$sql_args = DB()->build_array('INSERT', $db_data);
|
||||
|
||||
|
@ -694,27 +716,69 @@ if ($submit && !$errors)
|
|||
set_pr_die_append_msg($new_user_id);
|
||||
$die_msg = "Пользователь <b>$username</b> был успешно создан";
|
||||
}
|
||||
else if ($bb_cfg['reg_email_activation'])
|
||||
{
|
||||
$email_sbj = "Добро пожаловать на сайт {$bb_cfg['sitename']}";
|
||||
|
||||
require(INC_DIR .'emailer.php');
|
||||
$emailer = new emailer('user_welcome_inactive', $email_sbj, $email);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'WELCOME_MSG' => $email_sbj,
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'PASSWORD' => $new_pass,
|
||||
'U_ACTIVATE' => make_url("profile.php?mode=activate&u=$new_user_id&act_key=$user_actkey"),
|
||||
));
|
||||
$emailer->send();
|
||||
|
||||
$die_msg = file_get_contents(BB_PATH .'/misc/html/account_inactive.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$die_msg = $lang['ACCOUNT_ADDED'];
|
||||
if ( $bb_cfg['require_activation'] == USER_ACTIVATION_SELF )
|
||||
{
|
||||
$message = $lang['ACCOUNT_INACTIVE'];
|
||||
$email_template = 'user_welcome_inactive';
|
||||
}
|
||||
else if ( $bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN )
|
||||
{
|
||||
$message = $lang['ACCOUNT_INACTIVE_ADMIN'];
|
||||
$email_template = 'admin_welcome_inactive';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = $lang['ACCOUNT_ADDED'];
|
||||
$email_template = 'user_welcome';
|
||||
}
|
||||
|
||||
include(INC_DIR . 'emailer.class.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['board_email']);
|
||||
$emailer->replyto($bb_cfg['board_email']);
|
||||
|
||||
$emailer->use_template($email_template, $user_lang);
|
||||
$emailer->email_address($email);
|
||||
$emailer->set_subject(sprintf($lang['WELCOME_SUBJECT'], $bb_cfg['sitename']));
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'WELCOME_MSG' => sprintf($lang['WELCOME_SUBJECT'], $bb_cfg['sitename']),
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'PASSWORD' => $password_confirm,
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $bb_cfg['board_email_sig']),
|
||||
|
||||
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
|
||||
));
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
if ( $bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN )
|
||||
{
|
||||
$emailer->from($bb_cfg['board_email']);
|
||||
$emailer->replyto($bb_cfg['board_email']);
|
||||
|
||||
$emailer->email_address($email);
|
||||
$emailer->use_template("admin_activate", $user_lang);
|
||||
$emailer->set_subject($lang['NEW_ACCOUNT_SUBJECT']);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $bb_cfg['board_email_sig']),
|
||||
|
||||
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
|
||||
));
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
}
|
||||
}
|
||||
|
||||
$die_msg = $die_msg . '<br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="' . append_sid("index.php") . '">', '</a>');
|
||||
|
||||
bb_die($die_msg);
|
||||
}
|
||||
/**
|
||||
|
@ -727,6 +791,47 @@ if ($submit && !$errors)
|
|||
// если что-то было изменено
|
||||
if ($db_data)
|
||||
{
|
||||
if (!$pr_data['user_active'])
|
||||
{
|
||||
$user_actkey = make_rand_str(12);
|
||||
$pr_data['user_actkey'] = $user_actkey;
|
||||
$db_data['user_actkey'] = $user_actkey;
|
||||
|
||||
include(INC_DIR . 'emailer.class.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['board_email']);
|
||||
$emailer->replyto($bb_cfg['board_email']);
|
||||
|
||||
if($bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN)
|
||||
{
|
||||
$emailer->use_template("admin_activate", $pr_data['user_lang']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$emailer->use_template('user_activate', $pr_data['user_lang']);
|
||||
}
|
||||
$emailer->email_address($email);
|
||||
$emailer->set_subject($lang['Reactivate']);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'EMAIL_SIG' => (!empty($bb_cfg['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $bb_cfg['board_email_sig']) : '',
|
||||
|
||||
'U_ACTIVATE' => make_url("profile.php?mode=activate&u={$pr_data['user_id']}&act_key=$user_actkey"),
|
||||
));
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
$message = $lang['PROFILE_UPDATED_INACTIVE'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="' . append_sid("index.php") . '">', '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(append_sid("index.php"), 10);
|
||||
$message = $lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="' . append_sid("index.php") . '">', '</a>');
|
||||
}
|
||||
|
||||
$sql_args = DB()->build_array('UPDATE', $db_data);
|
||||
|
||||
DB()->query("UPDATE ". BB_USERS ." SET $sql_args WHERE user_id = {$pr_data['user_id']} LIMIT 1");
|
||||
|
@ -741,8 +846,19 @@ if ($submit && !$errors)
|
|||
|
||||
cache_rm_user_sessions ($pr_data['user_id']);
|
||||
|
||||
$die_msg = ($adm_edit) ? "Профиль <b>{$pr_data['username']}</b> был успешно изменён" : 'Ваш профиль был успешно изменён';
|
||||
bb_die($die_msg);
|
||||
if($adm_edit)
|
||||
{
|
||||
bb_die("Профиль <b>{$pr_data['username']}</b> был успешно изменён");
|
||||
}
|
||||
elseif(!$pr_data['user_active'])
|
||||
{
|
||||
bb_die($lang['PROFILE_UPDATED_INACTIVE'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="' . append_sid("index.php") . '">', '</a>'));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(append_sid("index.php"), 10);
|
||||
bb_die($lang['PROFILE_UPDATED'] . '<br /><br /><a href="' . PROFILE_URL . $userdata['user_id'] . '">'.$lang['RETURN_PROFILE'].'</a><br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.php") . '">', '</a>'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -72,6 +72,8 @@ $lang['VIEW_NEWEST_POST'] = 'View newest post';
|
|||
$lang['PAGE_OF'] = 'Page <b>%d</b> of <b>%s</b>';
|
||||
|
||||
$lang['ICQ'] = 'ICQ Number';
|
||||
$lang['SKYPE'] = 'Skype';
|
||||
$lang['SKYPE_ERROR'] = 'You entered an invalid login';
|
||||
|
||||
$lang['FORUM_INDEX'] = '%s Forum Index'; // eg. sitename Forum Index, %s can be removed if you prefer
|
||||
|
||||
|
@ -555,6 +557,12 @@ $lang['ALWAYS_NOTIFY_EXPLAIN'] = 'Sends an e-mail when someone replies to a topi
|
|||
|
||||
$lang['BOARD_STYLE'] = 'Board Style';
|
||||
$lang['BOARD_LANG'] = 'Board Language';
|
||||
$lang['GENDER'] = 'Ïîë';
|
||||
$lang['GENDER_SELECT'] = array(
|
||||
'Unselect' => 0,
|
||||
'Male' => 1,
|
||||
'Female' => 2
|
||||
);
|
||||
$lang['NO_THEMES'] = 'No Themes In database';
|
||||
$lang['TIMEZONE'] = 'Timezone';
|
||||
$lang['DATE_FORMAT_PROFILE'] = 'Date format';
|
||||
|
|
|
@ -77,6 +77,8 @@ $lang['VIEW_NEWEST_POST'] = 'Перейти к первому непрочита
|
|||
$lang['PAGE_OF'] = 'Страница <b>%d</b> из <b>%s</b>';
|
||||
|
||||
$lang['ICQ'] = 'ICQ Number';
|
||||
$lang['SKYPE'] = 'Skype';
|
||||
$lang['SKYPE_ERROR'] = 'Вы ввели неккоректный логин';
|
||||
|
||||
$lang['FORUM_INDEX'] = 'Список форумов %s';
|
||||
|
||||
|
@ -560,6 +562,12 @@ $lang['ALWAYS_NOTIFY_EXPLAIN'] = 'Когда кто-нибудь ответит
|
|||
|
||||
$lang['BOARD_STYLE'] = 'Внешний вид форумов';
|
||||
$lang['BOARD_LANG'] = 'Язык';
|
||||
$lang['GENDER'] = 'Пол';
|
||||
$lang['GENDER_SELECT'] = array(
|
||||
'Не определилось' => 0,
|
||||
'Мужской' => 1,
|
||||
'Женский' => 2
|
||||
);
|
||||
$lang['NO_THEMES'] = 'В базе нет цветовых схем';
|
||||
$lang['TIMEZONE'] = 'Часовой пояс';
|
||||
$lang['DATE_FORMAT_PROFILE'] = 'Формат даты';
|
||||
|
|
|
@ -86,26 +86,16 @@ ajax.callback.gen_passkey = function(data){
|
|||
<th colspan="2">{L_PROFILE_INFO}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Пол:</td>
|
||||
<td>
|
||||
<select name="user_gender" id="user_gender">
|
||||
<option value="0" <!-- IF USER_GENDER_0 -->selected="selected"<!-- ENDIF -->> Не определилось </option>
|
||||
<option value="1" <!-- IF USER_GENDER_1 -->selected="selected"<!-- ENDIF -->> Мужской </option>
|
||||
<option value="2" <!-- IF USER_GENDER_2 -->selected="selected"<!-- ENDIF -->> Женский </option>
|
||||
</select>
|
||||
</td>
|
||||
<td>{L_GENDER}:</td>
|
||||
<td>{USER_GENDER}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICQ:</td>
|
||||
<td><input type="text" name="user_icq" size="30" maxlength="15" value="{USER_ICQ}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CommFort:</td>
|
||||
<td><input type="text" name="user_commfort" size="30" maxlength="15" value="{USER_COMMFORT}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Skype:</td>
|
||||
<td><input type="text" name="user_skype" size="30" maxlength="15" value="{USER_SKYPE}" /></td>
|
||||
<td>{L_SKYPE}:</td>
|
||||
<td><input type="text" name="user_skype" size="30" maxlength="250" value="{USER_SKYPE}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{L_WEBSITE}:</td>
|
||||
|
@ -212,52 +202,24 @@ ajax.callback.view_message = function(data){
|
|||
<td><input type="text" name="dateformat" value="{DATE_FORMAT}" maxlength="14" /></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- BEGIN switch_avatar_block -->
|
||||
<!-- BEGIN not_avatar_block -->
|
||||
<tr>
|
||||
<th colspan="2">{L_AVATAR_PANEL}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table class="borderless bCenter w80 med">
|
||||
<table class="borderless bCenter w80">
|
||||
<tr>
|
||||
<td>{AVATAR_EXPLAIN}</td>
|
||||
<td class="tCenter nowrap">
|
||||
<td>{L_AVATAR_DISABLE}</td>
|
||||
<td class="tCenter nowrap med">
|
||||
<p>{L_CURRENT_IMAGE}</p>
|
||||
<p class="mrg_6">{USER_AVATAR}</p>
|
||||
<p><label><input type="checkbox" name="avatardel" /> {L_DELETE_IMAGE}</label></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGIN switch_avatar_local_upload -->
|
||||
<tr>
|
||||
<td>{L_UPLOAD_AVATAR_FILE}:</td>
|
||||
<td>
|
||||
<input type="file" name="avatar" size="40" />
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END switch_avatar_local_upload -->
|
||||
<!-- BEGIN switch_avatar_remote_upload -->
|
||||
<tr>
|
||||
<td>{L_UPLOAD_AVATAR_URL}:<h6>{L_UPLOAD_AVATAR_URL_EXPLAIN}</h6></td>
|
||||
<td><input type="text" name="avatarurl" size="44" /></td>
|
||||
</tr>
|
||||
<!-- END switch_avatar_remote_upload -->
|
||||
<!-- BEGIN switch_avatar_remote_link -->
|
||||
<tr>
|
||||
<td>{L_LINK_REMOTE_AVATAR}:<h6>{L_LINK_REMOTE_AVATAR_EXPLAIN}</h6></td>
|
||||
<td><input type="text" name="avatarremoteurl" size="44" /></td>
|
||||
</tr>
|
||||
<!-- END switch_avatar_remote_link -->
|
||||
<!-- BEGIN switch_avatar_local_gallery -->
|
||||
<tr>
|
||||
<td>{L_AVATAR_GALLERY}:</td>
|
||||
<td><input type="submit" name="avatargallery" value="{L_VIEW_AVATAR_GALLERY}" class="lite" /></td>
|
||||
</tr>
|
||||
<!-- END switch_avatar_local_gallery -->
|
||||
<!-- END switch_avatar_block -->
|
||||
<!-- END not_avatar_block -->
|
||||
<!-- ENDIF / EDIT_PROFILE -->
|
||||
|
||||
<!-- IF SHOW_REG_AGREEMENT -->
|
||||
|
|
|
@ -468,6 +468,36 @@ if ($dl_search)
|
|||
|
||||
if ($allowed_forums)
|
||||
{
|
||||
// Save current search settings
|
||||
$save_in_db = array(
|
||||
'all_words',
|
||||
'active',
|
||||
'dl_cancel',
|
||||
'dl_compl',
|
||||
'dl_down',
|
||||
'dl_will',
|
||||
'forum',
|
||||
'my',
|
||||
'new',
|
||||
'order',
|
||||
'poster_id',
|
||||
'poster_name',
|
||||
's_not_seen',
|
||||
'seed_exist',
|
||||
'show_author',
|
||||
'show_cat',
|
||||
'show_forum',
|
||||
'show_speed',
|
||||
'sort',
|
||||
'time',
|
||||
);
|
||||
$curr_set = array();
|
||||
foreach ($save_in_db as $name)
|
||||
{
|
||||
$curr_set[${"{$name}_key"}] = ${"{$name}_val"};
|
||||
}
|
||||
$curr_set_sql = $db->escape(serialize($curr_set));
|
||||
|
||||
// Text search
|
||||
$search_match_topics_csv = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue