File size: 2.99Kb
<?
/*
* $name описание действий объекта
*/
if ($type == 'status_like' && $post['avtor'] != $user['id']) // статус like
{
$name = 'считает классным статус';
}
else if ($type=='status_like' && $post['avtor'] == $user['id'])
{
$name = 'считает классным ваш статус';
}
else if ($type=='status' && $post['avtor'] != $user['id'])
{
$name = 'установил' . ($avtor['pol'] == 1 ? null : "а") . ' новый статус';
}
/*
* Вывод блока с содержимым
*/
if ($type == 'status_like' || $type == 'status')
{
$status = mysql_fetch_assoc(mysql_query("SELECT * FROM `status` WHERE `id` = '" . $post['id_file'] . "' LIMIT 1"));
$otkogo = get_user($post['ot_kogo']);
if ($status['id'])
{
$comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_komm` WHERE `id_status` = '$status[id]'"),0);
$l = mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id_status` = '$status[id]'"),0);
?>
<div class="block oh <?= $dop_div?>">
<div class="grey no-borders">
<a class="right" href="?del=<?= $post['id']?>"><img class="m p16" src="/user/tape/ico/cross_light.png" alt=""></a>
<div>
<?
if ($post['ot_kogo']){
?>
<?= group($otkogo['id'])?>
<a href="/user/tape/subscr/?uid=<?= $otkogo['id']?>" class="mysite-link"><b class="nick"><?= $otkogo['nick']?></b></a>
<?= medal($otkogo['id'])?> <?= online($otkogo['id'])?>
<?
}
else
{
?>
<?= group($avtor['id'])?>
<a href="/user/tape/subscr/?uid=<?= $avtor['id']?>" class="mysite-link"><b class="nick"><?= $avtor['nick']?></b></a>
<?= medal($avtor['id'])?> <?= online($avtor['id'])?>
<?
}
?>
<span class="grey"> <?= $name?> </span>
<?
if ($type != 'status'){
?>
<?= group($avtor['id'])?>
<a href="/info.php?id=<?= $avtor['id']?>" class="mysite-link"><b class="nick"><?= $avtor['nick']?></b></a>
<?= medal($avtor['id'])?> <?= online($avtor['id'])?>
<?
}
?>
<div class="grey small cl"><?= $s1 . vremja($post['time']) . $s2?></div>
<div class="bubble"> <?= output_text($status['msg'])?> </div>
<a class="right" href="/user/status/komm.php?id=<?= $status['id']?>">
<img src="/user/tape/ico/comm_ico.png" class="m p16" alt=""> <span class="m grey"><?= $comm?> </span>
</a>
<a class="right" style="margin-right:5px;" href="/user/status/like.php?id=<?= $status['id']?>">
<img src="/user/tape/ico/status_like.png" class="m p16" alt=""> <span class="m grey"><?= $l?> </span>
</a>
<?
if (isset($user) && $user['id'] != $avtor['id'])
{
if ($user['id']!=$avtor['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id_status` = '$status[id]' AND `id_user` = '$user[id]' LIMIT 1"),0)==0){
?>
<a href="?likestatus=<?= $status['id']?>&page=<?= $page?>" class="blue">
<img src="/user/tape/ico/status_like_blue.png" alt=""/> Like!
</a>
<?
}
}
?>
</div> </div> </div>
<?
}
else
{
?>
<b class="grey">Статус уже удалён.</b>
<?
query("DELETE FROM `tape` WHERE `id_user` = '$user[id]' AND `id` = '$post[id]' LIMIT 1");
}
}
?>