<?

$id=intval($_GET['id']);

if (isset($_GET['ok']))
{
$id=intval($_GET['ok']);

$post=mysql_fetch_array(mysql_query("SELECT * FROM `us_wall` WHERE `id`= '$id' LIMIT 1"));
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[id_user]' LIMIT 1"));
if ($_POST['translit'] == 1)
{
$repl=translit($_POST['reply']);
}
else
{
$repl=$_POST['reply'];
}
$reply=mysql_real_escape_string($repl);
$uadm = get_user($post['id_user_adm']);

if ($user['pol']==1)
{
$ost = "ответил";
}
else
{
$ost = "ответила";
}

$msg2="[b]$user[nick][/b] ".$ost." на Bашу запись на [url=http://xlofes.ru/wall/?id=$post[id_user_adm]] стене [/url] у пользователя $uadm[nick]";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msg2', '$time')");

mysql_query("UPDATE `us_wall` SET `reply` = '$reply', `who_reply` = '$user[id]' WHERE `id` = '$post[id]' LIMIT 1");

$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '$user[id]'");
while ($f = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$f[frend]' LIMIT 1"));

if ($user['pol']==1)
{
$ost = "ответил";
$vash = "Ваш";
}
else
{
$ost = "ответила";
$vash = "Ваша";
}

$msg_lenta="".$vash." друг [b]$user[nick][/b] ".$ost." на запись $ank[nick] на [url=http://xlofes.ru/wall/?id=$post[id_user_adm]] стене [/url] у пользователя [b]$uadm[nick][/b]";

mysql_query("INSERT INTO `lenta` (`id_user`, `id_kont`, `msg`, `time`) values('$user[id]', '$a[id]', '$msg_lenta', '$time')"); 
}


header("Location: ?user=$ku[id]");
exit;
}

$id=intval($_GET['id']);

$post=mysql_fetch_array(mysql_query("SELECT * FROM `us_wall` WHERE `id` = '$id' LIMIT 1"));
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$post[id_user_adm]' LIMIT 1"));

//echo "<div class='rowup'>";
echo ''.on_k($post['id_user_adm']).' <a class="" href=?user='.$post['id_user_adm'].'>'.nc($post['id_user_adm']).'</a>';
echo " пишет: <br />";
//echo "".esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['msg']))))))))."</div>";
echo ''.output_text($post['msg'], $post['id_user_adm']).'<br />';


echo '<form method="post" action="?reply&id='.$id.'&amp;ok='.$id.'">';
echo '<div class="forma">Ответ: </br><textarea name="reply">'.$ank['nick'].', </textarea><br/>';
echo '<input type="submit" value="Ответить"/>';
echo '</form></div>';

















?>