if ($uset['wall']==1)
{
echo "<div class='mdlc2'><span><a href='?id=".$ank['id']."&amp;wall_set=0'>Стена</a></span><br /></div><div class='menu'>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `us_wall` WHERE `id_user_adm` = '".$ank['id']."'"),0);
echo "<div class='rowup'>";
echo "".sklon_after_number("$k_post","запись","записи","записей",1)." ";
echo "<span style='float:right'><a href='/wall/?id=".$ank['id']."'>Все</a></span></div>";
echo '<form method="post" action="?id='.$ank['id'].'&amp;'.$passgen.'">';
echo "&raquo; Сообщение | <a href='/smiles/'>Смайлы</a> | <a href='/apps/'>Приложения</a> | <a href='/apps/graffity/index.php?uid=$ank[id]'>Граффити</a><br />\n";
echo "<input type='text' name=\"msg_wall\" size='20' /><br />\n";
if ($user['set_translit']==1)echo "<label><input type=\"checkbox\" name=\"translit\" value=\"1\" /> Транслит</label><br />\n";
echo "<input value=\"Отправить\" type=\"submit\" />\n";
echo "</form>\n";


$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `us_wall` WHERE `id_user_adm` = '".$ank['id']."'"),0);
if ($k_post==0)
{
echo "&raquo; Стена пуста<br/>\n";
}

$q=mysql_query("SELECT * FROM `us_wall` WHERE `id_user_adm` = '".$ank['id']."' ORDER BY id DESC LIMIT 5");

while ($post = mysql_fetch_array($q))
{
$wank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['id_user']."' LIMIT 1"));

if($num==1){ echo "<div class='rowdown'>";
$num=0;}
else
{echo "<div class='rowup'>";
$num=1;}

if ($post['type']=='msg')
{
echo "".online($wank['id'])." <a href='/info.php?id=".$wank['id']."'>";
echo GradientText("$wank[nick]", "$wank[ncolor]", "$wank[ncolor2]");
echo "</a>\n";
echo "".adm($wank['id'])."\n";

echo "<span style='float:right'>".vremja($post['time'])."</span><br/>\n";

echo "<span style='color:".$wank['color']."'>\n";
echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['msg']))))))))."</span><br />\n";

$checklove = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_love` WHERE `id_msg` = '".$post['id']."' AND `uid` = '".$user['id']."'"),0);
$countlove = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_love` WHERE `id_msg` = '".$post['id']."'"),0);
if ($checklove==1)
{
echo "<span style='float:right'>&nbsp;<img src='/wall/love.png' alt='' class='rpg' /> <a href='/wall/lovelist.php?id=".$post['id']."'>Нравится</a> ";
if ($countlove!=0)
{
echo "$countlove";
}
echo "</span><br />";
}
else
{
echo "<span style='float:right'>&nbsp;<img src='/wall/love.png' alt='' class='rpg' /> <a href='/wall/love.php?id=".$post['id']."'>Мне нравится</a> ";
if ($countlove!=0)
{
echo "$countlove";
}
echo "</span><br />";
}

if ($post['reply']!=NULL){
$urepl=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['who_reply']."' LIMIT 1"));
echo '<span style="color: red;text-decoration:underline">Ответ ';
echo GradientText("$urepl[nick]", "$urepl[ncolor]", "$urepl[ncolor2]");
echo '</span></span> '.esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['reply'])))))))).'<br />';
}
echo "<br /><span style='float:right'>";
if ($user['id']!=$post['id_user']){
echo '&nbsp;<a href="/wall/reply.php?id='.$post['id'].'"><img src="/img/mailbest.gif" alt="" class="rpg" /></a>';
}
if ((isset($user) && $user['level']>2) OR ($user['id'] == $post['id_user_adm']))
{
echo "&nbsp;<a href='/wall/delete.php?id=".$post['id']."'><img src='/img/deletemail.gif' alt='' class='rpg' /></a>\n";
}
echo "</span>";
echo "<br />";
}

if ($post['type']=='graffity')
{
echo "".online($wank['id'])." <a href='/info.php?id=".$wank['id']."'>";
echo GradientText("$wank[nick]", "$wank[ncolor]", "$wank[ncolor2]");
echo "</a>\n";
echo "".adm($wank['id'])."\n";

echo "<span style='float:right'>".vremja($post['time'])."</span><br />\n";

echo "<span style='color:".$wank['color']."'>\n";
echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['msg']))))))))."</span>\n";
echo "<hr /><span style='text-decoration:underline'>Отправлено с приложения <a href='/apps/graffity/'>Граффити на стену</a></span><hr />";

$checklove = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_love` WHERE `id_msg` = '".$post['id']."' AND `uid` = '".$user['id']."'"),0);
$countlove = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_love` WHERE `id_msg` = '$post[id]'"),0);
if ($checklove==1)
{
echo "<span style='float:right'>&nbsp;<img src='/wall/love.png' alt='' class='rpg' /> <a href='/wall/lovelist.php?id=".$post['id']."'>Нравится</a> ";
if ($countlove!=0)
{
echo "$countlove";
}
echo "</span></br>";
}
else
{
echo "<span style='float:right'>&nbsp;<img src='/wall/love.png' alt='' class='rpg' /> <a href='/wall/love.php?id=".$post['id']."'>Мне нравится</a> ";
if ($countlove!=0)
{
echo "$countlove";
}
echo "</span><br />";
}

if ($post['reply']!=NULL){
$urepl=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['who_reply']."' LIMIT 1"));
echo '<span style="color: red;text-decoration:underline">Ответ ';
echo GradientText("$urepl[nick]", "$urepl[ncolor]", "$urepl[ncolor2]");
echo '</span> '.esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['reply'])))))))).'<br />';
//echo "<font color='grey'><span style='text-decoration:underline'>Отправлено с приложения <a href='/apps/graffity/'>Граффити на стену</a></span></font>";
}
echo "<br /><span style='float:right'>";
if (isset($user) && $user['id']!=$post['id_user']){
echo '&nbsp;<a href="/wall/reply.php?id='.$post['id'].'"><img src="/img/mailbest.gif" alt="" class="rpg" /></a>';
}
if ((isset($user) && $user['level']>2) OR ($user['id'] == $post['id_user_adm']))
{
echo "&nbsp;<a href='/wall/delete.php?id=".$post['id']."'><img src='/img/deletemail.gif' alt='' class='rpg' /></a>\n";
}
echo "</span>";
echo "<br />";
}



echo "</div>\n";

}
echo "</div>";
}
else
{
echo "<div class='mdlc2'><span><a href='?id=$ank[id]&amp;wall_set=1'>Стена</a></span><br /></div><div class='menu'>";
echo "Стена скрыта</div>";
}
echo "<div class='fixpanel'><a href='/wall/?id=".$ank['id']."'>Показать все записи</a></div>";
echo "</div>";