Файл: CMS/core/modules/users_index.php
Строк: 164
<?php
if (!defined('CMS')) { die('Access Denied!'); }
$data = array();
$data = $db->selectRow("SELECT `u`.*,
(SELECT COUNT(1) FROM ?_users_wall WHERE `wall_user` = `u`.`users_login`) AS `wall`,
(SELECT COUNT(1) FROM ?_friends WHERE `users_login` = `u`.`users_login`) AS `friends`,
(SELECT COUNT(1) FROM ?_forums_posts WHERE `posts_user` = `u`.`users_login`) AS `posts`,
(SELECT COUNT(1) FROM ?_forums_topics WHERE `topics_author` = `u`.`users_login`) AS `topics`,
(SELECT COUNT(1) FROM ?_blog_posts WHERE `blog_moders` = '0' AND `blog_user` = `u`.`users_login`) AS `blog`,
(SELECT COUNT(1) FROM ?_board_posts WHERE `board_moders` = '0' AND `board_user` = `u`.`users_login`) AS `board`,
(SELECT COUNT(1) FROM ?_users_bookmarks WHERE `book_type` = '0' AND `book_user` = `u`.`users_login`) AS `book`,
(SELECT COUNT(1) FROM ?_downs WHERE `downs_user` = `u`.`users_login`) AS `down`,
(SELECT COUNT(1) FROM ?_users_photos WHERE `photo_user` = `u`.`users_login`) AS `gallery`,
(SELECT COUNT(1) FROM ?_comm_comm WHERE `comm_user` = `u`.`users_login`) AS `soo`,
(SELECT COUNT(1) FROM ?_present WHERE `user_to` = `u`.`users_login`) AS `present`,
(SELECT `visit_nowtime` FROM ?_users_visit WHERE `visit_user` = `u`.`users_login`) AS `visit`
FROM ?_users `u` WHERE LOWER(`u`.`users_login`) = ? LIMIT 1;", cms_tolower($uz));
if (empty($data) || !is_array($data)) {
$inSes->addMessage('Ошибка! Пользователь с данным логином не найден!');
redirect($config['site_url']);
}
if ($data['users_ban'] == 1) {
$inSes->addMessage('Ошибка! Пользователь заблокирован!');
redirect($config['site_url']);
}
if ($config['allow_regkeys'] > 0 && $data['users_confirmreg'] > 0) {
$inSes->addMessage('Ошибка! Пользователя не существует!');
redirect($config['site_url']);
}
$nickname = nickname($data['users_login']);
show_header('Личка ' . $nickname);
echo '<div class="b" style="min-height:35px;"><div class="img">' . user_avatars($data['users_login']) . '</div>';
echo user_visit_icon($data['users_login'], $data['users_gender'], $data['visit']) . ' <b>' . $nickname . ' </b><br />';
if (!empty($data['users_text'])) echo $data['users_text'];
echo '<br /></div>';
/* Подарки */
if (!empty($data['present'])) {
$prs = $db->select("SELECT * FROM ?_present WHERE `user_to` = ? ORDER BY `time` DESC LIMIT 0,5", $data['users_login']);
if ( @count($prs) > 0) {
echo '<div class="b">';
foreach($prs as $pr) {
echo '<a href="' . gen_uri('my_presents', $pr['id'], RND) . '">';
echo '<img src="/images/present/' . $pr['file'] . '" alt="" /></a> ';
}
echo '<a href="' . gen_uri('my_presents', '', RND) . '">>></a><br />';
echo '</div>';
}
}
$show = array();
$show['anketa'] = icon('anketa.gif', 'icons') . '<a href="' . gen_uri('anketa', '', RND) . '">Анкета</a><br />';
$show['blog'] = icon('qlt_journal.png', 'icons') . '<a href="' . gen_uri('blogs', '', RND) . '">Блоги</a> (' . num($data['blog']) . ')<br />';
$show['wall'] = icon('wall.png', 'icons') . '<a href="' . gen_uri('wall', '', RND) . '">Стена</a> (' . num($data['wall']) . ')<br />';
$show['friends'] = icon('groups_mgr.png', 'icons') . '<a href="' . gen_uri('friends', '', RND) . '">Друзья</a> (' . num($data['friends']) . ')<br />';
$show['photo'] = icon('camera.png', 'icons') . '<a href="' . gen_uri('album', '', RND) . '">Фото</a> (' . num($data['gallery']) . ')<br />';
$show['files'] = icon('disk.png', 'icons') . '<a href="' . gen_uri('files', '', RND) . '">Файлы</a> (' . num($data['down']) . ')<br />';
$show['forum'] = icon('myblog.png', 'icons') . '<a href="' . gen_uri('forum', '', RND) . '">Форум</a> (' . num($data['topics']) . '/' . num($data['posts']) . ')<br />';
$ibook = ($data['book'] > 0) ? 'star.png' : 'star-empty.png';
$show['book'] = icon($ibook, 'icons') . '<a href="' . gen_uri('bookmarks', '', RND) . '">Закладки</a> (' . num($data['book']) . ')<br />';
$show['board'] = icon('list.gif', 'icons') . '<a href="' . gen_uri('boards', '', RND) . '">Объявления</a> (' . num($data['board']) . ')<br />';
$show['soo'] = icon('groups.png', 'icons') . '<a href="' . gen_uri('soo', '', RND) . '">Сообщества</a> (' . num($data['soo']) . ')<br />';
$rows = $db->select("SELECT * FROM ?_users_index
WHERE `index_user` = ?
ORDER BY `index_pos` ASC;", $data['users_login']);
if (!empty($rows)) {
echo '<div class="b">';
foreach($rows as $row1) {
if (!empty($show[$row1['index_type']])) {
echo $show[$row1['index_type']];
}
}
echo '</div>';
}
else {
echo '<div class="b">' . implode('', $show) . '</div>';
}
if ($is_logged && $data['users_login'] == $log) {
echo '<div class="b">' . icon('cog.png', 'icons');
echo '<a href="' . gen_users($data['users_login'], 'set_index', '', RND) . '">Настроить страницу</a><br />';
echo '</div>';
}
else {
echo '<div class="b">';
echo icon('gift_add.png', 'icons');
echo '<a href="' . gen_users($data['users_login'], 'present', '', RND) . '">Сделать подарок</a><br />';
echo icon('add_to_lenta.gif', 'icons');
echo '<a href="' . gen_uri('add_authors', '', 'user=' . $data['users_login'] . '&' . RND) . '">Добавить в ленту</a><br />';
echo icon('friendship.gif', 'icons');
echo '<a href="' . gen_uri('add_friends', '', 'user=' . $data['users_login'] . '&' . RND) . '">Предложить дружбу</a><br />';
echo icon('email.png', 'icons') . '<a href="' . gen_uri('add_privat', '', 'user=' . $data['users_login']) . '">Отправить сообщение</a><br />';
echo icon('group_add.png', 'icons') . ' Добавить в ';
echo '<a href="' . gen_uri('contact', '', 'add_contact=1&user=' . $data['users_login'] . '&rnd=' . $_SESSION['token']) . '">контакт</a> | ';
echo '<a href="' . gen_uri('ignor', '', 'add_ignor=1&user=' . $data['users_login'] . '&rnd=' . $_SESSION['token']) . '">игнор</a><br />';
echo '</div>';
}
?>