# UA95 (23.10.2013 / 19:09)
$out .= ($users['vip'] ? ' VIP' : '');
Нет
У меня вип уровни будут))) vip, vip+ и т.д
UA95, Стандартный /users/profile.php?act=edit
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require('../incfiles/core.php');
$lng_profile = core::load_lng('profile');
/*
-----------------------------------------------------------------
Закрываем от неавторизованных юзеров
-----------------------------------------------------------------
*/
if (!$user_id) {
require('../incfiles/head.php');
echo functions::display_error($lng['access_guest_forbidden']);
require('../incfiles/end.php');
exit;
}
/*
-----------------------------------------------------------------
Получаем данные пользователя
-----------------------------------------------------------------
*/
$user = functions::get_user($user);
if (!$user) {
require('../incfiles/head.php');
echo functions::display_error($lng['user_does_not_exist']);
require('../incfiles/end.php');
exit;
}
/*
-----------------------------------------------------------------
Переключаем режимы работы
-----------------------------------------------------------------
*/
$array = array(
'activity' => 'includes/profile',
'ban' => 'includes/profile',
'edit' => 'includes/profile',
'images' => 'includes/profile',
'info' => 'includes/profile',
'ip' => 'includes/profile',
'guestbook' => 'includes/profile',
'karma' => 'includes/profile',
'office' => 'includes/profile',
'password' => 'includes/profile',
'reset' => 'includes/profile',
'settings' => 'includes/profile',
'stat' => 'includes/profile',
'friends' => 'includes/profile'
);
$path = !empty($array[$act]) ? $array[$act] . '/' : '';
if (array_key_exists($act, $array) && file_exists($path . $act . '.php')) {
require_once($path . $act . '.php');
} else {
/*
-----------------------------------------------------------------
Анкета пользователя
-----------------------------------------------------------------
*/
$headmod = 'profile,' . $user['id'];
$textl = $lng['profile'] . ': ' . htmlspecialchars($user['name']);
require('../incfiles/head.php');
echo '<div class="phdr"><b>' . ($user['id'] != $user_id ? $lng_profile['user_profile'] : $lng_profile['my_profile']) . '</b></div>';
// Меню анкеты
$menu = array();
if ($user['id'] == $user_id || $rights == 9 || ($rights == 7 && $rights > $user['rights'])) {
$menu[] = '<a href="profile.php?act=edit&user=' . $user['id'] . '">' . $lng['edit'] . '</a>';
}
if ($user['id'] != $user_id && $rights >= 7 && $rights > $user['rights']) {
$menu[] = '<a href="' . $set['homeurl'] . '/' . $set['admp'] . '/index.php?act=usr_del&id=' . $user['id'] . '">' . $lng['delete'] . '</a>';
}
if ($user['id'] != $user_id && $rights > $user['rights']) {
$menu[] = '<a href="profile.php?act=ban&mod=do&user=' . $user['id'] . '">' . $lng['ban_do'] . '</a>';
}
if (!empty($menu)) {
echo '<div class="topmenu">' . functions::display_menu($menu) . '</div>';
}
//Уведомление о дне рожденья
if ($user['dayb'] == date('j', time()) && $user['monthb'] == date('n', time())) {
echo '<div class="gmenu">' . $lng['birthday'] . '!!!</div>';
}
// Информация о юзере
$arg = array(
'lastvisit' => 1,
'iphist' => 1,
'header' => '<b>ID:' . $user['id'] . '</b>'
);
if ($user['id'] != core::$user_id) {
$arg['footer'] = '<span class="gray">' . core::$lng['where'] . ':</span> ' . functions::display_place($user['id'], $user['place']);
}
echo '<div class="user"><p>' . functions::display_user($user, $arg) . '</p></div>';
// Если юзер ожидает подтверждения регистрации, выводим напоминание
if ($rights >= 7 && !$user['preg'] && empty($user['regadm'])) {
echo '<div class="rmenu">' . $lng_profile['awaiting_registration'] . '</div>';
}
// Карма
if ($set_karma['on']) {
$karma = $user['karma_plus'] - $user['karma_minus'];
if ($karma > 0) {
$images = ($user['karma_minus'] ? ceil($user['karma_plus'] / $user['karma_minus']) : $user['karma_plus']) > 10 ? '2' : '1';
echo '<div class="gmenu">';
} else if ($karma < 0) {
$images = ($user['karma_plus'] ? ceil($user['karma_minus'] / $user['karma_plus']) : $user['karma_minus']) > 10 ? '-2' : '-1';
echo '<div class="rmenu">';
} else {
$images = 0;
echo '<div class="menu">';
}
echo '<table width="100%"><tr><td width="22" valign="top"><img src="' . $set['homeurl'] . '/images/k_' . $images . '.gif"/></td><td>' .
'<b>' . $lng['karma'] . ' (' . $karma . ')</b>' .
'<div class="sub">' .
'<span class="green"><a href="profile.php?act=karma&user=' . $user['id'] . '&type=1">' . $lng['vote_for'] . ' (' . $user['karma_plus'] . ')</a></span> | ' .
'<span class="red"><a href="profile.php?act=karma&user=' . $user['id'] . '">' . $lng['vote_against'] . ' (' . $user['karma_minus'] . ')</a></span>';
if ($user['id'] != $user_id) {
if (!$datauser['karma_off'] && (!$user['rights'] || ($user['rights'] && !$set_karma['adm'])) && $user['ip'] != $datauser['ip']) {
$sum = mysql_result(mysql_query("SELECT SUM(`points`) FROM `karma_users` WHERE `user_id` = '$user_id' AND `time` >= '" . $datauser['karma_time'] . "'"), 0);
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `karma_users` WHERE `user_id` = '$user_id' AND `karma_user` = '" . $user['id'] . "' AND `time` > '" . (time() - 86400) . "'"), 0);
if (!$ban && $datauser['postforum'] >= $set_karma['forum'] && $datauser['total_on_site'] >= $set_karma['karma_time'] && ($set_karma['karma_points'] - $sum) > 0 && !$count) {
echo '<br /><a href="profile.php?act=karma&mod=vote&user=' . $user['id'] . '">' . $lng['vote'] . '</a>';
}
}
} else {
$total_karma = mysql_result(mysql_query("SELECT COUNT(*) FROM `karma_users` WHERE `karma_user` = '$user_id' AND `time` > " . (time() - 86400)), 0);
if ($total_karma > 0) {
echo '<br /><a href="profile.php?act=karma&mod=new">' . $lng['responses_new'] . '</a> (' . $total_karma . ')';
}
}
echo '</div></td></tr></table></div>';
}
// Меню выбора
$total_photo = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . $user['id'] . "'"), 0);
echo '<div class="list2"><p>' .
'<div><img src="../images/contacts.png" width="16" height="16"/> <a href="profile.php?act=info&user=' . $user['id'] . '">' . $lng['information'] . '</a></div>' .
'<div><img src="../images/activity.gif" width="16" height="16"/> <a href="profile.php?act=activity&user=' . $user['id'] . '">' . $lng_profile['activity'] . '</a></div>' .
'<div><img src="../images/rate.gif" width="16" height="16"/> <a href="profile.php?act=stat&user=' . $user['id'] . '">' . $lng['statistics'] . '</a></div>';
$bancount = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `user_id` = '" . $user['id'] . "'"), 0);
if ($bancount) {
echo '<div><img src="../images/block.gif" width="16" height="16"/> <a href="profile.php?act=ban&user=' . $user['id'] . '">' . $lng['infringements'] . '</a> (' . $bancount . ')</div>';
}
$total_friends = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `user_id`='{$user['id']}' AND `type`='2' AND `friends`='1'"), 0);
echo '<br />' .
'<div><img src="../images/photo.gif" width="16" height="16"/> <a href="album.php?act=list&user=' . $user['id'] . '">' . $lng['photo_album'] . '</a> (' . $total_photo . ')</div>' .
'<div><img src="../images/guestbook.gif" width="16" height="16"/> <a href="profile.php?act=guestbook&user=' . $user['id'] . '">' . $lng['guestbook'] . '</a> (' . $user['comm_count'] . ')</div>' .
'<div><img src="../images/users.png" width="16" height="16"/> <a href="profile.php?act=friends&user=' . $user['id'] . '">' . $lng_profile['friends'] . '</a> (' . $total_friends . ')</div>' .
'</p></div>';
if ($user['id'] != $user_id) {
echo '<div class="menu"><p>';
// Контакты
if (!functions::is_ignor($user['id']) && functions::is_contact($user['id']) != 2) {
if (!functions::is_friend($user['id'])) {
$fr_in = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `type`='2' AND `from_id`='$user_id' AND `user_id`='{$user['id']}'"), 0);
$fr_out = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_contact` WHERE `type`='2' AND `user_id`='$user_id' AND `from_id`='{$user['id']}'"), 0);
if ($fr_in == 1) {
$friend = '<a class="underline" href="profile.php?act=friends&do=ok&id=' . $user['id'] . '">' . $lng_profile['confirm_friendship'] . '</a> | <a class="underline" href="profile.php?act=friends&do=no&id=' . $user['id'] . '">' . $lng_profile['decline_friendship'] . '</a>';
} else if ($fr_out == 1) {
$friend = '<a class="underline" href="profile.php?act=friends&do=cancel&id=' . $user['id'] . '">' . $lng_profile['canceled_demand_friend'] . '</a>';
} else {
$friend = '<a href="profile.php?act=friends&do=add&id=' . $user['id'] . '">' . $lng_profile['in_friend'] . '</a>';
}
} else {
$friend = '<a href="profile.php?act=friends&do=delete&id=' . $user['id'] . '">' . $lng_profile['remov_friend'] . '</a>';
}
echo '<div><img src="../images/add.gif" width="16" height="16"/> ' . $friend . '</div>';
}
if (functions::is_contact($user['id']) != 2) {
if (!functions::is_contact($user['id'])) {
echo '<div><img src="../images/users.png" width="16" height="16"/> <a href="../mail/index.php?id=' . $user['id'] . '">' . $lng_profile['add_contacts'] . '</a></div>';
} else {
echo '<div><img src="../images/users.png" width="16" height="16"/> <a href="../mail/index.php?act=deluser&id=' . $user['id'] . '">' . $lng_profile['delete_contacts'] . '</a></div>';
}
}
if (functions::is_contact($user['id']) != 2) {
echo '<div><img src="../images/del.png" width="16" height="16"/> <a href="../mail/index.php?act=ignor&id=' . $user['id'] . '&add">' . $lng_profile['add_ignor'] . '</a></div>';
} else {
echo '<div><img src="../images/del.png" width="16" height="16"/> <a href="../mail/index.php?act=ignor&id=' . $user['id'] . '&del">' . $lng_profile['delete_ignor'] . '</a></div>';
}
echo '</p>';
if (!functions::is_ignor($user['id']) && functions::is_contact($user['id']) != 2 && empty($ban['1']) && empty($ban['3'])) {
echo '<p><form action="../mail/index.php?act=write&id=' . $user['id'] . '" method="post"><input type="submit" value="' . $lng['write'] . '" style="margin-left: 18px"/></form></p>';
}
echo '</div>';
}
echo '<div class="phdr"><a href="index.php">' . $lng['users'] . '</a></div>';
}
require_once('../incfiles/end.php');
UA95, Что то типа этого?
if ($user['id'] != $user_id) {
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 />';
'<input type="checkbox" value="v1" name="vip" ' . ($user['vip'] == 1 ? 'checked="checked"' : '') . '/> <span class="red"><b>VIP</b></span><br />';
}
}
А выше
/*
-----------------------------------------------------------------
Принимаем данные из формы, проверяем и записываем в базу
-----------------------------------------------------------------
*/
$error = array ();
$user['vip'] = isset($_POST['vip']) ? intval($_POST['vip']) : 9;
// Проводим необходимые проверки
if ($rights >= 7) {
mysql_query("UPDATE `users` SET
`vip` = '" . $user['vip'] . "'
WHERE `id` = '" . $user['id'] . "'
");
}
У меня что то даже чекбокс не появился))
Вот родной файл
Сам нифига не могу. Доказал себе..
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
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)) : '';
$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'] . "',
`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 '<div class="gmenu">' . $lng_profile['data_saved'] . '</div>';
} else {
echo functions::display_error($error);
}
header('Location: profile.php?act=edit&user=' . $user['id']);
exit;
}
/*
-----------------------------------------------------------------
Форма редактирования анкеты пользователя
-----------------------------------------------------------------
*/
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>' .
'<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">' . $user['about'] . '</textarea></p>' .
'<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>';
// Административные функции
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 '<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 '</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>';
?>
блин, уважаемые, такие огромные куски кода прячьте под спойлер или суйте в файл и крепите в пост, а то так башню срывает даже с компа мотать страницу
# VARG (25.10.2013 / 14:27)
блин, уважаемые, такие огромные куски кода прячьте под спойлер или суйте в файл и крепите в пост, а то так башню срывает даже с компа мотать страницу
+1 Тоже не люблю когда так делают. Лучше файл прикреплять: без нормальной подсветки синтаксиса сложно что-то понять в таком большом коде, так что кидать его в пост не надо.
UA95,
<p><h3><img src="../images/admin.png" width="16" height="16" class="left" /> Vip:</h3>
XML
<p> ...<ul>
</p> ...</ul>
А так все работает. Спасибо