Файл: page/forum/my.php
Строк: 27
<?php
$title = 'Мои темы';
require_once($_SERVER["DOCUMENT_ROOT"]."/inc/head.php");
if (isset($active) && $sys['modules']['forum'] == 1) {
echo '<div class="title">Мои темы ('.$user_forum.')</div>';
if ($user_forum == 0) {
echo '<div class="menu">Тем нет.</div>';
} else {
$type = 3;
$page = new Pagination($user_forum, 10);
$data = $connect->prepare("select * from `topic` where `uid` = :uid order by `id` desc limit :start, 10");
$data->bindValue(':uid', $user['id'], PDO::PARAM_INT);
$data->bindValue(':start', $page->start, PDO::PARAM_INT);
$data->execute();
$sql = $data->fetchAll();
foreach ($sql as $row) {
// количество комментариев
$count_comm = Comments::CountMess($row['id'], $type);
echo '<div class="forlink"><a href="/forum/topic/'.$row['id'].'" class="links">'.($row['status'] == 1 ? '<img src="/img/post.png" alt="post">' : '<img src="/img/locked.png" alt="locked">') . $row['name'].'<div class="chi">'.$count_comm.'</div></a></div>';
}
$page->navigation();
}
echo '<div class="forlink"><a href="/forum" class="links" ><img src="/img/forum.png" alt="">Форум</a></div>';
} else {
header('Location: /');
}
require($_SERVER["DOCUMENT_ROOT"]."/inc/foot.php");
?>