<?
$DIR = $_SERVER["DOCUMENT_ROOT"];
include_once $DIR.'/sys/inc/start.php';
include_once $DIR.'/sys/inc/compress.php';
include_once $DIR.'/sys/inc/sess.php';
include_once $DIR.'/sys/inc/home.php';
include_once $DIR.'/sys/inc/settings.php';
include_once $DIR.'/sys/inc/db_connect.php';
include_once $DIR.'/sys/inc/ipua.php';
include_once $DIR.'/sys/inc/fnc.php';
include_once $DIR.'/sys/inc/user.php';
$set['title']='Стена - Голосование';
include_once $DIR.'/sys/inc/thead.php';
title();


if (!isset($_GET['id']) && !is_numeric($_GET['id'])){header("Location: index.php?".SID);exit;}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `wall` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1",$db), 0)==0){header("Location: index.php?".SID);exit;}



$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_like` WHERE `id_zap` = '".intval($_GET['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 `wall_like` WHERE `id_zap` = '".intval($_GET['id'])."' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>\n";
if ($k_post==0)
{
?><div class='ankus'>Нет лайков</div><?
}
while ($post = mysql_fetch_assoc($q))
{
$ank=get_user($post['id_user']);

?><div class='hmenu'><?
echo "<a href='/info.php?id=$ank[id]'>$ank[nick]</a>".online($ank['id'])." ";
?></div><?
}


if ($k_page>1)str("wall_golos.php?id=".intval($_GET['id']).'&amp;',$k_page,$page); // Вывод страниц
include_once $DIR.'/sys/inc/tfoot.php';
?>