<?
include '../config.php';
include '../func.php';
head();
aut();
ban();
////////////////////////////////////////
mysql_query("UPDATE `profile` SET `online` = 'blog' WHERE `id` = '".$id_session."'");

$id = num($_GET['user']);
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));

if ( empty($user['id']) ) {
    
    echo katalog . 'Данный пользователь не найден' . div;
    pod_navig();
    foot();
    exit();
    
}

echo head . "Блоги пользователя <b>".$user['login']."</b>" . div . katalog;   


$all = mysql_result(mysql_query("SELECT count(*) FROM `blogs` WHERE `user` = '".$id."'"), 0);
if ( $all > 0 ) {
    
    if($all){
$onpage = 5;
$allpage = ceil($all/$onpage);
$this_page = (isset($_GET['p'])) ? intval($_GET['p']) : 1 ;
if($this_page < 1 || $this_page > $allpage)$this_page = 1;
$start = $this_page*$onpage - $onpage;
$result = mysql_query("SELECT * FROM `blogs` WHERE `user` = '".$id."' order by id desc limit ".$start.",".$onpage." ");
while($blog = mysql_fetch_assoc($result)) {
    
    
    echo '<img src="style/'.$icon.'/dot.gif" alt="" /> <a href="view.php?blog='.$blog['id'].'">'.$blog['top'].'<br/ >';
    
}

echo '<b>Страницы:</b> ';
navigation($allpage,"blogs.php?p={p}",1,1);
}




} else { 
    
    echo 'Записей нет';
    
}

echo div;


/////////////////////////////////////////

pod_navig();
foot();
?>