<?
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';

$set['title']='Сейчас на форуме'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-900)."' AND `url` like '/forum/%'"), 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 `user` WHERE `date_last` > '".(time()-900)."' AND `url` like '/forum/%' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>\n";
if ($k_post==0)
{
echo "   <tr>\n";
echo "  <td class='komm'>\n";
echo "Нет никого\n";
echo "  </td>\n";
echo "   </tr>\n";
}
while ($forum = mysql_fetch_array($q))
{
echo "   <tr>\n";


if($num==1){
echo "  <td class='rowdown'>\n";
$num=0;
}else{
echo "  <td class='rowup'>\n";
$num=1;}
onfoto($forum['id']);
echo "".online($forum['id'])." <a href='/info.php?id=$forum[id]'><span style=\"color:$forum[ncolor]\">$forum[nick]</span></a><br/>\n";
if ($forum['podpis']!=NULL)echo "<img src='/style/img/star_f.png' alt='' class='icon'/> <font color='#bda01b'><b>$forum[podpis]</b></font><br />\n";
echo "<font color='#a19f9b'>$forum[forum_post] сообщений</font>";
echo "  </td>\n";
echo "   </tr>\n";
}

echo "</table>\n";


if ($k_page>1)str("?",$k_page,$page); // Вывод страниц

echo "<div class=\"foot\">\n";
echo " <a href='/forum/'>Форум</a>\n";
echo "</div>\n";


include_once '../sys/inc/tfoot.php';
?>