Файл: lenta_user.php
Строк: 42
<?
include 'connect.php';
include 'core/panel.php';
include 'core/bb_code.php';
$title = $title.' | Моя лента';
include 'head.php';
echo '<div class="div">Страничка пользователя: <a href = "/page.php?id='.$u['id'].'">'.$u['login'].'</a> | Моя лента</div>';
if(!isset($u)){
echo '<div class="err">Доступ закрыт.</div>';
}else{
mysql_query("UPDATE `lenta_user` SET `read` = '1' WHERE `id_kont` = '".$u['id']."' AND `read` = '0'");
echo '<table class="post">';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta_user` WHERE `id_kont` = '".$u['id']."'"),0);
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $count - $count;
if($k_post==0){
echo '<div class="div">Лента пуста!</div>';
}
$q=mysql_query("SELECT * FROM `lenta_user` WHERE `id_kont` = '".$u['id']."' ORDER BY time DESC LIMIT 10");
while ($post = mysql_fetch_array($q)){
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$post[id_user]'"));
echo '<div class="div">';
echo "". ico($ank['sex'],$ank['admin']) ." <a href='/page.php?id=$ank[id]'> ".$ank['login']."</a>". online($ank['online']) ." ".vremya_ban($post['time'])."
</br>";
echo ''.smile(links($post['msg'])).'</div>';
echo "</div>";
}
navigation($page, $total,'lenta_user.php?id='.$u['id'].'&');
}
echo '</div>';
echo "<div class='div'>";
echo "<img src='ico/settings.gif'></img><a href='lenta_set.php'> Настройки ленты</a>";
echo '</div>';
include_once 'foot.php';
?>