Файл: anketa.php
Строк: 580
<?php
require 'system/sid.php';
require 'system/config.php';
if (!empty($_SESSION['us']))
{
include 'system/user.php';
whorm(0, 'anketa');
}
include 'system/head.php';
include 'system/navigator.php';
$nk = my_int($_GET['nk']);
if (!user_inf($nk))
{
header('Location: index.php?');
die();
}
$do = (isset($_GET['do'])) ? $_GET['do'] : NULL;
switch($do) {
default:
/*
* Если анкета моя (просмотр)
*/
if ($user['id'] == $nk) {
echo $div_title . cvetnik($user['id']) . $div_end;
$rot = mysql_fetch_array(mysql_query("SELECT `rotate`, `block` FROM `albums` WHERE `path` = '$user[img]' AND `user` = '$user[id]' AND `type` = 'f'"));
if ($rot[1] == 1) $Foto = '<div style="float:right;">' . $div_tworazdel . '<img src="ico/block_photo.gif" alt=""/>' . $div_end . '</div>';
else $Foto = '<div style="float:right;">' . $div_tworazdel . '
<img src="resize.php?img='.$user['img'].'&width=128&height=0&i='.$rot[0].'" alt="*"/>' . $div_end . '</div>';
if ($user['img'] == '' && $user['sex'] == 1) {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big_f.gif" alt="*"/>' . $div_end . '</div>';
} elseif ($user['img'] == '' && $user['sex'] == 2) {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big.gif" alt="*"/>' . $div_end . '</div>';
} elseif ($user['img'] != '') {
echo $Foto;
} else {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big.gif" alt="*"/>' . $div_end . '</div>';
}
if ($user['level'] == 1) echo '<b>Стажер</b><br/>';
elseif ($user['level'] == 2) echo '<b>Модератор</b><br/>';
elseif ($user['level'] == 3) echo '<b>Ст.Модератор</b><br/>';
elseif ($user['level'] == 4) echo '<b>Администратор</b><br/>';
elseif ($user['level'] == 5) echo '<b>Ст.Администратор</b><br/>';
if ($user['journalist'] == 1) echo '<span style="color: #FF0000;"><b>+Журналист</b></span><br/>';
// всего друзей
$num_fr_1 = mysql_result(mysql_query("SELECT COUNT(id) FROM `friends` WHERE `who` = '$user[id]' AND `zajavka` = '1'"), 0);
// непринятых заявок
$num_fr_2 = mysql_result(mysql_query("SELECT COUNT(id) FROM `friends` WHERE `who` = '$user[id]' AND `zajavka` = '0'"), 0);
// фотоальбомов
$num_album = mysql_result(mysql_query("SELECT COUNT(id) FROM `albums` WHERE `user` = '$user[id]' AND `type` = 'a'"), 0);
// фотографий
$num_foto = mysql_result(mysql_query("SELECT COUNT(id) FROM `albums` WHERE `user` = '$user[id]' AND `type` = 'f'"), 0);
// стена
$num_wall = mysql_result(mysql_query("SELECT COUNT(id) FROM `wall` WHERE `komu` = '$user[id]'"), 0);
// заметок
$num_notes = mysql_result(mysql_query("SELECT COUNT(id) FROM `zametki` WHERE `user` = '$user[id]'"), 0);
if ($user['know'] == 1) $Kn = 'Кодер';
elseif ($user['know'] == 2) $Kn = 'Дизайнер';
elseif ($user['know'] == 3) $Kn = 'Мастер';
elseif ($user['know'] == 4) $Kn = 'Продавец';
elseif ($user['know'] == 5) $Kn = 'Кредитор';
else $Kn = '-';
if (!empty($user['wmid']))
{
$wm = 'WMID: <a href="http://passport.webmoney.ru/asp/certview.asp?wmid='.$user['wmid'].'">' . $user['wmid'] . '</a><br/>
BL: <img src="http://stats.wmtransfer.com/Levels/pWMIDLevel.aspx?wmid='.$user['wmid'].'&w=35&h=18&bg=0XDBE2E9" alt="WMID"/><br/>
Претензии/Отзывы/Иски: <img src="http://arbitrage.webmoney.ru/xml/AL2.aspx?wmid='.$user['wmid'].'" alt="П/О/И"/><br/>';
}
if (!empty($user['birth']))
{
$birth = 'Возраст: ' . calc_age($user['birth']) . ' (' . zodiak($user['birth']) . ')<br/>';
}
echo 'ID: ' . $user['id'] . '<br/>
Имя: ' . $user['name'] . '<br/>
Дата регистрации: ' . $user['date'] . '<br/>
Провел на сайте: ' . makestime($user['on_time']) . '<br/>
Пол: ' . ($user['sex'] == 1 ? 'Женский' : 'Мужской') . '<br/>
' . $birth . '
Деятельность: ' . $Kn . '<br/>
Лучших ответов форума: ' . forumBest($user['id']) . '<br/>
Худших ответов форума: ' . forumWorse($user['id']) . '<br/>
' . $wm . '
' . (!empty($user['email']) ? 'Email: ' . $user['email'] . '<br/>' : '') . '
' . (!empty($user['icq']) ? 'ICQ: ' . $user['icq'] . '<br/>' : '') . '
» <a href="photo.php?">Фотографии</a> (' . $num_album . '/' . $num_foto . ')<br/>
» <a href="zametki.php?do=read">Заметки</a> (' . $num_notes . ')<br/>
» <a href="friends.php?">Друзья</a> (' . $num_fr_1 . '/' . $num_fr_2 . ')<br/>
» <a href="avtoritet.php?do=history&nk='.$user['id'].'">Авторитет: <b>' . ($user['rating_plus'] - $user['rating_minus']) . '</b>
(+' . $user['rating_plus'] . '/-' . $user['rating_minus'] . ')</a><br/>
<a href="anketa.php?do=themes_user&nk='.$user['id'].'">Темы</a> |
<a href="anketa.php?do=posts_user&nk='.$user['id'].'">Сообщения</a> |
<a href="files.php?nk='.$user['id'].'">Файлы</a><br/>';
if (isset($_GET['wall']) && $_GET['wall'] == 0) {
echo '» <a href="anketa.php?nk='.$user['id'].'&wall=1">Стена</a> (' . $num_wall . ')<br/>';
} elseif (isset($_GET['wall']) && $_GET['wall'] == 1 || !isset($_GET['wall'])) {
echo '» <a href="anketa.php?nk='.$user['id'].'&wall=0">Стена</a> (' . $num_wall . ')<br/>';
if (isset($_GET['del'])) {
$del = my_int($_GET['del']);
$empt = mysql_query("SELECT `id` FROM `wall` WHERE `id` = '$del' LIMIT 1");
if (mysql_num_rows($empt) != FALSE && $nk == $user['id']) {
mysql_query("DELETE FROM `wall` WHERE `id` = '$del' LIMIT 1");
header('Location: anketa.php?nk=' . $user['id']);
} else {
header('Location: anketa.php?nk=' . $user['id']);
}
}
if (isset($_GET['order']) && $_GET['order'] == 1) {
$sort = '<a href="anketa.php?nk='.$user['id'].'&order=2">вверху</a> | <b>внизу</b>';
$ord = 'ASC';
} elseif (isset($_GET['order']) && $_GET['order'] == 2) {
$sort = '<b>вверху</b> | <a href="anketa.php?nk='.$user['id'].'&order=1">внизу</a>';
$ord = 'DESC';
} else {
$sort = '<b>вверху</b> | <a href="anketa.php?nk='.$user['id'].'&order=1">внизу</a>';
$ord = 'DESC';
}
echo $div_menu . 'Новые: ' . $sort . $div_end;
// Добавление комментария
if (isset($_POST['addkom'])) {
$mes = trim(mysql_real_escape_string(check($_POST['mes'])));
if (empty($mes)) {
err('Не заполнен комментарий!');
} else {
// транслит
if ($user['translit'] == 1) {
$mes = trun_to_rus($mes);
}
// антимат
$ant = mysql_fetch_array(mysql_query("SELECT `antimat` FROM `setting` WHERE `ids` = '1'"));
$mes = ($ant[0] == 1) ? mat($mes) : $mes;
// Антиреклама
$_ant = mysql_fetch_assoc(mysql_query("SELECT `on_rekl`, `text_rekl` FROM `setting` WHERE `ids` = '1'"));
if ($_ant['on_rekl'] == 1 && filesize($_SERVER['DOCUMENT_ROOT'] . '/domains.dat') > 0) {
$ex = explode(',', file_get_contents('domains.dat'));
foreach($ex as $value) {
if ($user['level'] != 4 && $user['level'] != 5 && !preg_match('/[url=http://(.*)[/url]/si', $mes)) {
$mes = preg_replace("/(w)(s|,|.|*|_|-|+)+$value/si", $_ant['text_rekl'], $mes);
}
}
}
mysql_query("INSERT INTO `wall` SET
`msg` = '$mes',
`user` = '$user[id]',
`komu` = '$nk',
`date` = '" . time() . "'");
header('Location: anketa.php?nk=' . $nk);
}
}
$koms = mysql_result(mysql_query("SELECT COUNT(id) FROM `wall` WHERE `komu` = '$user[id]'"), 0);
if ($koms != FALSE)
{
$num_wall = (!empty($_SESSION['us'])) ? $user['onp_comments'] : 10;
$n = new navigator($koms, $num_wall, 'anketa.php?nk='.$user['id'].'&');
$_in = mysql_query("SELECT * FROM `wall` WHERE `komu` = '$user[id]' ORDER BY `id` $ord {$n->limit}");
while($q = mysql_fetch_assoc($_in)) {
$otv = ' <a href="anketa.php?nk='.$user['id'].'&k='.$q['user'].'&#down">[отв]</a>';
$dk = '<a href="anketa.php?nk='.$user['id'].'&del='.$q['id'].'"><img src="ico/delete.gif" alt="x"/></a> ';
echo $div_razdel . $dk . us($q['user']) . $otv . ' (' . date('d.m.y H:i', $q['date']) . ')' . $div_end . $div_tworazdel . smiles(bb_code($q['msg'])) . $div_end;
}
echo $n->navi();
} else {
echo 'Комментарии отсутствуют.<br/>';
}
$Komu = (isset($_GET['k'])) ? '[b]Ответ: ' . user_inf(my_int($_GET['k']), 'user') . '[/b], ' : '';
echo '<a name="down"></a>
<form method="post" action="anketa.php?nk='.$user['id'].'">
<label><b>Комментарий:</b></label>
<br/>
<textarea name="mes" cols="50" rows="5" style="width: 99%;">' . $Komu . '</textarea>
<br/>
<input type="submit" name="addkom" value="Добавить"/>
</form>';
}
/*
* Не моя анкета (просмотр)
*/
} else {
$lastv = (user_inf($nk, 'sex') == 1)
? 'Последний раз была: '
: 'Последний раз был: ';
echo $div_title . cvetnik($nk) . $div_end . $vis;
if (user_inf($nk, 'kik') != '' && user_inf($nk, 'kik') > time()) {
echo $div_aut . 'Пользователь заблокирован за ' . user_inf($nk, 'whykik') . $div_end;
}
if (user_inf($nk, 'mod_reg') == 1) {
echo $div_aut . 'Пользователь еще не прошел модерацию' . $div_end;
}
$rot = mysql_fetch_array(mysql_query("SELECT `rotate`, `block` FROM `albums` WHERE `path` = '".user_inf($nk, 'img')."' AND `user` = '$nk' AND `type` = 'f'"));
if ($rot[1] == 1) $Foto = '<div style="float:right;">' . $div_tworazdel . '<img src="ico/block_photo.gif" alt=""/>' . $div_end . '</div>';
else $Foto = '<div style="float:right;">' . $div_tworazdel . '
<img src="resize.php?img='.user_inf($nk, 'img').'&width=128&height=0&i='.$rot[0].'" alt="*"/>' . $div_end . '</div>';
if (user_inf($nk, 'img') == '' && user_inf($nk, 'sex') == 1) {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big_f.gif" alt="*"/>' . $div_end . '</div>' . $div_end;
} elseif (user_inf($nk, 'img') == '' && user_inf($nk, 'sex') == 2) {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big.gif" alt="*"/>' . $div_end . '</div>';
} elseif (user_inf($nk, 'img') != '') {
echo $Foto;
} else {
echo '<div style="float:right;">' . $div_tworazdel . '<img src="ico/no_avatar_big.gif" alt="*"/>' . $div_end . '</div>';
}
if (user_inf($nk, 'level') == 1) echo '<b>Стажер</b><br/>';
elseif (user_inf($nk, 'level') == 2) echo '<b>Модератор</b><br/>';
elseif (user_inf($nk, 'level') == 3) echo '<b>Ст.Модератор</b><br/>';
elseif (user_inf($nk, 'level') == 4) echo '<b>Администратор</b><br/>';
elseif (user_inf($nk, 'level') == 5) echo '<b>Ст.Администратор</b><br/>';
if (user_inf($nk, 'journalist') == 1) echo '<span style="color: #FF0000;"><b>+Журналист</b></span><br/>';
// всего друзей
$num_fr_1 = mysql_result(mysql_query("SELECT COUNT(id) FROM `friends` WHERE `who` = '$nk' AND `zajavka` = '1'"), 0);
// общих друзей
$num_fr_2 = mysql_result(mysql_query("SELECT COUNT(id) FROM `friends` WHERE `user` = '$nk' AND `who` IN(SELECT `who` FROM `friends` WHERE `user` = '$user[id]') AND `zajavka` = '1'"), 0);
// фотоальбомов
$num_album = mysql_result(mysql_query("SELECT COUNT(id) FROM `albums` WHERE `user` = '$nk' AND `type` = 'a'"), 0);
// фотографий
$num_foto = mysql_result(mysql_query("SELECT COUNT(id) FROM `albums` WHERE `user` = '$nk' AND `type` = 'f'"), 0);
// стена
$num_wall = mysql_result(mysql_query("SELECT COUNT(id) FROM `wall` WHERE `komu` = '$nk'"), 0);
// заметок
$num_notes = mysql_result(mysql_query("SELECT COUNT(id) FROM `zametki` WHERE `user` = '$nk'"), 0);
if (user_inf($nk, 'know') == 1) $Kn = 'Кодер';
elseif (user_inf($nk, 'know') == 2) $Kn = 'Дизайнер';
elseif (user_inf($nk, 'know') == 3) $Kn = 'Мастер';
elseif (user_inf($nk, 'know') == 4) $Kn = 'Продавец';
elseif (user_inf($nk, 'know') == 5) $Kn = 'Кредитор';
else $Kn = '-';
if ($user['level'] >= 1 && $user['level'] <= 3) {
$adult = $div_tworazdel . 'Действие:<br/>
<FORM method="POST" action="moder.php?do=us_adult">
<select name="adult">
<option value="1">Забанить ник</option>
<option value="2">Забанить ip</option>
</select>
<br/>
<input type="hidden" name="nick" value="' . $nk . '"/>
<input type="submit" name="ok" value="Далее"/>
</FORM>' . $div_end;
} elseif ($user['level'] == 4 || $user['level'] == 5) {
$adult = $div_tworazdel . 'Действие:<br/>
<FORM method="POST" action="admin.php?do=us_adult">
<select name="adult">
<option value="1">Забанить ник</option>
<option value="2">Забанить ip</option>
<option value="3">Удалить ник</option>
<option value="4">Поиск по IP</option>
<option value="5">Поиск по IP (подсеть)</option>
<option value="6">Апдейт</option>
</select>
<br/>
<input type="hidden" name="nick" value="' . $nk . '"/>
<input type="submit" name="ok" value="Далее"/>
</FORM>' . $div_end;
}
#################################################
$fr = mysql_query("SELECT COUNT(id) FROM `friends` WHERE
`user` = '$user[id]'
AND
`who` = '$nk'
AND
`zajavka` = '1'
OR
`user` = '$nk'
AND
`who` = '$user[id]'
AND
`zajavka` = '1'");
$fr_1 = mysql_query("SELECT COUNT(id) FROM `friends` WHERE
`user` = '$user[id]'
AND
`who` = '$nk'
AND
`zajavka` = '0'");
$fr_2 = mysql_query("SELECT COUNT(id) FROM `friends` WHERE
`user` = '$nk'
AND
`who` = '$user[id]'
AND
`zajavka` = '0'");
if (user_inf($nk, 'p_friends') == 1)
{
$myfr = '<a href="friends.php?do=view&nk='.$nk.'">Друзья</a> (' . $num_fr_1 . '/' . $num_fr_2 . ')<br/>';
} elseif (user_inf($nk, 'p_friends') == 2) {
$myfr = '';
} elseif (user_inf($nk, 'p_friends') == 0 && mysql_result($fr, 0) != FALSE) {
$myfr = '<a href="friends.php?do=view&nk='.$nk.'">Друзья</a> (' . $num_fr_1 . '/' . $num_fr_2 . ')<br/>';
}
if (mysql_result($fr_1, 0) != FALSE) {
$add_friend = '<span style="color: #064a91;">Вы отправили заявку на дружбу</span>';
} elseif (mysql_result($fr_2, 0) != FALSE) {
$add_friend = '<span style="color: #064a91;">Пользователь отправил Вам заявку на дружбу</span>';
} elseif (mysql_result($fr, 0) == FALSE) {
$add_friend = '<a href="friends.php?do=add_new&nk='.$nk.'">Добавить в друзья</a>';
} else {
$add_friend = '<a href="friends.php?x='.$nk.'">Убрать из друзей</a>';
}
#################################################
if (user_inf($nk, 'wmid') != 0)
{
$wm = 'WMID: <a href="http://passport.webmoney.ru/asp/certview.asp?wmid='.user_inf($nk, 'wmid').'">' . user_inf($nk, 'wmid') . '</a><br/>
BL: <img src="http://stats.wmtransfer.com/Levels/pWMIDLevel.aspx?wmid='.user_inf($nk, 'wmid').'&w=35&h=18&bg=0XDBE2E9" alt="WMID"/><br/>
Претензии/Отзывы/Иски: <img src="http://arbitrage.webmoney.ru/xml/AL2.aspx?wmid='.user_inf($nk, 'wmid').'" alt="П/О/И"/><br/>';
}
if (user_inf($nk, 'birth') != '')
{
$birth = 'Возраст: ' . calc_age(user_inf($nk, 'birth')) . ' (' . zodiak(user_inf($nk, 'birth')) . ')<br/>';
}
echo $adult . 'ID: ' . user_inf($nk, 'id') . '<br/>
Имя: ' . user_inf($nk, 'name') . '<br/>
Дата регистрации: ' . user_inf($nk, 'date') . '<br/>
Провел на сайте: ' . makestime(user_inf($nk, 'on_time')) . '<br/>
' . (user_inf($nk, 'onl') + 300 > time() ? 'Местонахождение: ' . gps($nk) . '<br/>' : $lastv . user_inf($nk, 'visit') . '<br/>') . '
Пол: ' . (user_inf($nk, 'sex') == 1 ? 'Женский' : 'Мужской') . '<br/>
' . $birth . '
Деятельность: ' . $Kn . '<br/>
Лучших ответов форума: ' . forumBest($nk) . '<br/>
Худших ответов форума: ' . forumWorse($nk) . '<br/>
' . $wm . '
' . (user_inf($nk, 'email') != '' ? 'Email: ' . user_inf($nk, 'email') . '<br/>' : '') . '
' . (user_inf($nk, 'icq') != 0 ? 'ICQ: ' . user_inf($nk, 'icq') . '<br/>' : '') . '
» <a href="photo.php?do=view&nk='.$nk.'">Фотографии</a> (' . $num_album . '/' . $num_foto . ')<br/>
» <a href="zametki.php?do=view&nk='.$nk.'">Заметки</a> (' . $num_notes . ')<br/>
» <a href="friends.php?do=view&nk='.$nk.'">Друзья</a> (' . $num_fr_1 . '/' . $num_fr_2 . ')<br/>
» <a href="friends.php?do=add_new&nk='.$nk.'">' . $add_friend . '</a><br/>
» <a href="mail.php?do=send&nick='.$nk.'">Написать сообщение</a><br/>
» <a href="avtoritet.php?do=history&nk='.$nk.'">Авторитет: <b>' . (user_inf($nk, 'rating_plus') - user_inf($nk, 'rating_minus')) . '</b>
(+' . user_inf($nk, 'rating_plus') . '/-' . user_inf($nk, 'rating_minus') . ')</a><br/>
[<a href="avtoritet.php?nk='.$nk.'&vote=1">Плюс</a> | <a href="avtoritet.php?nk='.$nk.'&vote=0">Минус</a>]<br/>
<a href="anketa.php?do=themes_user&nk='.$nk.'">Темы</a> |
<a href="anketa.php?do=posts_user&nk='.$nk.'">Сообщения</a> |
<a href="files.php?nk='.$nk.'">Файлы</a><br/>';
if (isset($_GET['wall']) && $_GET['wall'] == 0) {
echo '» <a href="anketa.php?nk='.$nk.'&wall=1">Стена</a> (' . $num_wall . ')<br/>';
} elseif (isset($_GET['wall']) && $_GET['wall'] == 1 || !isset($_GET['wall'])) {
echo '» <a href="anketa.php?nk='.$nk.'&wall=0">Стена</a> (' . $num_wall . ')<br/>';
if (isset($_GET['del'])) {
$del = my_int($_GET['del']);
$empt = mysql_query("SELECT `id` FROM `wall` WHERE `id` = '$del' LIMIT 1");
if (mysql_num_rows($empt) != FALSE && $nk == $user['id'] || $user['level'] == 4 || $user['level'] == 5) {
mysql_query("DELETE FROM `wall` WHERE `id` = '$del' LIMIT 1");
header('Location: anketa.php?nk=' . $nk);
} else {
header('Location: anketa.php?nk=' . $nk);
}
}
if (user_inf($nk, 'p_r_wall') == 1 || user_inf($nk, 'p_wall') == 0 && mysql_result($fr, 0) != FALSE) {
if (isset($_GET['order']) && $_GET['order'] == 1) {
$sort = '<a href="anketa.php?nk='.$nk.'&order=2">вверху</a> | <b>внизу</b>';
$ord = 'ASC';
} elseif (isset($_GET['order']) && $_GET['order'] == 2) {
$sort = '<b>вверху</b> | <a href="anketa.php?nk='.$nk.'&order=1">внизу</a>';
$ord = 'DESC';
} else {
$sort = '<b>вверху</b> | <a href="anketa.php?nk='.$nk.'&order=1">внизу</a>';
$ord = 'DESC';
}
echo $div_menu . 'Новые: ' . $sort . $div_end;
// Добавление комментария
if (isset($_POST['addkom']) && !empty($_SESSION['us'])) {
$mes = trim(mysql_real_escape_string(check($_POST['mes'])));
if (empty($mes)) {
err('Не заполнен комментарий!');
} elseif (ignor($nk, $user['id']) == 1) {
err('Вы находитесь в черном списке у этого пользователя');
} else {
// транслит
if ($user['translit'] == 1) {
$mes = trun_to_rus($mes);
}
// антимат
$ant = mysql_fetch_array(mysql_query("SELECT `antimat` FROM `setting` WHERE `ids` = '1'"));
$mes = ($ant[0] == 1) ? mat($mes) : $mes;
// Антиреклама
$_ant = mysql_fetch_assoc(mysql_query("SELECT `on_rekl`, `text_rekl` FROM `setting` WHERE `ids` = '1'"));
if ($_ant['on_rekl'] == 1 && filesize($_SERVER['DOCUMENT_ROOT'] . '/domains.dat') > 0) {
$ex = explode(',', file_get_contents('domains.dat'));
foreach($ex as $value)
{
if ($user['level'] != 4 && $user['level'] != 5 && !preg_match('/[url=http://(.*)[/url]/si', $mes)) {
$mes = preg_replace("/(w)(s|,|.|*|_|-|+)+$value/si", $_ant['text_rekl'], $mes);
}
}
}
mysql_query("INSERT INTO `wall` SET
`msg` = '$mes',
`user` = '$user[id]',
`komu` = '$nk',
`date` = '" . time() . "'");
if (user_inf($nk, 'comm_wall') == 1) {
$message = us($user['id']) . ' оставил сообщение на Вашей <a href="/'.$nk.'">стене</a>!';
mysql_query("INSERT INTO `lenta` SET
`user` = '$nk',
`text` = '$message',
`type` = 'comments',
`date` = '" . time() . "',
`read` = '1'");
}
header('Location: anketa.php?nk=' . $nk);
}
}
$koms = mysql_result(mysql_query("SELECT COUNT(id) FROM `wall` WHERE `komu` = '$nk'"), 0);
if ($koms != FALSE) {
$num_wall = (!empty($_SESSION['us'])) ? $user['onp_comments'] : 10;
$n = new navigator($koms, $num_wall, 'anketa.php?nk='.$nk.'&');
$_in = mysql_query("SELECT * FROM `wall` WHERE `komu` = '$nk' ORDER BY `id` $ord {$n->limit}");
while($q = mysql_fetch_assoc($_in)) {
$otv = ' <a href="anketa.php?nk='.$nk.'&k='.$q['user'].'&#down">[отв]</a>';
if ($nk == $user['id'] || $user['level'] >= 2 && $user['level'] <= 5) {
$dk = '<a href="anketa.php?nk='.$nk.'&del='.$q['id'].'"><img src="ico/delete.gif" alt="x"/></a> ';
}
echo $div_razdel . $dk . us($q['user']) . $otv . ' (' . date('d.m.y H:i', $q['date']) . ')' . $div_end . $div_tworazdel . smiles(bb_code($q['msg'])) . $div_end;
}
echo $n->navi();
} else {
echo 'Комментарии отсутствуют.<br/>';
}
$Komu = (isset($_GET['k'])) ? '[b]Ответ: ' . user_inf(my_int($_GET['k']), 'user') . '[/b], ' : '';
if (user_inf($nk, 'p_wall') == 1 || user_inf($nk, 'p_wall') == 0 && mysql_result($fr, 0) != FALSE) {
echo '<a name="down"></a>
<FORM method="POST" action="anketa.php?nk='.$nk.'">
<label for="q"><b>Комментарий:</b></label>
<br/>
<textarea name="mes" id="q" cols="50" rows="5" style="width: 99%;">' . $Komu . '</textarea>
<br/>
<input type="submit" name="addkom" value="Добавить"/>
</FORM>';
}
}
}
}
break;
case themes_user:
$nk = my_int($_REQUEST['nk']);
echo $div_title . 'Темы пользователя на форуме' . $div_end;
if (!user_inf($nk)) {
err('Пользователь не найден!');
include 'system/foot.php';
exit();
}
$countT = mysql_result(mysql_query("SELECT COUNT(id) FROM `f_them` WHERE `author` = '$nk'"), 0);
if ($countT != 0) {
echo 'Всего тем: ' . $countT . $block;
$n = new navigator($countT, 10, '?do=themes_user&nk='.$nk.'&');
$th = mysql_query("SELECT `f_them`.*, (SELECT COUNT(id) FROM `f_message` WHERE `user` = '$nk' AND `f_them`.`id` = `f_message`.`tid`) AS c FROM `f_them` WHERE `author` = '$nk' ORDER BY `id` DESC {$n->limit}");
$i = 0;
while($inTh = mysql_fetch_assoc($th))
{
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo '» <a href="forum/index.php?do=them&r='.$inTh['razdel_id'].'&p='.$inTh['rid'].'&t='.$inTh['id'].'">' . $inTh['name'] . '</a> (' . $inTh['c'] . ')' . $div_end;
}
echo $n->navi();
} else {
echo 'Тем не найдено.<br/>';
}
break;
case posts_user:
$nk = my_int($_REQUEST['nk']);
echo $div_title . 'Сообщения пользователя на форуме' . $div_end;
if (!user_inf($nk)) {
err('Пользователь не найден!');
include 'system/foot.php';
exit();
}
$countT = mysql_result(mysql_query("SELECT COUNT(id) FROM `f_message` WHERE `user` = '$nk'"), 0);
if ($countT != 0) {
echo 'Всего сообщений: ' . $countT . $block;
$n = new navigator($countT, 10, '?do=posts_user&nk='.$nk.'&');
$th = mysql_query("SELECT `f_message`.*, (SELECT `razdel_id` FROM `f_them` WHERE `f_message`.`tid` = `f_them`.`id`) AS c FROM `f_message` WHERE `user` = '$nk' ORDER BY `id` DESC {$n->limit}");
$i = 0;
while($inTh = mysql_fetch_assoc($th)) {
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo '» <a href="forum/index.php?do=them&r='.$inTh['c'].'&p='.$inTh['podforum'].'&t='.$inTh['tid'].'">' . $inTh['msg'] . '</a>' . $div_end;
}
echo $n->navi();
} else {
echo 'Сообщений не найдено.<br/>';
}
break;
}
include 'system/foot.php';
?>