Файл: blog/user.php
Строк: 93
<?php
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';
if (isset($user))$user_blog=$user['id'];
if (isset($_GET['id']))$user_blog=intval($_GET['id']);
if (!isset($user_blog))
{
$set['title']='Ошибка';
include_once '../sys/inc/thead.php';
title();
aut();
echo "Нет такого пользователя";
echo"<div class='foot'>n";
echo"<a href='index.php'>Дневники</a><br />n";
echo"</div>n";
include_once '../sys/inc/tfoot.php';
exit();
}
$ank_user=get_user($user_blog);
if(!$ank_user)
{
$set['title']='Ошибка';
include_once '../sys/inc/thead.php';
title();
aut();
echo "Нет такого пользователя";
echo"<div class='foot'>n";
echo"<a href='index.php'>Дневники</a><br />n";
echo"</div>n";
include_once '../sys/inc/tfoot.php';
exit();
}
$set['title']='Блоги обитателя '.$ank_user['nick'].'';
include_once '../sys/inc/thead.php';
title();
err();
aut();
if($user['id'] == $user_blog) $where="WHERE `id_user` = '$user_blog'";
else $where="WHERE `privat` = '0' && `id_user` = '$user_blog'";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_list` $where"),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 " <tr>n";
echo " <td class='p_t'>n";
echo "У пользователя нету дневников<br />";
echo " </td>n";
echo " </tr>n";
}
$res = mysql_query("select * from `blog_list` $where order by `time` desc LIMIT $start, $set[p_str];");
while ($blog = mysql_fetch_array($res)){
$ank=get_user($blog['id_user']);
if($num==1){
echo '<div class="frends">';
$num=0;
}else{
echo '<div class="frends2">';
$num=1;}
//avatar2($ank['id']);
//echo "<br />";
echo "".online($ank['id'])." ";
echo "<img src='/style/papka/user/$ank[pol].png' alt='' /> ";
echo "<a href='/info.php?id=$ank[id]'>$ank[nick]</a> <span class='ank_n'>(".vremja($blog['time']).")</span><br />n";
echo "<img src='/blog/gall2.gif' alt=''/> <a href='list.php?id=".$blog['id']."'>".output_text($blog['name'])."</a> ";
echo"(<a href='komm.php?id=$blog[id]'>Комментарии <b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_komm` WHERE `id_blog` = '$blog[id]'"),0)."</b></a>)<br/>";
echo "</div>n";
}
if (isset($user_blog)) $dop="id=$user_blog&";
else $dop='';
if ($k_page>1)str('?'.$dop.'',$k_page,$page); // Вывод страниц
if(isset($user))
{
echo"<img src='/images/Back.gif' alt='' class='icon'/> <a href='index.php'>К блогам</a><br />n";
}
include_once '../sys/inc/tfoot.php';
?>