$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)) : ''; ////-----------------фaмилия и прочие данные с доп.полей---------------//// $user[ 'familja' ] = isset($_POST['familja']) ? functions::check(mb_substr($_POST['familja'], 0, 32)) : '' ; $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['harakter'] = isset($_POST['harakter']) ? functions::check(mb_substr($_POST['harakter'], 0, 30)) : '' ; $user['natele'] = isset($_POST['natele']) ? functions::check(mb_substr($_POST['natele'], 0, 15)) : '' ; $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['lovebook'] = isset($_POST['lovebook']) ? functions::check(mb_substr($_POST['lovebook'], 0, 150)) : '' ; $user['interes'] = isset($_POST['interes']) ? functions::check(mb_substr($_POST['interes'], 0, 150)) : '' ; $user['lovefilms'] = isset($_POST['lovefilms']) ? functions::check(mb_substr($_POST['lovefilms'], 0, 150)) : '' ;$user['lovemuzic'] = isset($_POST['lovemuzic']) ? functions::check(mb_substr($_POST['lovemuzic'], 0, 150)) : '' ; $user['zanjatie'] = isset($_POST['zanjatie']) ? abs(intval($_POST['zanjatie'])) : $user['zanjatie']; $user['smoking'] = isset($_POST['smoking']) ? abs(intval($_POST['smoking'])) : $user['smoking']; ////-------------------тут их конец------------------//// $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($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'] . "', `familja` = '" . $user['familja'] . "', `rost` = '" . $user['rost'] . "', `ves` = '" . $user['ves'] . "', `volos` = '" . $user['volos'] . "', `rezhim` = '" . $user['rezhim'] . "', `zanjatie` = '" . $user['zanjatie'] ."', `smoking` = '" . $user['smoking'] ."', `glaza` = '" . $user['glaza'] . "', `pro` = '" . $user['pro'] . "', `lovebook` = '" . $user['lovebook'] ."', `interes` = '" . $user['interes'] ."', `lovemuzic` = '" . $user['lovemuzic'] ."', `lovefilms` = '" . $user['lovefilms'] ."', `rabota` = '" . $user['rabota'] . "', `zhizn` = '" . $user['zhizn'] . "', `harakter` = '" . $user['harakter'] ."', `natele` = '" . $user['natele'] ."', `isk` = '" . $user['isk'] . "', `cel` = '" . $user['cel'] . "', `telo` = '" . $user['telo'] ."', `sempol` = '" . $user['sempol'] . "', `deti` = '" . $user['deti'] . "', `mp` = '" . $user['mp'] . "', `orient` = '" . $user['orient'] . "', `sekaso` = '" . $user['sekaso'] . "', `kzs` = '" . $user['kzs'] . "', `sil` = '" . $user['sil'] . "', `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'] . "' 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'] . '
'; } 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 '

f' . $lng_profile['rank'] . '

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