Файл: feed/groups.php
Строк: 34
<?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.'/');}
$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 href="'.URL.'/feed/update.php" onclick="Page.Go(this.href); return false;">'.lang('Обновления','Оновлення').'</a>
<a class="title_a_hover" 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>';
if ($user['count_groups']>0)
{
$arr_my_groups = mysql_fetch_array(mysql_query("SELECT * FROM `my_groups` WHERE `user_id` = '".$user_id."' LIMIT 1"));
$arr_lists = implode(",", array(substr(str_replace("||",",",$arr_my_groups['groups']),1,-1)));
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `groups_wall` WHERE `wall_id` IN (".$arr_lists.")"),0);
$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 * FROM `groups_wall` WHERE `wall_id` IN (".$arr_lists.") ORDER by `time` DESC LIMIT $start,10");
while ($arr = mysql_fetch_array($res))
{
echo group_wall_post($arr,0,0,1);
}
navi($p,$cp,'/feed/groups.php?');
}
require_once '../incfiles/foot.php';
?>