<?
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();
aut();


$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs_comments` WHERE `read` = '0' AND `bautor_id` = '$user[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];


if ($k_post==0){echo "Нет новых коментарий, в ваших дневниках<br/>\n";}


$q=mysql_query("SELECT * FROM `blogs_comments` WHERE `read` = '0' AND `bautor_id` = '$user[id]' ORDER BY `date` DESC  LIMIT $start, $set[p_str]");
while ($coom = mysql_fetch_array($q))
{

$blog=mysql_fetch_array(mysql_query("SELECT * FROM `blogs` WHERE `id` = '$coom[record]'"));

if($num==1){ 
echo "<div class='rowdown'>"; 
$num=0;
}else{ 
echo "<div class='rowup'>"; 
$num=1;}

$kol=mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs_comments` WHERE `bautor_id` = '$user[id]' AND `read` = '0' AND `record` = '$coom[record]'"), 0);
echo "<a href='/blogs.php?act=rec&id=$blog[id]'>$blog[name]</a>\n (+$kol)\n";


echo "</div>"; 

}

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

echo "<div class='foot'>\n";
echo "<a href='info.php?id=$user[id]'>Моя страничка</a><br />\n";
echo "</div>\n";

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