Файл: kab/pth.php
Строк: 28
<?
include_once '../system/sys.php';
include_once '../system/funcs.php';
if(!$cms->us['id']){
header('location: /');
exit;
}
verh('Наблюдаемые темы','Мои наблюдаемые темы');
$posts = DB::$dbs->querySingle("SELECT count(id) from `forum_podp` where `us` = ?",array($cms->us['id']));
$num = 10;
if($posts==0){
echo'<div class="list1">Вы не подписаны на темы из форума!</div>';
}else{
$total = intval(($posts - 1) / $num) + 1;
$page = abs(intval($_GET['page']));
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$podps = DB::$dbs->query("SELECT * from `forum_podp` where `us` = ? order by `id` desc limit $start,$num",array($cms->us['id']));
while($podp = $podps->fetch()){
$thema=DB::$dbs->queryFetch("SELECT * FROM `forum_thema` where `id` = ?",array($podp['thema']));
$razd=DB::$dbs->queryFetch("SELECT * FROM `forum_razd` where `id` = ?",array($thema['razd']));
$podrazd=DB::$dbs->queryFetch("SELECT * FROM `forum_podrazd` where `id` = ?",array($thema['podrazd']));
$thema_p = DB::$dbs->querySingle("SELECT count(id) from `forum_post` where `thema` = ? ".($cms->us['level']>0?NULL:' and `del`='0'')."",array($thema['id']));
echo '<div class="lst">Раздел: <a href="/forum/'.$thema['razd'].'">'.$razd['name'].'</a><br/>
Подраздел: <a href="/forum/'.$thema['razd'].'/'.$thema['podrazd'].'">'.$podrazd['name'].'</a><br/>
<img src="/design/'.($thema['top'] == 1 ? 'prikrep':($thema['type'] == 1 ? 'closed':'the')).'.png" alt="*"/> Тема: '.$thema['name'].' ('.$thema_p.') <a href="/forum/thema'.$thema['id'].'/page'.ceil($thema_p/10).'">></a><br/>'.$func->uNick($thema['author']).'/'.$func->uNick($thema['last_us']).' ('.t($thema['last']).')</div>';
}
echo '<div class="lst">';
$func->page('/pth');
echo '</div>';
}
echo '<div class="list1"><a href="/kab">В Личный кабинет</a></div>';
niz();
?>