Файл: soc-set/page.php
Строк: 268
<?php
require_once('core/start.php');
check_auth();
if (empty($_GET['id'])) {
$page = DB::$dbs->queryFetch("SELECT * FROM ".USERS." WHERE `user_id` = ?",array(num($_SESSION['user_id'])));
} else {
$page = DB::$dbs->queryFetch("SELECT * FROM ".USERS." WHERE `user_id` = ?",array(num($_GET['id'])));
}
if (empty($page)) {
head('Ошибка!');
echo DIV_TITLE . 'Страницы не существует' . CLOSE_DIV;
echo DIV_ERROR . 'Пользователь не найден' . CLOSE_DIV;
require_once('core/stop.php');
exit();
}
head('Страница - ' . $page['name']);
panel();
switch ($select) {
default:
echo '<div class="news">';
$bann = DB::$dbs->queryFetch("SELECT * FROM ".BANN." WHERE `user_id` = ? && `time_bann` > ?", array($page['user_id'], time()));
if ($bann['time_bann'] > time()) {
echo '<b>Пользователь забанен!</b><br /><b>По причине:</b> ' . text($bann['prich']) . '<br /><br />';
}
if (!empty($page['zver'])) {
echo '<div style="float: right;"><img src="'.HOME.'/moduls/shop/zver/'.$page['zver'].'" /></div>';
}
$status = DB::$dbs->queryFetch("SELECT * FROM ".STATUS." WHERE `user_id` = ? ORDER BY `id` DESC LIMIT 1",array($page['user_id']));
$rating = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".STATUS_RATING." WHERE `status_id` = ?", array($status['id']));
$comm = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".STATUS_COMM." WHERE `status_id` = ?", array($status['id']));
if ($page['user_id'] != $user['user_id']) {
if (!empty($status)) {echo '<div class="micro2">';
echo text($status['status']) . '<br /><b><a href="'.HOME.'/status/'.$status['id'].'/comm/">[Комм: '.$comm.']</a> <a href="'.HOME.'/status/'.$status['id'].'/like/">[Нрав.:'.$rating.']</a></b>';
echo'</div><div class="micro"></div>';
}
} else {
echo '<div class="micro2"><a href="'.HOME.'/menu/status?edit&ank">' . (!empty($status['status']) ? $status['status'] : 'изменить статус') . '</a><br /><b><a href="'.HOME.'/status/'.$status['id'].'/comm/">[Комм: '.$comm.']</a> <a href="'.HOME.'/status/'.$status['id'].'/like/">[Нрав.:'.$rating.']</a></b></div><div class="micro"></div>';
}
echo '<div>' . userLink($page['user_id']) . ' (' . level($page['level']) . ')';
if ($page['last_time'] > (time() - 2000)) {
if ($page['is_mobile'] == 1) {
echo ' <img src="'.HOME.'/img/mobile.png" />';
} elseif ($page['is_mobile'] == 2) {
echo ' <img src="'.HOME.'/img/computer.png" />';
}
} else {
echo '<br />' . (empty($page['gender']) ? 'Была: ' : 'Был: ') . vrem($page['last_time']);
}
echo '</div><br />';
echo (empty($page['photo']) ? '<img src="'.HOME.'/style/img/empty_photo.gif"/>' : '<a href="'.HOME.'/files/photo/'.$page['photo'].'"><img src="'.HOME.'/files/photo/mini_'.$page['photo'].'"/></a>');
$rating = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".PHOTO_RATING." WHERE `friend_id` = ?", array($page['user_id']));
$comm = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".PHOTO_COMM." WHERE `friend_id` = ?", array($page['user_id']));
if (!empty($page['photo'])) {
echo '<br /><a href="'.HOME.'/avatar/comm/'.$page['user_id'].'/">[Комм: '.$comm.']</a> <a href="'.HOME.'/avatar/like/'.$page['user_id'].'/">[Нрав.:'.$rating.']</a><br />';
}
echo '<br />';
echo 'Рейтинг: <b>' . (empty($page['rating']) ? '0' : $page['rating']) . '%</b><br />';
if ($user['user_id'] != $page['user_id']) {
$priceSumm = 50; // Начальная цена
if (empty($page['harem_pokup_all'])) {
$price = $priceSumm;
} else {
$price = ($page['harem_pokup_all'] * $priceSumm) + $priceSumm;
}
if (!empty($page['harem_xoz'])) {
echo '<br />' . ($page['harem_xoz'] == $user['user_id'] ? 'В вашем гареме <a href="'.HOME.'/harem/otpusk/'.$page['user_id'].'/">[Отпустить]</a>' : 'Состоит в гареме у ' . user_choice($page['harem_xoz'], 'link') . '<br /><a href="'.HOME.'/harem/kup/'.$page['user_id'].'/">[Украсть за '.$price.' баллов]</a>');
} else {
echo '<br /><a href="'.HOME.'/harem/kup/'.$page['user_id'].'/">[Купить в гарем за '.$price.' баллов]</a><br />';
}
} else {
if (!empty($page['harem_xoz'])) {
echo '<br />Состоит в гареме у ' . user_choice($page['harem_xoz'], 'link') . '<br />';
}
}
echo '</div>';
echo DIV_LI . '<img src="/img/b.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/anceta/'.$page['user_id'].'/"><b>Смотреть анкету</b></a>' . CLOSE_DIV;
echo DIV_LI . '<img src="/img/ga.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/stat/'.$page['user_id'].'/"><b>Смотреть статистику</b></a>' . CLOSE_DIV;
$guest = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GUEST." WHERE `user_id` = ? ", array($page['user_id']));
echo DIV_LI . '<img src="/img/forum.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/guest/'.$page['user_id'].'/"><b>Гостевая</b></a><span class="count"> '.$guest.'</span>' . CLOSE_DIV;
$files = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FILES." WHERE `user_id` = ? ", array($page['user_id']));
echo DIV_LI . '<img src="/img/z.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/files/'.$page['user_id'].'/"><b>Личные файлы</b></a> <span class="count">'.$files.'</span>' . CLOSE_DIV;
$albums = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS." WHERE `user_id` = ?", array($page['user_id']));
$photos = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_PHOTOS." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<img src="/img/f.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/album/user/'.$page['user_id'].'/">Фотоальбомы</a> <span class="count"> '.$albums.'/'.$photos.'</span>' . CLOSE_DIV;
$files = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".LOADS_FILE." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<img src="/img/f.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/loads/user/'.$page['user_id'].'/">Файлы в обменнике</a> <span class="count"> '.$files.'</span>' . CLOSE_DIV;
$black = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".BLACKUSERS." WHERE `user_id` = ? ", array($page['user_id']));
echo DIV_LI . '<img src="/img/nv.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/blacklist/'.$page['user_id'].'/">Черный список</a><span class="count"> '.$black.'</span>' . CLOSE_DIV;
$status = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".STATUS." WHERE `user_id` = ? ", array($page['user_id']));
echo DIV_LI . '<img src="/img/cv.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/statush/'.$page['user_id'].'/">История статусов</a><span class="count"> '.$status.'</span>' . CLOSE_DIV;
$love = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".STENA_LOVE." WHERE `user_id` = ? ", array($page['user_id']));
echo DIV_LI . '<img src="/img/forum.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/love/'.$page['user_id'].'/">Стена любви</a> <span class="count">'.$love.'</span>' . CLOSE_DIV;
$harem = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `harem_xoz` = ?", array($page['user_id']));
echo DIV_LI . '<img src="/img/ga.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/harem/user/'.$page['user_id'].'/">Гарем <b>'.$page['nick'].'</b></a><span class="count"> '.$harem.' чел.</span>' . CLOSE_DIV;
if ($page['user_id'] != $user['user_id']) {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/mail/'.$page['user_id'].'/"><b>Написать сообщение</b></a>' . CLOSE_DIV;
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/dey/go/'.$page['user_id'].'/">Выполнить действие</a>' . CLOSE_DIV;
if ($page['harem_xoz'] != $user['user_id']) {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/harem/kup/'.$page['user_id'].'/">Купить в гарем</a>' . CLOSE_DIV;
}
if (DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS." WHERE `user_id` = ?", array($user['user_id'])) == TRUE) {
$group = DB::$dbs->queryFetch("SELECT * FROM ".GROUPS." WHERE `user_id` = ? LIMIT 1",array($user['user_id']));
if (DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS_PEOPLES." WHERE `group_id` = ? && `user_id` = ?", array($group['id'], $page['user_id'])) == FALSE) {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/soo/'.$page['user_id'].'/">Пригласить в сообщество</a>' . CLOSE_DIV;
}
}
}
$all = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".PRESENTS_LIST." WHERE `friend_id` = ?", array($page['user_id']));
echo DIV_LI . '<img src="/img/present1.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/present/list/'.$page['user_id'].'/">Подарки <b>'.$page['nick'].'</b></a> ['.$all.']'.($page['user_id'] != $user['user_id'] ? ' | <a href="'.HOME.'/present/'.$page['user_id'].'/"><b>[+]</b></a>' : NULL) . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `ref` = ?", array($page['user_id']));
echo DIV_LI . '<img src="/img/b.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/ref/'.$page['user_id'].'/">Привел(a) людей</a> <span class="count"> '.$all.' чел.</span>' . CLOSE_DIV;
/* Состоит в группах */
$all = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".GROUPS_PEOPLES." WHERE `user_id` = ?", array($page['user_id']));
if ($all > 0) {
echo DIV_BLOCK . '<b>Состоит в сообществах:</b> ';
$sql = DB::$dbs->query("SELECT * FROM ".GROUPS_PEOPLES." WHERE `user_id` = ? ", array($page['user_id']));
while($post = $sql -> fetch()) {
$group = DB::$dbs->queryFetch("SELECT * FROM ".GROUPS." WHERE `id` = ? ",array($post['group_id']));
echo '<a href="'.HOME.'/groups/'.$group['id'].'/">' . $group['name'] . ', ';
}
echo CLOSE_DIV;
}
/* *** */
/* Друзья */
if ($page['user_id'] != $user['user_id']) {
echo DIV_LI;
$sql = DB::$dbs->queryFetch("SELECT `id`, `status`, `id_friend` FROM `friends` WHERE (`id_user` = ? AND `id_friend` = ?) LIMIT 1",array($user['user_id'], $page['user_id']));
if (empty($sql)) {
$sql2 = DB::$dbs->queryFetch("SELECT `id`, `status` FROM `friends` WHERE (`id_user` = ? AND `id_friend` = ?) LIMIT 1",array($page['user_id'], $user['user_id']));
if ($sql2['status'] == 0) {
if ($sql['id'] || $sql2['id'])
echo '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/friends/add/'.$page['user_id'].'/">Принять заявку от ' . $page['nick'] . '</a><br />';
else
echo '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/friends/add/'.$page['user_id'].'/">Добавить в друзья '.$page['nick'].'</a><br />';
} else {
if (!empty($sql))
echo '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/friends/add/'.$page['user_id'].'/">Добавить в друзья '.$page['nick'].'</a><br />';
else {
echo '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/friends/delete/'.$page['user_id'].'/?anceta">Удалить из друзей '.$page['nick'].'</a>';
}
}
} elseif ($sql['id'] && $sql['status'] == 0) {
$ank = DB::$dbs->queryFetch("SELECT * FROM ".USERS." WHERE `user_id` = ?",array($sql['id_friend']));
echo 'Вы отправили заявку ' . $ank['nick'] . '. Ждите подтверждения.<br />';
echo '<a href="'.HOME.'/friends/delete/'.$ank['user_id'].'/">Отменить заявку</a><br />';
} else {
$ank = DB::$dbs->queryFetch("SELECT * FROM ".USERS." WHERE `user_id` = ?",array($sql['id_friend']));
echo '<a href="'.HOME.'/friends/delete/'.$ank['user_id'].'/?anceta">Удалить из друзей '.$ank['nick'].'</a><br />';
}
echo CLOSE_DIV;
}
if ($user['user_id'] != $page['user_id']) {
if (DB::$dbs->querySingle("SELECT COUNT(*) FROM ".BLACKUSERS." WHERE `user_id` = ? && `black_id` = ?", array($user['user_id'], $page['user_id'])) == FALSE) {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/blacklist/go/'.$page['user_id'].'/">Добавить в черный список</a>' . CLOSE_DIV;
} else {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/blacklist/go/'.$page['user_id'].'/">Удалить из черного списка</a>' . CLOSE_DIV;
}
}
if ($user['user_id'] != $page['user_id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE `user` = '".$page['user_id']."' AND `opponent` = '".$page['user_id']."' AND `act` != '1'"), 0)==0) {
echo DIV_LI . '<a href="'.HOME.'/duel/add/'.$page['user_id'].'/"><b>Вызвать на дуэль</b></a>' . CLOSE_DIV;
}
$count2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE (`user` = '".$page['user_id']."' OR `opponent` = '".$page['user_id']."') AND `finish` != '".$page['user_id']."' AND `act` = '2'"),0);
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE (`user` = '".$page['user_id']."' OR `opponent` = '".$page['user_id']."') AND `finish` = '".$page['user_id']."' AND `act` = '2'"),0);
echo DIV_BLOCK . 'Выиграных дуэлей: <b>' . $count . '</b><br />
Проигранных дуэлей: <b>' . $count2 . '</b>' . CLOSE_DIV;
echo DIV_BLOCK . 'Баллов: <b>' . (empty($page['balls']) ? '0' : $page['balls']) . '</b><br />' . CLOSE_DIV;
if (privilegy('ipsoft', $page['user_id'])) {
echo DIV_AUT . 'Браузер: ' . $page['browser'] . '<br />IP: ' . $page['ip'] . CLOSE_DIV;
}
if (privilegy('anceta_update', $page['user_id'])) {
echo DIV_LI . '<a href="'.HOME.'/panel/user/edit/'.$page['user_id'].'">Апдейт</a>' . CLOSE_DIV;
}
echo (privilegy('anceta_delete', $page['user_id']) ? DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/panel/user/delete/'.$page['user_id'].'"><b>Удалить</b></a>' . CLOSE_DIV : NULL);
echo (privilegy('anceta_bann', $page['user_id']) ? DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/panel/user/bann/'.$page['user_id'].'"><b>Забанить</b></a>' . CLOSE_DIV : NULL);
$array = array();
nav($array);
break;
case 'soo':
if ($user['user_id'] != $page['user_id'] && DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS." WHERE `user_id` = ?", array($user['user_id'])) == TRUE) {
$group = DB::$dbs->queryFetch("SELECT * FROM ".GROUPS." WHERE `user_id` = ? LIMIT 1",array($user['user_id']));
if (DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS_PEOPLES." WHERE `group_id` = ? && `user_id` = ?", array($group['id'], $page['user_id'])) == FALSE) {
if (DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS_APPS." WHERE `group_id` = ? && `user_id` = ? ", array($group['id'], $user['user_id'])) == TRUE) {
echo DIV_BLOCK . 'Вы уже отправляли заявку данному пользователю' . CLOSE_DIV;
} else {
if (!empty($_POST['send'])) {
/* Формируем сообщение */
$msg = '<a href="'.HOME.'/id'.$user['user_id'].'">'.$user['nick'].'</a> приглашает тебя в сообщество <a href="'.HOME.'/groups/'.$group['id'].'/"><b>'.$group['name'].'</b></a>. Ваше действие: <a href="'.HOME.'/groups/app/'.$group['id'].'/?yes"><b>Вступить</b></a> / <a href="'.HOME.'/groups/app/'.$group['id'].'/?no"><b>Игнорировать</b></a>';
lenta($msg, $page['user_id']);
DB::$dbs->query("INSERT INTO ".GROUPS_APPS." (`group_id`, `user_id`, `friend_id`) VALUES (?, ?, ?)", array($group['id'], $user['user_id'], $page['user_id']));
echo DIV_BLOCK . 'Приглашение успешно выслано' . CLOSE_DIV;
}
echo DIV_BLOCK . 'Пригласить в свое сообщество <a href="'.HOME.'/groups/'.$group['id'].'/"><b>' . $group['name'] . '</b></a>?<br /><br />'
. '<form action="#" method="POST">'
. '<input type="submit" name="send" value="Подтвердить действие" />'
. '</form>'
. CLOSE_DIV;
}
}
} else {
echo DIV_BLOCK . 'Возникла ошибка!' . CLOSE_DIV;
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'ref':
echo DIV_BLOCK . '<b>Привел'.(empty($page['gender']) ? 'a' : NULL).' людей:</b>' . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`user_id`) FROM ".USERS." WHERE `ref` = ?", array($page['user_id']));
if (empty($all)) {
echo DIV_BLOCK . 'Список пуст' . CLOSE_DIV;
} else {
$n = new Navigator($all,10,'');
$sql = DB::$dbs->query("SELECT `user_id`, `recording_date` FROM ".USERS." WHERE `ref` = ? ORDER BY `recording_date` DESC LIMIT {$n->start()}, 10", array($page['user_id']));
while($ank = $sql -> fetch()) {
echo DIV_BLOCK . user_choice($ank['user_id'], 'link') . ' ' . vrem($ank['recording_date']) . CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'stat':
echo DIV_LI . '<b>Постов в чате:</b> ' . (empty($page['chat_post']) ? 0 : $page['chat_post']) . CLOSE_DIV;
echo DIV_LI . '<b>Ответов в викторине:</b> ' . (empty($page['victorina']) ? 0 : $page['victorina']) . CLOSE_DIV;
echo DIV_LI . '<b>Постов в беседке:</b> ' . (empty($page['guestbook_post']) ? 0 : $page['guestbook_post']) . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<a href="'.HOME.'/posts/'.$page['user_id'].'/"><b>Посты на форуме:</b></a> ' . $all . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_THEME." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<a href="'.HOME.'/themes/'.$page['user_id'].'/"><b>Темы на форуме:</b></a> ' . $all . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".GROUPS_PEOPLES." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<b>Состоит в сообществах:</b> ' . $all . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".BLOG." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_LI . '<b>Записей в блогах:</b> ' . $all . CLOSE_DIV;
echo DIV_LI . '<b>Дата регистрации:</b> ' . vrem($page['recording_date']) . CLOSE_DIV;
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'posts':
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_POST." WHERE `user_id` = ?", array($page['user_id']));
echo DIV_BLOCK . '<b>Сообщения на форуме:</b>' . CLOSE_DIV;
if (empty($all)) {
echo DIV_BLOCK . 'Сообщений нет' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_post'],'select=posts&id='.$page['user_id']);
$sql = DB::$dbs->query("SELECT * FROM ".FORUM_POST." WHERE `user_id` = ? ORDER BY `id` DESC LIMIT {$n->start()}, ".$config['write']['forum_post']."", array($user['user_id']));
while($post = $sql -> fetch()) {
echo DIV_BLOCK;
echo '<b>' . userLink($post['user_id']) . '</b> [' . vrem($post['time']) . ']<br />';
if (!empty($post['ct'])) {
$ct = DB::$dbs->queryFetch("SELECT `msg` FROM ".FORUMS_POST." WHERE `id` = ? ", array($post['ct']));
echo DIV_CT . '<small><b>Цитата:</b></small><br />' . text($ct['msg']) . CLOSE_DIV;
}
echo text($post['msg']);
if (!empty($post['file'])) {
$path = '../../files/forum/'.$post['file'];
$size = get_size(filesize($path));
$path_info = pathinfo($path);
echo '<br /><br />Прикреплен файл: <a href="'.HOME.'/files/forum/'.$post['file'].'"><b>[Скачать]</b></a> ['.$path_info['extension'].'] ['.$size.']<br />';
}
echo '<br /><br /><a href="'.HOME.'/forum/'.$post['forum_id'].'/'.$post['forumc_id'].'/'.$post['theme_id'].'/"><b>Перейти в тему</b></a>';
echo CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'themes':
echo DIV_BLOCK . '<b>Темы на форуме:</b>' . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_THEME." WHERE `user_id` = ?", array($page['user_id']));
if ($all == 0) {
echo DIV_AUT . 'Темы не созданы' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_theme'],'select=themes&id='.$page['user_id']);
$sql = DB::$dbs->query("SELECT * FROM ".FORUM_THEME." WHERE `user_id` = ? ORDER BY `time` DESC LIMIT {$n->start()}, ".$config['write']['forum_theme']." ", array($page['user_id']));
while($theme = $sql -> fetch()) {
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
$page = ceil(($posts / $config['write']['forum_post']));
echo DIV_LI . '<a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/">'.$theme['name'].'</a> ['.$posts.'] <a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/?p='.$page.'">[>>]</a>' . CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'anceta':
if ($page['user_id'] == $user['user_id']) {
echo DIV_LI . '<img src="/img/r9.png" class="ico" alt="ВОУ-ВОУ!"/> <a href="'.HOME.'/menu/anceta"><b>Редактировать</b></a>' . CLOSE_DIV;
}
echo DIV_LI . '<b>' . $page['nick'] . '</b> [id' . $page['user_id'] . ']' . CLOSE_DIV;
echo DIV_LI . '<b>' . $page['surname'] . ' ' . $page['name'] . '</b>' . CLOSE_DIV;
echo DIV_LI . '<b>Пол:</b> ' . gender($page['gender']) . CLOSE_DIV;
echo (!empty($page['bday']) && !empty($page['bmonth']) && !empty($page['byear']) ? DIV_LI . '<b>Дата рождения:</b> ' . birthday($page['bday'],$page['bmonth'],$page['byear']) . CLOSE_DIV : NULL );
echo (!empty($page['age']) ? DIV_LI . '<b>Возраст:</b> ' . $page['age'] . CLOSE_DIV : NULL );
echo DIV_LI . '<b>Город:</b> ' . city($page['city']) . CLOSE_DIV;
echo (!empty($page['about']) ? DIV_LI . '<b>О себе:</b> ' . $page['about'] . CLOSE_DIV : NULL);
echo (!empty($page['interes']) ? DIV_LI . '<b>Интересы:</b> ' . $page['interes'] . CLOSE_DIV : NULL);
echo (!empty($page['music']) ? DIV_LI . '<b>Любимая музыка:</b> ' . $page['music'] . CLOSE_DIV : NULL);
echo (!empty($page['cinema']) ? DIV_LI . '<b>Любимые фильмы:</b> ' . $page['cinema'] . CLOSE_DIV : NULL);
echo (!empty($page['books']) ? DIV_LI . '<b>Любимые книги:</b> ' . $page['books'] . CLOSE_DIV : NULL);
echo (!empty($page['smok']) ? DIV_LI . '<b>Отношение к курению:</b> ' . smok($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['alco']) ? DIV_LI . '<b>Отношение к алкоголю:</b> ' . alco($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['narco']) ? DIV_LI . '<b>Отношение к наркотикам:</b> ' . narco($page['user_id']) . CLOSE_DIV : NULL);
if (!empty($page['poznakom']) || !empty($page['goal']) || !empty($page['family_status']) || !empty($page['childtren']) || !empty($page['orientation'])) {
echo DIV_LI . '<a href="'.HOME.'/loveanc/'.$page['user_id'].'/"><b>Посмотреть анкету в знакомствах</b></a>' . CLOSE_DIV;
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
case 'loveanc':
if (empty($page['poznakom']) && empty($page['goal']) && empty($page['family_status']) && empty($page['childtren']) && empty($page['orientation'])) {
echo DIV_LI . 'Анкета не заполнена' . CLOSE_DIV;
} else {
echo (!empty($page['poznakom']) ? DIV_LI . '<b>Познакомлюсь с:</b> ' . poznakom($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['goal']) ? DIV_LI . '<b>Цель знакомства:</b> ' . goal($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['family_status']) ? DIV_LI . '<b>Семейное положение:</b> ' . family_status($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['children']) ? DIV_LI . '<b>Есть ли дети:</b> ' . children($page['user_id']) . CLOSE_DIV : NULL);
echo (!empty($page['orientation']) ? DIV_LI . '<b>Ориентация:</b> ' . orientation($page['user_id']) . CLOSE_DIV : NULL);
}
echo DIV_LI . '<a href="'.HOME.'/id'.$page['user_id'].'"><b>Вернуться на страницу</b></a>' . CLOSE_DIV;
$array = array();
nav($array);
break;
}
require_once('core/stop.php');
?>