$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 '

' . $lng['settings_default'] . '
' . $lng['to_form'] . '

'; require('../incfiles/end.php'); exit; } echo '
' . ($user['id'] != $user_id ? $lng['profile'] : $lng_profile['my_profile']) . ' | ' . $lng['edit'] . '
'; if (isset($_GET['delavatar'])) { /* ----------------------------------------------------------------- Удаляем аватар ----------------------------------------------------------------- */ @unlink('../files/users/avatar/' . $user['id'] . '.png'); echo '
' . $lng_profile['avatar_deleted'] . '
'; } elseif (isset($_GET['delphoto'])) { /* ----------------------------------------------------------------- Удаляем фото ----------------------------------------------------------------- */ @unlink('../files/users/photo/' . $user['id'] . '.jpg'); @unlink('../files/users/photo/' . $user['id'] . '_small.jpg'); echo '
' . $lng_profile['photo_deleted'] . '
'; } elseif (isset($_POST['submit'])) { /* ----------------------------------------------------------------- Принимаем данные из формы, проверяем и записываем в базу ----------------------------------------------------------------- */ $error = array (); $user['imname'] = isset($_POST['imname']) ? functions::check(mb_substr($_POST['imname'], 0, 25)) : ''; $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['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['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['sex'] = isset($_POST['sex']) && $_POST['sex'] == 'm' ? 'm' : 'zh'; $user['rights'] = isset($_POST['rights']) ? abs(intval($_POST['rights'])) : $user['rights']; //Подпись форума if (isset($_POST['submit'])) { $user['podpis'] = isset($_POST['podpis']) ? functions::check(mb_substr($_POST['podpis'], 0, 100)) : ''; $updatepodpis = mysql_query("UPDATE `users` SET `podpis` = '" . $user['podpis'] . "' WHERE `id` = '" . $user['id'] . "'"); } ///////////////////////// // Проводим необходимые проверки 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']; $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'] . "', `live` = '" . $user['live'] . "', `dayb` = '" . $user['dayb'] . "', `monthb` = '" . $user['monthb'] . "', `yearofbirth` = '" . $user['yearofbirth'] . "', `about` = '" . $user['about'] . "', `mibile` = '" . $user['mibile'] . "', `mail` = '" . $user['mail'] . "', `mailvis` = '" . $user['mailvis'] . "', `icq` = '" . $user['icq'] . "', `skype` = '" . $user['skype'] . "', `jabber` = '" . $user['jabber'] . "', `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'] . "', `sex` = '" . $user['sex'] . "', `rights` = '" . $user['rights'] . "' WHERE `id` = '" . $user['id'] . "' "); } echo '
' . $lng_profile['data_saved'] . '
'; } else { echo functions::display_error($error); } } /* ----------------------------------------------------------------- Форма редактирования анкеты пользователя ----------------------------------------------------------------- */ echo '
' . '

' . $lng['login_name'] . ': ' . $user['name_lat'] . '
'; if ($rights >= 7) { echo $lng['nick'] . ': (' . $lng_profile['nick_lenght'] . ')

' . $lng['status'] . ': (' . $lng_profile['status_lenght'] . ')

'; } else { echo '' . $lng['nick'] . ': ' . $user['name'] . '
' . '' . $lng['status'] . ': ' . $user['status'] . '
'; } ////////////////подпись if (!isset($ban['1']) && !isset($ban['3'])) echo 'Подпись: (макс. 100)

'; ///////////////////////////////// echo '

' . $lng['avatar'] . ':
'; $link = ''; if (file_exists(('../files/users/avatar/' . $user['id'] . '.png'))) { echo '' . $user['name'] . '
'; $link = ' | ' . $lng['delete'] . ''; } echo '' . $lng_profile['upload'] . ''; if($user['id'] == $user_id) echo ' | ' . $lng['select'] . ''; echo $link . '

'; echo '

' . $lng_profile['photo'] . ':
'; $link = ''; if (file_exists(('../files/users/photo/' . $user['id'] . '_small.jpg'))) { echo '' . $user['name'] . '
'; $link = ' | ' . $lng['delete'] . ''; } echo '' . $lng_profile['upload'] . '' . $link . '
' . '

' . ''; // Административные функции if ($rights >= 7) { echo '

 ' . $lng['settings'] . '

'; if ($user['id'] != $user_id) { echo '

 ' . $lng_profile['rank'] . '

'; } echo '
'; } echo '
' . '
' . '
' . $lng['to_form'] . '
'; ?>