<?
include '../config.php';
include '../func.php';
head();
aut();
ban();
echo head . 'Микроблог' . div . katalog;

if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);

echo 'История микроблогов: '.user($ank['id']).'<br/ >';
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog` WHERE `id_user` = '$ank[id]'"),0);


$q=mysql_query("SELECT * FROM `microblog` WHERE `id_user` = '$ank[id]' ORDER BY `time`");

if (mysql_num_rows($q)==0) {
echo "У $ank[nick] нет микроблогов\n";
}
while ($dnev = mysql_fetch_assoc($q))
{

echo "$dnev[name]\n";

echo " <a href='blog.php?id=$dnev[id]'> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_kom` WHERE `id_dnev` = '$dnev[id]'"),0)."</a> <font color='#afb0a3'>".date2($dnev[time])."</font><br/>\n";

}

navig();
foot();
?>