View file discussions/inc/forum.php

File size: 2.4Kb
<?

if ($type == 'them')
{
	$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	
	if ($them['id'])
	{
		
	$name = htmlspecialchars ($them['name']);	

	$comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$them[id]'"),0);
	$share = mysql_result(mysql_query("SELECT COUNT(*)FROM `notes` WHERE `share_id`='".$them['id']."' AND `share_type`='forum'"),0);	
	$fave = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmarks` WHERE `id_object` = '".$them['id']."' AND `type`='forum'"),0);	
		
	echo'
	<div class="wrapper" style="margin: -1px 5px;"> 
	<div class="block attaches_limiter"> 
	<div class="oh">   
	<span class="right"> <span class="grey">' . vremja($post['time']) . '</span>   </span>   
	<img class="p14" src="/user/discussions/ico/forum.png" alt="(ON)">
	<a class="break-word arrow_link strong_link" href="/forum/'.$them['id_forum'].'/'.$them['id_razdel'].'/'.$them['id'].'/?page='.$pageEnd.'"> '.$name.' </a>
	'.($post['count'] > 0 ? '<font color="red">+ '.$post['count'].'</font>':'').'
	<br>
	<span class="grey"> '.($post['count'] > 0 ? 'Новый комментарий':'Комментарии').' 
	'.($type == 'them' && $post['avtor'] != $user['id'] ? 'в теме <font color="green">'.$avtor['nick'].'</font>':'в вашей теме').'</span>  
	
	<span class="right">
	<a href="/user/discussions/?delete=loc&st='.$post['id'].'">
	<img src="/user/discussions/ico/cross_light.png" alt="" class="m">
	</a>
	</span>
	</div></div></div>
	
	<div class="oh bord-tops js-action_bar action-bar"> 
	<table class="table__wrap table__wrap-fixed grey"> 
	<tbody><tr>   
	
	
	<td class="table__cells relative m" style=" border-left: 1px solid #cdd4e1;"> 
	<a class="link">
	<img src="/user/discussions/ico/comment.png" alt="" class="m"> 
	<span class="grey">'.$comm.'</span> 
	</a>
	</td>    

	<td class="table__cells relative m">    
	<a class="link">
	<img src="/user/discussions/ico/share.png" alt="" class="m p16"> 
	<span class="grey">'.$share.'</span>  </td>  
	</a>
	<td class="table__cells relative m">    
	<a class="link">
	<img src="/user/discussions/ico/fav.png" alt="" class="m p16"> 
	<span class="grey">'.$fave.'</span>  </td>  
	</a>
	</tr></tbody></table> 
	</div>
	</br>
	
	
	
	
	';	
		
	}else{echo '<div class="wrapper block"> Тема удалена. </div>';}
}



?>