<?
/*
* Заголовок обсуждения
*/

if ($type == 'them' && $post['avtor'] != $user['id'])
{
	$name = __('Форум | Тема форума');
}
else if ($type == 'them' && $post['avtor'] == $user['id'])
{
	$name = __('Форум | Ваша тема');
}
 
/*
* Выводим на экран
*/
if ($type == 'them')
{
	$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	
	if ($them['id'])
	{
		?>
		<div class="nav1">
		<img src="/style/icons/forum.png" alt="*"/> <a href="/forum/<?= $them['id_forum']?>/<?= $them['id_razdel']?>/<?= $them['id']?>/?page=<?= $pageEnd?>"><?= $name?></a> 
		<?
		if ($post['count'] > 0)
		{
			?><b><font color='red'>+<?= $post['count']?></font></b><?
		}
		?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		
		<div class="nav2">
		<b><font color='green'><?= $avtor['nick']?></font></b> 
		<?= ($avtor['id'] != $user['id'] ? '<a href="user.settings.php?id=' . $avtor['id'] . '">[!]</a>' : '')?> 
		<?= $avtor['medal']?> <?= $avtor['online']?> &raquo; <b><?= text($them['name'])?></b><br />
		<span class="text"><?= output_text($them['text'])?></span>
		</div>
		<?
	}
	else
	{
		?>
		<div class="mess">
		<?= __('Тема форума уже удалена =(')?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		<?
	}

}

/
*
* Заголовок обсуждения
*/

if ($type == 'forumkomm' && $post['avtor'] != NULL)
{	
	$theme = mysql_fetch_assoc(mysql_query("SELECT * FROM `comm_forum_theme` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	$razdel = mysql_fetch_array(mysql_query("SELECT * FROM `comm_forum_razdel` WHERE `id` = '".intval($theme['id_razdel'])."' LIMIT 1"));
	$comm = get_comm($razdel['id_comm']);
	$name = __('Форум | Тема сообщества '.text($comm['name']).'');
}

 
/*
* Выводим на экран
*/
if ($type == 'forumkomm')
{
	$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `comm_forum_theme` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	
	if ($them['id'])
	{
		?>
		<div class="nav1">
		<img src="/style/icons/forum.png" alt="*"/> <a href="/comm/theme/<?= $them['id']?>/?page=<?= $pageEnd?>"><?= $name?></a> 
		<?
		if ($post['count'] > 0)
		{
			?><b><font color='red'>+<?= $post['count']?></font></b><?
		}
		?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		
		<div class="nav2">
		<b><font color='green'><?= $avtor['nick']?></font></b> 
		<?= $avtor['medal']?> <?= $avtor['online']?> &raquo; <b><?= text($them['name'])?></b><br />
		<span class="text"><?= output_text($them['text'])?></span>
		</div>
		<?
	}
	else
	{
		?>
		<div class="mess">
		<?= __('Тема сообщества уже удалена =(')?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		<?
	}

}
/*
* Заголовок обсуждения
*/

if ($type == 'newskomm' && $post['avtor'] != NULL)
{	
	$theme = mysql_fetch_assoc(mysql_query("SELECT * FROM `comm_news` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	$comm = get_comm($theme['id_comm']);
	$name = __('Новости | Новости сообщества '.text($comm['name']).'');
}

 
/*
* Выводим на экран
*/
if ($type == 'newskomm')
{
	$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `comm_news` WHERE `id` = '".$post['id_sim']."' LIMIT 1"));
	
	if ($them['id'])
	{
		?>
		<div class="nav1">
		<img src="/style/icons/news.png" alt="*"/> <a href="/comm/readnews/<?= $them['id']?>/?page=<?= $pageEnd?>"><?= $name?></a> 
		<?
		if ($post['count'] > 0)
		{
			?><b><font color='red'>+<?= $post['count']?></font></b><?
		}
		?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		
		<div class="nav2">
		<b><font color='green'><?= $avtor['nick']?></font></b> 
		<?= $avtor['medal']?> <?= $avtor['online']?> &raquo; <b><?= text($them['title'])?></b><br />
		<span class="text"><?= output_text($them['msg'])?></span>
		</div>
		<?
	}
	else
	{
		?>
		<div class="mess">
		<?= __('Новость сообщества уже удалена =(')?>
		<span class="time"><?= $s1 . vremja($post['time']) . $s2?></span>
		</div>
		<?
	}

}
?>