View file user/activity/inc/forum.php

File size: 1.95Kb
<?
/*
* $name описание действий объекта 
*/
if ($type == 'them' && $post['avtor'] != $user['id'])
{
	$name = 'создал' . ($avtor['pol'] == 1 ? null : "а") . ' в форуме тему ';
}

/*
* Вывод блока с содержимым 
*/
if ($type == 'them')
{
$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '" . $post['id_file'] . "' LIMIT 1"));
$razdel = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
$forum = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$razdel[id_forum]' LIMIT 1"));
$comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0);
	
if ($them['id'])
{
$_msg = text($them['text']);

if (iconv_strlen($_msg, 'UTF-8') > 500) {
        $_msg= iconv_substr($_msg, 0, 497, 'UTF-8');
        $_msg = $_msg.'...';
}


?>
<div class="wrapper"> 
<div class="block oh">  
<div class="oh grey no-borders"> 
<div> 
<div class="grey small right"><?= vremja($post['time'])?></div>  
<span class="grey"> Добавил<?= ($avtor['pol'] == 1 ? null : "а")?>  тему  </span>  
</div>   
<div class="action-item-wrap">     
<div class="list_item attaches_limiter">  
<b> <a href="/forum/<?= $forum['id']?>/<?= $razdel['id']?>/<?= $them['id']?>/" class="arrow_link"> <span><?= text($them['name'])?></span> </a> </b>  
<div> <?= $_msg?> </div> 
<div>  </div>  
<?
if($comm  > 0){
?>
<div class="oh cl grey pad_t_a"> 
<div class="left"> 
<img alt="" class="m p16" src="/user/activity/ico/comm.png"> <span class="m"><?= $comm?></span> 
</div> 
</div>  
<?
}
?>
</div>       </div>  </div>   </div> </div>
<?
}
else
{
?>
<div class="wrapper"> <div class="block oh">  <b class="grey">Тема форума удалена.</b>  </div>  </div>
<?
query("DELETE FROM `user_activity` WHERE `id_user` = '$user[id]' AND `id` = '$post[id]' LIMIT 1");
}

}
?>