<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
if(isset($_GET['vsego'])){
$set['title']='В тему заходили';
include_once '../sys/inc/thead.php';
title();
aut();
$count_t=mysql_result(mysql_query("SELECT COUNT(*)FROM `forum_t` WHERE `id`='".intval($_GET['vsego'])."' LIMIT 1"),0);
if($count_t==0){
header('Location: /err.php?404');
}else{

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_guest` WHERE `id_them`='".intval($_GET['vsego'])."'"),0);

$k_page=k_page($k_post,$set['p_str']);

$page=page($k_page);

$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT*FROM `forum_guest` WHERE `id_them`='".intval($_GET['vsego'])."' LIMIT $start,$set[p_str]");
while($post=mysql_fetch_assoc($q)){
$ank=get_user(intval($post['id_user']));
echo "<div class='nav1'>";
echo group($ank['id'])." ";
echo "<a href='/id$ank[id]'>$ank[nick]</a>";
echo medal($ank['id']). online($ank['id']);
echo "</div>";
}
}}
if(isset($_GET['sej'])){
$set['title']='Сейчас в теме';
include_once '../sys/inc/thead.php';
title();
aut();
$count_t=mysql_result(mysql_query("SELECT COUNT(*)FROM `forum_t` WHERE `id`='".intval($_GET['sej'])."' LIMIT 1"),0);
if($count_t==0){
header('Location: /err.php?404');
}else{
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_guest` WHERE `id_them`='".intval($_GET['sej'])."' AND `time`>'".(time()-600)."'"),0);

$k_page=k_page($k_post,$set['p_str']);

$page=page($k_page);

$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT*FROM `forum_guest` WHERE `id_them`='".intval($_GET['sej'])."' AND `time`>'".(time()-600)."' LIMIT $start,$set[p_str]");
while($post=mysql_fetch_assoc($q)){
$ank=get_user(intval($post['id_user']));
echo "<div class='nav1'>";
echo group($ank['id'])." ";
echo "<a href='/id$ank[id]'>$ank[nick]</a>";
echo medal($ank['id']). online($ank['id']);
echo "</div>";
}}}
include_once '../sys/inc/tfoot.php';


?>