<?
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';
only_reg();
$set['title']='Просмотры микроблога'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut();

if (!isset($_GET['id']) || !is_numeric($_GET['id']))
{
header("Location: /index.php");
}
$id=intval($_GET['id']);

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_see` WHERE `id_blog` = '$id'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<div class='p_t'>";
echo '<img src="/img/microblog/lydi.png" alt="" /> Mикроблог посетили '.$k_post.' человек';
echo "</div>";
if ($k_post==0)echo'<div class="err">Mикроблог еще не посещали</div>';
echo'<table class="post">';
$q=mysql_query("SELECT * FROM `microblog_see` WHERE `id_blog` = '$id' ORDER BY `id` DESC  LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[uid]' LIMIT 1"));
echo'<tr>';

echo'<td width="40" height="40" rowspan="2">';
avatar40($ank['id']);
echo'</td>';
echo'<td>';
echo "".online($ank['id'])." ";
echo "<a href='/info.php?id=$ank[id]'>";
echo "$ank[nick]";
echo "</a>";
echo " ".adm($ank['id'])."";
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td>';
echo '<img src="/img/microblog/clock.png" alt="" /> '.vremja($post['time_last']).' ';
echo "<img src='/img/microblog/eye.png' alt='' />";
echo " $post[times]";
echo'</td>';
echo'</tr>';
}
echo'</table>';
if ($k_page>1)str("?id=$id&amp;",$k_page,$page); // Вывод страниц
include_once '../sys/inc/tfoot.php';
?>