defined('_IN_JOHNCMS') or die('Error: restricted access');
$textl = htmlspecialchars($user['name']) . ': ' . $lng_profile['profile_edit'];
require('../incfiles/head.php');
/*
-----------------------------------------------------------------
Проверяем права доступа для редактирования Профиля
-----------------------------------------------------------------
*/
if ($user['id'] != $user_id && ($rights < 7 || $user['rights'] > $rights)) {
echo functions::display_error($lng_profile['error_rights']);
require('../incfiles/end.php');
exit;
}
/*
-----------------------------------------------------------------
Сброс настроек
-----------------------------------------------------------------
*/
if ($rights >= 7 && $rights > $user['rights'] && $act == 'reset') {
mysql_query("UPDATE `users` SET `set_user` = '', `set_forum` = '', `set_chat` = '' WHERE `id` = '" . $user['id'] . "'");
echo '<div class="gmenu"><p>' . $lng['settings_default'] . '<br /><a href="profile.php?user=' . $user['id'] . '">' . $lng['to_form'] . '</a></p></div>';
require('../incfiles/end.php');
exit;
}
echo '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . ($user['id'] != $user_id ? $lng['profile'] : $lng_profile['my_profile']) . '</b></a> | ' . $lng['edit'] . '</div>';
if (isset($_GET['delavatar'])) {
/*
-----------------------------------------------------------------
Удаляем аватар
-----------------------------------------------------------------
*/
@unlink('../files/users/avatar/' . $user['id'] . '.png');
echo '<div class="rmenu">' . $lng_profile['avatar_deleted'] . '</div>';
} elseif (isset($_GET['delphoto'])) {
/*
-----------------------------------------------------------------
Удаляем фото
-----------------------------------------------------------------
*/
@unlink('../files/users/photo/' . $user['id'] . '.jpg');
@unlink('../files/users/photo/' . $user['id'] . '_small.jpg');
echo '<div class="rmenu">' . $lng_profile['photo_deleted'] . '</div>';
} elseif (isset($_POST['submit'])) {
/*
-----------------------------------------------------------------
Принимаем данные из формы, проверяем и записываем в базу
-----------------------------------------------------------------
*/
$error = array ();
$user['imname'] = isset($_POST['imname']) ? functions::check(mb_substr($_POST['imname'], 0, 25)) : '';
////фaMiлiя////
$user['familja'] = isset($_POST['familja']) ? functions::check(mb_substr($_POST['familja'], 0, 32)) : '';
$user['live'] = isset($_POST['live']) ? functions::check(mb_substr($_POST['live'], 0, 50)) : '';
$user['dayb'] = isset($_POST['dayb']) ? intval($_POST['dayb']) : 0;
$user['monthb'] = isset($_POST['monthb']) ? intval($_POST['monthb']) : 0;
$user['yearofbirth'] = isset($_POST['yearofbirth']) ? intval($_POST['yearofbirth']) : 0;
$user['about'] = isset($_POST['about']) ? functions::check(mb_substr($_POST['about'], 0, 500)) : '';
$user['rost'] = isset($_POST['rost']) ? intval($_POST['rost']) : 0;
$user['ves'] = isset($_POST['ves']) ? intval($_POST['ves']) : 0;
$user['telo'] = isset($_POST['telo']) ? abs(intval($_POST['telo'])) : $user['telo'];
$user['volos'] = isset($_POST['volos']) ? functions::check(mb_substr($_POST['volos'], 0, 15)) : '';
$user['glaza'] = isset($_POST['glaza']) ? functions::check(mb_substr($_POST['glaza'], 0, 15)) : '';
$user['rezhim'] = isset($_POST['rezhim']) ? abs(intval($_POST['rezhim'])) : $user['rezhim'];
$user['pro'] = isset($_POST['pro']) ? functions::check(mb_substr($_POST['pro'], 0, 50)) : '';
$user['rabota'] = isset($_POST['rabota']) ? functions::check(mb_substr($_POST['rabota'], 0, 100)) : '';
$user['zhizn'] = isset($_POST['zhizn']) ? functions::check(mb_substr($_POST['zhizn'], 0, 150)) : '';
$user['isk'] = isset($_POST['isk']) ? abs(intval($_POST['isk'])) : $user['isk'];
$user['cel'] = isset($_POST['cel']) ? functions::check(mb_substr($_POST['cel'], 0, 100)) : '';
$user['sempol'] = isset($_POST['sempol']) ? abs(intval($_POST['sempol'])) : $user['sempol'];
$user['deti'] = isset($_POST['deti']) ? abs(intval($_POST['deti'])) : $user['deti'];
$user['mp'] = isset($_POST['mp']) ? functions::check(mb_substr($_POST['mp'], 0, 50)) : '';
$user['orient'] = isset($_POST['orient']) ? abs(intval($_POST['orient'])) : $user['orient'];
$user['sekaso'] = isset($_POST['sekaso']) ? abs(intval($_POST['sekaso'])) : $user['sekaso'];
$user['kzs'] = isset($_POST['kzs']) ? functions::check(mb_substr($_POST['kzs'], 0, 50)) : '';
$user['sil'] = isset($_POST['sil']) ? functions::check(mb_substr($_POST['sil'], 0, 100)) : '';
$user['mibile'] = isset($_POST['mibile']) ? functions::check(mb_substr($_POST['mibile'], 0, 40)) : '';
$user['mail'] = isset($_POST['mail']) ? functions::check(mb_substr($_POST['mail'], 0, 40)) : '';
$user['mailvis'] = isset($_POST['mailvis']) ? 1 : 0;
$user['icq'] = isset($_POST['icq']) ? intval($_POST['icq']) : 0;
$user['skype'] = isset($_POST['skype']) ? functions::check(mb_substr($_POST['skype'], 0, 40)) : '';
$user['jabber'] = isset($_POST['jabber']) ? functions::check(mb_substr($_POST['jabber'], 0, 40)) : '';
$user['www'] = isset($_POST['www']) ? functions::check(mb_substr($_POST['www'], 0, 40)) : '';
//лого
$user['loo'] = isset($_POST['loo']) && $_POST['loo'] == '0' ? '0' : '1';
// Данные юзера (для Администраторов)
$user['name'] = isset($_POST['name']) ? functions::check(mb_substr($_POST['name'], 0, 20)) : $user['name'];
$user['status'] = isset($_POST['status']) ? functions::check(mb_substr($_POST['status'], 0, 50)) : '';
$user['karma_off'] = isset($_POST['karma_off']);
$user['balans'] = isset($_POST['balans']) ? functions::check(mb_substr($_POST['balans'], 0, 10)) : '';
$user['sex'] = isset($_POST['sex']) && $_POST['sex'] == 'm' ? 'm' : 'zh';
$user['online'] = isset($_POST['online']) ? 1 : 0;
$user['rights'] = isset($_POST['rights']) ? abs(intval($_POST['rights'])) : $user['rights'];
// Проводим необходимые проверки
if($user['rights'] > $rights || $user['rights'] > 9 || $user['rights'] < 0)
$user['rights'] = 0;
if ($rights >= 7) {
if (mb_strlen($user['name']) < 2 || mb_strlen($user['name']) > 20)
$error[] = $lng_profile['error_nick_lenght'];
///Фамилия///
if (mb_strlen($user['familja']) < 2 || mb_strlen($user['familja']) > 32)
$error[] = $lng_profile['error_familja_lenght'];
if (mb_strlen($user['rost']) > 3)
$error[] = $lng_profile['error_rost_lenght'];
if (mb_strlen($user['ves']) > 3)
$error[] = $lng_profile['error_ves_lenght'];
if (mb_strlen($user['volos']) > 15)
$error[] = $lng_profile['error_volos_lenght'];
if (mb_strlen($user['glaza']) > 15)
$error[] = $lng_profile['error_glaza_lenght'];
if (mb_strlen($user['pro']) > 50)
$error[] = $lng_profile['error_pro_lenght'];
if (mb_strlen($user['rabota']) > 100)
$error[] = $lng_profile['error_rabota_lenght'];
if (mb_strlen($user['zhizn']) > 150)
$error[] = $lng_profile['error_zhizn_lenght'];
if (mb_strlen($user['cel']) > 100)
$error[] = $lng_profile['error_cel_lenght'];
if (mb_strlen($user['mp']) > 50)
$error[] = $lng_profile['error_mp_lenght'];
if (mb_strlen($user['kzs']) > 50)
$error[] = $lng_profile['error_kzs_lenght'];
if (mb_strlen($user['sil']) > 100)
$error[] = $lng_profile['error_sil_lenght'];
$lat_nick = functions::rus_lat(mb_strtolower($user['name']));
if (preg_match("/[^0-9a-z\-\@\*\(\)\?\!\~\_\=\[\]]+/", $lat_nick))
$error[] = $lng_profile['error_nick_symbols'];
}
if ($user['dayb'] || $user['monthb'] || $user['yearofbirth']) {
if ($user['dayb'] < 1 || $user['dayb'] > 31 || $user['monthb'] < 1 || $user['monthb'] > 12)
$error[] = $lng_profile['error_birth'];
}
if ($user['icq'] && ($user['icq'] < 10000 || $user['icq'] > 999999999))
$error[] = $lng_profile['error_icq'];
if (!$error) {
mysql_query("UPDATE `users` SET
`imname` = '" . $user['imname'] . "',
`familja` = '" . $user['familja'] . "',
`live` = '" . $user['live'] . "',
`dayb` = '" . $user['dayb'] . "',
`monthb` = '" . $user['monthb'] . "',
`yearofbirth` = '" . $user['yearofbirth'] . "',
`about` = '" . $user['about'] . "',
`rost` = '" . $user['rost'] . "',
`ves` = '" . $user['ves'] . "',
`volos` = '" . $user['volos'] . "',
`rezhim` = '" . $user['rezhim'] . "',
`glaza` = '" . $user['glaza'] . "',
`pro` = '" . $user['pro'] . "',
`rabota` = '" . $user['rabota'] . "',
`zhizn` = '" . $user['zhizn'] . "',
`isk` = '" . $user['isk'] . "',
`cel` = '" . $user['cel'] . "',
`sempol` = '" . $user['sempol'] . "',
`deti` = '" . $user['deti'] . "',
`mp` = '" . $user['mp'] . "',
`orient` = '" . $user['orient'] . "',
`sekaso` = '" . $user['sekaso'] . "',
`kzs` = '" . $user['kzs'] . "',
`sil` = '" . $user['sil'] . "',
`mibile` = '" . $user['mibile'] . "',
`mail` = '" . $user['mail'] . "',
`mailvis` = '" . $user['mailvis'] . "',
`icq` = '" . $user['icq'] . "',
`skype` = '" . $user['skype'] . "',
`jabber` = '" . $user['jabber'] . "',
`loo` = '" . $user['loo'] . "',
`telo` = '" . $user['telo'] . "',
`www` = '" . $user['www'] . "'
WHERE `id` = '" . $user['id'] . "'
");
if ($rights >= 7) {
mysql_query("UPDATE `users` SET
`name` = '" . $user['name'] . "',
`status` = '" . $user['status'] . "',
`karma_off` = '" . $user['karma_off'] . "',
`balans` = '" . $user['balans'] . "',
`sex` = '" . $user['sex'] . "',
`online` = '" . $user['online'] . "',
`rights` = '" . $user['rights'] . "'
WHERE `id` = '" . $user['id'] . "'
");
}
echo '<div class="gmenu">' . $lng_profile['data_saved'] . '</div>';
} else {
echo functions::display_error($error);
}
}
/*
-----------------------------------------------------------------
Форма редактирования анкеты пользователя
-----------------------------------------------------------------
*/
echo '<form action="profile.php?act=edit&user=' . $user['id'] . '" method="post">' .
'<div class="gmenu"><p>' .
$lng['login_name'] . ': <b>' . $user['name_lat'] . '</b><br />';
if ($rights >= 7) {
echo $lng['nick'] . ': (' . $lng_profile['nick_lenght'] . ')<br /><input type="text" value="' . $user['name'] . '" name="name" /><br />' .
$lng['status'] . ': (' . $lng_profile['status_lenght'] . ')<br /><input type="text" value="' . $user['status'] . '" name="status" /><br />';
} else {
echo '<span class="gray">' . $lng['nick'] . ':</span> <b>' . $user['name'] . '</b><br />' .
'<span class="gray">' . $lng['status'] . ':</span> ' . $user['status'] . '<br />';
}
echo '</p><p>' . $lng['avatar'] . ':<br />';
$link = '';
if (file_exists(('../files/users/avatar/' . $user['id'] . '.png'))) {
echo '<img src="../files/users/avatar/' . $user['id'] . '.png" width="32" height="32" alt="' . $user['name'] . '" /><br />';
$link = ' | <a href="profile.php?act=edit&user=' . $user['id'] . '&delavatar">' . $lng['delete'] . '</a>';
}
echo '<small><a href="profile.php?act=images&mod=avatar&user=' . $user['id'] . '">' . $lng_profile['upload'] . '</a>';
if($user['id'] == $user_id)
echo ' | <a href="../pages/faq.php?act=avatars">' . $lng['select'] . '</a>';
echo $link . '</small></p>';
echo '<p>' . $lng_profile['photo'] . ':<br />';
$link = '';
if (file_exists(('../files/users/photo/' . $user['id'] . '_small.jpg'))) {
echo '<a href="../files/users/photo/' . $user['id'] . '.jpg"><img src="../../files/users/photo/' . $user['id'] . '_small.jpg" alt="' . $user['name'] . '" border="0" /></a><br />';
$link = ' | <a href="profile.php?act=edit&user=' . $user['id'] . '&delphoto">' . $lng['delete'] . '</a>';
}
echo '<small><a href="profile.php?act=images&mod=up_photo&user=' . $user['id'] . '">' . $lng_profile['upload'] . '</a>' . $link . '</small><br />' .
'</p></div>' .
'<div class="menu">' .
'<p><h3><img src="../images/contacts.png" width="16" height="16" class="left" /> ' . $lng_profile['personal_data'] . '</h3>' .
$lng_profile['name'] . ':<br /><input type="text" value="' . $user['imname'] . '" name="imname" /></p>';
echo ' ' . $lng_profile['familja'] . ':<br /><input type="text" value="' . $user['familja'] . '" name="familja" />';
echo '<p>' . $lng_profile['birth_date'] . '<br />' .
'<input type="text" value="' . $user['dayb'] . '" size="2" maxlength="2" name="dayb" />.' .
'<input type="text" value="' . $user['monthb'] . '" size="2" maxlength="2" name="monthb" />.' .
'<input type="text" value="' . $user['yearofbirth'] . '" size="4" maxlength="4" name="yearofbirth" /></p>' .
'<p>' . $lng_profile['city'] . ':<br /><input type="text" value="' . $user['live'] . '" name="live" /></p>' .
'<p>' . $lng_profile['about'] . ':<br /><textarea rows="' . $set_user['field_h'] . '" name="about">' . str_replace('<br />', "\r\n", $user['about']) . '</textarea></p>';
////Типаж////
echo '<div class="phdr">' . $lng_profile['ti'] . '</div>';
//Рост
echo ' ' . $lng_profile['rost'] . ': <input type="text" value="' . $user['rost'] . '" size="4" maxlength="4" name="rost" /> ' . $lng_profile['rostsm'] . '<br />';
//Вес
echo ' ' . $lng_profile['ves'] . ': <input type="text" value="' . $user['ves'] . '" size="4" maxlength="4" name="ves" /> ' . $lng_profile['vesk'] . '<br />';
//Телосложение
echo '' . $lng_profile['telo'] . ':<br /><input type="radio" value="1" name="telo" ' . ($user['telo'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['telox'] . '<br />' .
'<input type="radio" value="2" name="telo" ' . ($user['telo'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['teloob'] . '<br />' .
'<input type="radio" value="3" name="telo" ' . ($user['telo'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['telos'] . '<br />' .
'<input type="radio" value="4" name="telo" ' . ($user['telo'] == 4 ? 'checked="checked"' : '') . '/> ' . $lng_profile['telou'] . '<br />' .
'<input type="radio" value="5" name="telo" ' . ($user['telo'] == 5 ? 'checked="checked"' : '') . '/> ' . $lng_profile['telonak'] . '<br />';
//Волосы
echo ' ' . $lng_profile['volos'] . ':<br /><input type="text" value="' . $user['volos'] . '" name="volos" /><br />';
//Режим дня
echo '' . $lng_profile['rezhim'] . ':<br /><input type="radio" value="1" name="rezhim" ' . ($user['rezhim'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rezhim1'] . '<br />' .
'<input type="radio" value="2" name="rezhim" ' . ($user['rezhim'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rezhim2'] . '<br />';
//Глаза
echo ' ' . $lng_profile['glaza'] . ':<br /><input type="text" value="' . $user['glaza'] . '" name="glaza" /><br />';
//Профессия
echo ' ' . $lng_profile['pro'] . ':<br /><input type="text" value="' . $user['pro'] . '" name="pro" /><br />';
//Работа
echo ' ' . $lng_profile['rabota'] . ':<br /><input type="text" value="' . $user['rabota'] . '" name="rabota" /><br />';
//Жизненные цели
echo ' ' . $lng_profile['zhizn'] . ':<br /><input type="text" value="' . $user['zhizn'] . '" name="zhizn" /><br />';
////3накомства
echo '<div class="phdr">' . $lng_profile['znak'] . '</div>';
//Я ищу
echo '' . $lng_profile['isk'] . ':<br /><input type="radio" value="1" name="isk" ' . ($user['isk'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['iskm'] . '<br />' .
'<input type="radio" value="2" name="isk" ' . ($user['isk'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['iskzh'] . '<br />' .
'<input type="radio" value="3" name="isk" ' . ($user['isk'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['iskmzh'] . '<br />';
//Цель знакомства
echo ' ' . $lng_profile['cel'] . ':<br /><input type="text" value="' . $user['cel'] . '" name="cel" /><br />';
//Семейное положение
echo '' . $lng_profile['sempol'] . ':<br /><input type="radio" value="1" name="sempol" ' . ($user['sempol'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sempol1'] . '<br />' .
'<input type="radio" value="2" name="sempol" ' . ($user['sempol'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sempol2'] . '<br />' .
'<input type="radio" value="3" name="sempol" ' . ($user['sempol'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sempol3'] . '<br />';
//Дети
echo '' . $lng_profile['deti'] . ':<br /><input type="radio" value="1" name="deti" ' . ($user['deti'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['deti1'] . '<br />' .
'<input type="radio" value="2" name="deti" ' . ($user['deti'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['deti2'] . '<br />' .
'<input type="radio" value="3" name="deti" ' . ($user['deti'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['deti3'] . '<br />';
/////Материальная поддержка
echo ' ' . $lng_profile['mp'] . ':<br /><input type="text" value="' . $user['mp'] . '" name="mp" /><br />';
////Сексуальная////
echo '<div class="phdr">' . $lng_profile['sekas'] . '</div>';
//Ориентация
echo '' . $lng_profile['orient'] . ':<br /><input type="radio" value="1" name="orient" ' . ($user['orient'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['orient1'] . '<br />' .
'<input type="radio" value="2" name="orient" ' . ($user['orient'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['orient2'] . '<br />' .
'<input type="radio" value="3" name="orient" ' . ($user['orient'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['orient3'] . '<br />';
//Сексуальный опыт
echo '' . $lng_profile['sekaso'] . ':<br /><input type="radio" value="1" name="sekaso" ' . ($user['sekaso'] == 1 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sekaso1'] . '<br />' .
'<input type="radio" value="2" name="sekaso" ' . ($user['sekaso'] == 2 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sekaso2'] . '<br />' .
'<input type="radio" value="3" name="sekaso" ' . ($user['sekaso'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['sekaso3'] . '<br />';
//Как часто хотелось бы заниматься сексом
echo ' ' . $lng_profile['kzs'] . ':<br /><input type="text" value="' . $user['kzs'] . '" name="kzs" /><br />';
//В сексе я люблю
echo ' ' . $lng_profile['sil'] . ':<br /><input type="text" value="' . $user['sil'] . '" name="sil" /><br />';
echo '<p><h3><img src="../images/mail.png" width="16" height="16" class="left" /> ' . $lng_profile['communication'] . '</h3>' .
$lng_profile['phone_number'] . ':<br /><input type="text" value="' . $user['mibile'] . '" name="mibile" /><br />' .
'</p><p>E-mail:<br /><small>' . $lng_profile['email_warning'] . '</small><br />' .
'<input type="text" value="' . $user['mail'] . '" name="mail" /><br />' .
'<input name="mailvis" type="checkbox" value="1" ' . ($user['mailvis'] ? 'checked="checked"' : '') . ' /> ' . $lng_profile['show_in_profile'] . '</p>' .
'<p>ICQ:<br /><input type="text" value="' . $user['icq'] . '" name="icq" size="10" maxlength="10" /></p>' .
'<p>Skype:<br /><input type="text" value="' . $user['skype'] . '" name="skype" /></p>' .
'<p>Jabber:<br /><input type="text" value="' . $user['jabber'] . '" name="jabber" /></p>' .
'<p>' . $lng_profile['site'] . ':<br /><input type="text" value="' . $user['www'] . '" name="www" /></p>' .
'</div>';
//лого
echo '<li>Выбор покaзa лого :<br />' .
'<input type="radio" value="0" name="loo" ' . ($user['loo'] == '0' ? 'checked="checked"' : '') . '/> Пoкaзывaть <br />' .
'<input type="radio" value="1" name="loo" ' . ($user['loo'] == '1' ? 'checked="checked"' : '') . '/> Не пoкaзывaть</li>' .
'</ul></p>';
// Административные функции
if ($rights >= 7) {
echo '<div class="rmenu"><p><h3><img src="../images/settings.png" width="16" height="16" class="left" /> ' . $lng['settings'] . '</h3><ul>';
if ($rights == 9) {
echo '<p>' . $lng['balance'] . ': <br /><input type="text" value="' . $user['balans'] . '" name="balans" size="10" maxlength="10" /></p>';
echo '<li><input name="karma_off" type="checkbox" value="1" ' . ($user['karma_off'] ? 'checked="checked"' : '') . ' /> <span class="red"><b>' . $lng_profile['deny_karma'] . '</b></span></li>';
}
echo '<li><a href="profile.php?act=password&user=' . $user['id'] . '">' . $lng['change_password'] . '</a></li>';
if($rights > $user['rights'])
echo '<li><a href="profile.php?act=reset&user=' . $user['id'] . '">' . $lng['reset_settings'] . '</a></li>';
echo '<li>' . $lng_profile['specify_sex'] . ':<br />' .
'<input type="radio" value="m" name="sex" ' . ($user['sex'] == 'm' ? 'checked="checked"' : '') . '/> ' . $lng_profile['sex_m'] . '<br />' .
'<input type="radio" value="zh" name="sex" ' . ($user['sex'] == 'zh' ? 'checked="checked"' : '') . '/> ' . $lng_profile['sex_w'] . '</li>' .
'</ul></p>';
if ($user['id'] != $user_id) {
echo '<p><h3><img src="../images/admin.png" width="16" height="16" class="left" /> ' . $lng_profile['rank'] . '</h3><ul>' .
'<input type="radio" value="0" name="rights" ' . (!$user['rights'] ? 'checked="checked"' : '') . '/> <b>' . $lng_profile['rank_0'] . '</b><br />' .
'<input type="radio" value="3" name="rights" ' . ($user['rights'] == 3 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rank_3'] . '<br />' .
'<input type="radio" value="4" name="rights" ' . ($user['rights'] == 4 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rank_4'] . '<br />' .
'<input type="radio" value="5" name="rights" ' . ($user['rights'] == 5 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rank_5'] . '<br />' .
'<input type="radio" value="6" name="rights" ' . ($user['rights'] == 6 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rank_6'] . '<br />';
if ($rights == 9) {
echo '<input type="radio" value="7" name="rights" ' . ($user['rights'] == 7 ? 'checked="checked"' : '') . '/> ' . $lng_profile['rank_7'] . '<br />' .
'<input type="radio" value="9" name="rights" ' . ($user['rights'] == 9 ? 'checked="checked"' : '') . '/> <span class="red"><b>' . $lng_profile['rank_9'] . '</b></span><br />';
}
echo '</ul></p>';
echo '<input name="online" type="checkbox" value="1" ' . ($user['online'] ? 'checked="checked"' : '') . ' /> Онлaйн помошник</p>';
}
echo '</div>';
}
echo '<div class="gmenu"><input type="submit" value="' . $lng['save'] . '" name="submit" /></div>' .
'</form>' .
'<div class="phdr"><a href="profile.php?user=' . $user['id'] . '">' . $lng['to_form'] . '</a></div>';