Файл: setk/plugins/notes/user.php
Строк: 129
<?
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 (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'notes' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0' OR `navsegda` = '1')"), 0)!=0)
{
header('Location: /ban.php?'.SID);exit;
}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank=get_user($ank['id']);
if ($ank['id']==0)
{
$ank=get_user($ank['id']);
echo "<span class="status">Доступ запрещен!</span><br />n";
exit;
}
$set['title']='Дневник | ' . $ank['nick'] . '';
include_once '../../sys/inc/thead.php';
title();
if (isset($user)){
echo "<div class='act'>";
echo "<a class='act_noactive' href='/info.php?id=".$ank['id']."'>Профиль</a>";
echo'<a class="act_active">Дневник </a>';
echo"</div>";
}
if(isset($user) && $user['id']==$ank['id'])
{
echo'<div class="hide">';
echo "<a href='/plugins/notes/user.php?id=$ank[id]'>Дневник |
<a href='/info.php?id=$ank[id]'>$ank[nick]</a>n";
echo' | <a href="add.php">Написать</a>';
echo'</div>';
}else{
echo'<div class="hide">';
echo "<a href='/plugins/notes/user.php?id=$ank[id]'>Дневник |
<a href='/info.php?id=$ank[id]'>$ank[nick]</a>n";
echo'</div>';
}
if (isset($_GET['sort']) && $_GET['sort'] =='t')$order='order by `time` desc';
elseif (isset($_GET['sort']) && $_GET['sort'] =='c') $order='order by `count` desc';
else $order='order by `time` desc';
if (isset($_GET['sort']) && $_GET['sort'] =='t'){
echo'<table width="100%" cellspacing="0" cellpadding="0">';
echo'<tr>';
echo'<td class="top_menu"><center>Новые</center></td>';
echo"<td class='top_menu_act'><a href='?id=$ank[id]&sort=c'><center>Популярные</center></a></td>";
echo '</tr></table>';
}elseif (isset($_GET['sort']) && $_GET['sort'] =='c'){
echo'<table width="100%" cellspacing="0" cellpadding="0">';
echo'<tr>';
echo"<td class='top_menu_act'><a href='?id=$ank[id]&sort=t'><center>Новые</center></a></td>";
echo'<td class="top_menu"><center>Популярные</center></td>';
echo '</tr></table>';
}else{
echo'<table width="100%" cellspacing="0" cellpadding="0">';
echo'<tr>';
echo'<td class="top_menu"><center>Новые</center></td>';
echo"<td class='top_menu_act'><a href='?id=$ank[id]&sort=c'><center>Популярные</center></a></td>";
echo '</tr></table>';
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` WHERE `id_user` = '$ank[id]' "),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `notes` WHERE `id_user` = '$ank[id]' $order LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
if ($k_post==0)
{
echo " <div class='block'>n";
echo "Нет записейn";
echo " </div>n";
}
$num=0;
while ($post = mysql_fetch_assoc($q))
{
echo "<a class='touch_white' href='list.php?id=$post[id]'>";
echo group($ank['id']) . " $ank[nick] ";
echo medal($ank['id']) . " " . online($ank['id']) . "</br> ";
echo htmlspecialchars($post['name'])."";
echo " <span class='color' style='float: right;'>".vremja($post['time'])."</span></a>n";
$k_n= mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` WHERE `id` = '$post[id]' AND `time` > '".$ftime."'",$db), 0);
echo " </div>n";
}
echo "</table>n";
if (isset($_GET['sort'])) $dop="sort=$_GET[sort]&";
else $dop='';
if ($k_page>1)str('?id=' . $ank['id'] . '&'.$dop.'',$k_page,$page); // Вывод страниц
include_once '../../sys/inc/tfoot.php';
?>