<?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 (!empty($_GET['id']) && is_numeric($_GET['id']))
{
	$id = abs(intval($_GET['id']));
	$result = mysql_query("SELECT * FROM `groups_wall` WHERE `id` = '".$id."' LIMIT 1");
	if (mysql_num_rows($result) == true)
	{
		$arr = mysql_fetch_array(mysql_query("SELECT * FROM `groups_wall` WHERE `id` = '".$id."' LIMIT 1"));
		$arr_group = mysql_fetch_array(mysql_query("SELECT * FROM `groups` WHERE `id` = '".$arr['wall_id']."' LIMIT 1"));
	}
	else go(URL);

}
else go(URL);

if ($user_id != $arr['user_id'] && !in_array($user_id, explode("||", substr($arr_group['admins'], 1, -1)))) go(URL);
				
$title = lang('Просмотр записи :: Репосты','Перегляд запису :: Репости');
require_once '../../incfiles/head.php';
echo group_access($arr_group);

	echo '<div class="title">
	<a class="title_a_hover" href="'.URL.'/groups/wall/post.php?id='.$id.'" onclick="Page.Go(this.href); return false">'.lang('Запись','Запис').'</a>
	</div>';
	echo group_wall_post($arr);

echo '<div class="title"><div class="right">'.$arr['crepost'].'</div>'.lang('Репосты','Репости').'</div>';

if (!empty($arr['urepost']))
{
	$q = explode("||", substr($arr['urepost'], 1, -1));
	$count = count($q);
	$cp = ceil($count/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;

	for ($i = 0; $i < $count; $i++)
	{
		echo '<div class="block">'.user_name($q[$i]).'<br/><br/></div>';
	}
	navi($p,$cp,''.URL.'/groups/wall/show_repost.php?id='.$id.'&');
}
require_once '../../incfiles/foot.php';

?>