Файл: 4mast/profmas.ru/forums/reds.php
Строк: 18
<?
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
if($us['id'] == false){
header('location: /login/auth');
exit;
}
$query = DB :: $dbs -> query ("SELECT * FROM `forum_p` WHERE (`id`=?)", array ((int) $_GET['id']));
if ($query -> rowCount ()==0) {
header ('location: /forum.php');
exit;
}
$p = $query -> fetch ();
$query = DB :: $dbs -> query ("SELECT * FROM `forum_t` WHERE (`id`='" . $p['id_t'] . "')");
if ($query -> rowCount ()==0) {
header ('location: /forum.php');
exit;
}
$t = $query -> fetch ();
$items = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_reds` WHERE (`id_p`='" . $p['id'] . "')");
H ($t['name'], '<a href="/forums/thema' . $t['id'] . '" style="color:white;">' . $t['name'] . '</a> | Изменили пост ' . $items . ' раз');
if ($t['type'] == 2) {
echo '<div class="error">Данная тема была удалена! </div>';
}
else {
if ($t['type'] == 0) {
echo '<div class="error">Данная тема закрыта!</div> ';
}
else {
if ($p['del']!=0) {
echo '<div class="error">Сообщение удалено!</div>';
}
else {
if ($items==0) {
echo '
<div class="lst">
Данное сообщение не изменяли!
</div>
';
}
else {
echo '
<div class="lst">' . uNick ($p['us']) . ' : ' . bb ($p['text']) . ' <small>(' . datef ($p['time']) . ')</small>
</div>
<div class="ram">
<div class="raz">
История изменений сообщения:
</div>
</div>
';
$items_per_page = 10;
$pages = ceil ( $items / $items_per_page );
if ($page < 1)
$page = 1;
if ($page > $pages)
$page = $pages;
$start = $page * $items_per_page - $items_per_page;
$query = DB :: $dbs -> query ("SELECT * FROM `forum_reds` WHERE (`id_p`='" . $p['id'] . "') ORDER BY `id` DESC LIMIT $start, $items_per_page");
while ($redk = $query -> fetch()) {
echo '
<div class="lst">' . uNick ($redk['us']) . ' <small>(' . datef ($redk['time']) . ')</small>
</div>
';
}
}
echo '<div class="list1"><a href="/forum/thema' . $t['id'] . '">Вернуться в тему</a></div>';
}
}
}
require_once('../includes/Footers.php');
?>