Файл: feed/update.php
Строк: 51
<?php
require_once '../incfiles/core.php';
require_once '../incfiles/func.php';
require_once '../incfiles/auth.php';
require_once '../incfiles/user.php';
if (empty($user_id)) {go(URL.'/');}
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `feed` WHERE `time` < '".(time()-3600*24*7)."' LIMIT 1"),0) == true) mysql_query("DELETE FROM `feed` WHERE `time` < '".(time()-3600*24*7)."'");
$title = lang('Мои Новости','Мої Новини');
require_once '../incfiles/head.php';
echo '<div class="title">
<a href="'.URL.'/feed/" onclick="Page.Go(this.href); return false;">Записи</a>
<a href="'.URL.'/feed/photos.php" onclick="Page.Go(this.href); return false;">Фото</a>
<a class="title_a_hover" href="'.URL.'/feed/update.php" onclick="Page.Go(this.href); return false;">'.lang('Обновления','Оновлення').'</a>
<a href="'.URL.'/feed/groups.php" onclick="Page.Go(this.href); return false;">'.lang('Сообщества','Спільноти').'</a>
<a href="'.URL.'/feed/search.php" onclick="Page.Go(this.href); return false;">'.lang('Поиск','Пошук').'</a>
</div>';
$res = mysql_query("SELECT SQL_CALC_FOUND_ROWS tb1.user_id, tb1.friend_id, tb2.user_id, tb2.type, tb2.time FROM `friends` tb1,`feed` tb2 WHERE tb1.user_id = '".$user_id."' AND tb1.friend_id = tb2.user_id");
$all = mysql_num_rows($res);
if ($all == true)
{
$cp = ceil($all/10);
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
$start = $p*10-10;
$res = mysql_query("SELECT SQL_CALC_FOUND_ROWS tb1.user_id, tb1.friend_id, tb2.user_id, tb2.sex, tb2.type, tb2.refid, tb2.uptime, tb2.time FROM `friends` tb1,`feed` tb2 WHERE tb1.user_id = '".$user_id."' AND tb1.friend_id = tb2.user_id ORDER by tb2.uptime DESC LIMIT $start,10");
while ($arr = mysql_fetch_array($res))
{
if ($arr['type'] == 'friends')
{
echo '<div class="block">'.user_name($arr['user_id']).'<ul>'.($arr['sex']==1?lang('добавил в Друзья','додав у Друзі'):lang('добавила в Друзья','додала у Друзі')).':</ul><ul>';
$q = explode("||", substr($arr['refid'], 1, -1));
$count = count($q);
for ($i = 0; $i < $count; $i++) echo '<a href="'.URL.'/?id='.$q[$i].'" onclick="Page.Go(this.href); return false;">'.user_name3($q[$i]).'</a>'.(($i+1)<$count?', ':'');
echo '</ul></div>';
}
}
navi($p,$cp,'/feed/update.php?');
}
require_once '../incfiles/foot.php';
?>