<?php

require '../system/start.php';
require '../system/functions.php';
$row = mysql_fetch_assoc(mysql_query("select * from `blogs_records` where `id` = ".int($_GET['id']).""));
$str['mesto'] = 'Дневники';
$str['block'] = $set['site'].' / Дневники ';
include '../style/'.$style.'/head.php';
echo '<div class="where">"'.$row['title'].'"</div>';
if(empty($row['title']))
{
	echo '<div class="on">Запись не найдена!</div>';
	include '../style/'.$style.'/foot.php';
	exit;
}
mysql_query ("UPDATE `blogs_records` SET `see`=`see`+1 WHERE `id`=".$row['id']."");
echo '<div class="on">'.clock($row['time']).'<br />
<b>Название</b>: '.$row['title'].'<br />
'.text($row['text']).'</div>
<div class="on">
<b>Просмотров</b>: '.$row['see'].'<br />
</div>
<div class="on2">
<img class="ico" src="../style/'.$style.'/ico/newpost.png" alt="" /> <a href="comments.php?id='.$row['id'].'">Комментарии</a> ('.mysql_result(mysql_query("select count(*) from `blogs_comments` where `id_record` = ".$row['id'].""),0).')<br/>
<img class="ico" src="../style/'.$style.'/ico/newpost.png" alt="" /> <a href="user.php?id='.$row['id'].'">Все записи </a> ('.mysql_result(mysql_query("select count(*) from `blogs_records` where `id_user` = ".$row['id_user'].""),0).')<br/>
<img class="ico" src="../style/'.$style.'/ico/newpost.png" alt="" /> <a href="index.php">К дневникам</a><br/></div>';
echo '<div class="on2">
<img class="ico" src="../style/'.$style.'/ico/newpost.png" alt="" />
<a href="index.php">Дневники</a><br/>
</div>';
include '../style/'.$style.'/foot.php';
?>