<?if(mysql_result(mysql_query("select count(`id`) from `blogs_title` where `uid`='".$_SESSION['id_user']."';"),'count')==0){if(isset($user)) echo "<img src='/sys/img/blogs.gif' alt=''/> <a href=\"blogs.php?act=addblog\">Создать дневник</a><br>";}else echo "<img src='/sys/img/blogs.gif' alt=''/> <a href=\"blogs.php?act=see&amp;id=".$_SESSION['id_user']."\">Мой дневник</a><br>";?>