	<ul class="prime pd-10">
		{{$nav}}
	</ul>

	<div class="r_block">
		<div class="r_block_head">
			{name}
		</div> 
		<div class="r_block_c pad0 forums">
			{if('{page}' == '1')}
			<table class="block answer mar0" id="answer_0">
				<tr>
					<td class="col-xs-2">
						<div class="line">
							<a href="../profile?id={author_id}" class="fs-17">{author_login}</a>
						</div>
					</td>
					<td class="col-xs-10">
						<div class="line">
							<font class="f-l">{date}</font>
							{if(is_worthy("e"))}
							<a href="#" class="f-r c-p"><span class="glyphicon glyphicon-trash" data-placement="left" tooltip="yes" data-original-title="Удалить" onclick="dell_topic('{id}' , '{id2}');"></span></a>
							{/if}
							{if((is_worthy("e")) or (isset($sessionid) and $sessionid != null and '{author_id}' == '{my_id}'))}
							<a href="edit_topic?id={id}" class="f-r c-p"><span class="glyphicon glyphicon-pencil" data-placement="left" tooltip="yes" data-original-title="Редактировать"></span></a>
							{/if}
						</div>
					</td>
				</tr>
				<tr>
					<td class="col-xs-2">
						<div class="user">
							<img src="../{author_avatar}" alt="{author_login}"><br>
							<p style="color: {group_color}">{group_name}</p>
							<p>Рейтинг: {reit}</p>
							<p>Сообщений: {answers}</p>
							<p class="mb-10">Спасибок: {thanks}</p>
						</div>
					</td>
					<td class="col-xs-10">
						<div id="text_0" class="with_code">
							{text}
						</div>
						<div class="clearfix"></div>
						{if('{edited_by_id}' != '')}<div class="edited">Отредактировал: <a href="../profile?id={edited_by_id}" title="{edited_by_login}">{edited_by_login}</a>, {edited_time}</div>{/if}
						{if('{signature}' != '')} <hr class="delimiter"> {signature} <div class="clearfix"></div>{/if}
					</td>
				</tr>
				<tr>
					{if(isset($sessionid) and $sessionid != null and '{author_id}' != '{my_id}')}
					<td class="col-xs-2">
						<div class="btn-group disp-b" role="group">
							<a class="btn btn-default btn-sm c-p" onclick="answer(0,'{author_login}','{link}');" type="button">Ответ</a>
							<a class="btn btn-default btn-sm c-p" onclick="thank({id},1);" type="button">Спасибо</a>
						</div>
					</td>
					<td class="col-xs-10">
						{thanks_str}
					</td>
					{else}
					<td class="col-xs-12" colspan="2">
						{thanks_str}
					</td>
					{/if}
				</tr>
			</table>

			{/if}
			<div id="answers">
				{func Forum:get_answers("{id}", "{start}", "{limit}", "{script}", "{link}")}
			</div>
			<div id="pagination2"><center>{pagination}</center></div>
		</div>
	</div>
	{if(is_auth())}
		{if('{status}' == '1' or '{status}' == '3')}
		<div class="r_block mb-0">
			<div class="r_block_head">
				<span class="glyphicon glyphicon-plus"></span> Оставить ответ
			</div> 
			<div class="r_block_c">
				<div id="send_answer">
					<textarea id="text" class="form-control maxMinW100" maxlenght="2000"></textarea>
					<div class="smile_input_forum">
						<input id="send_btn" class="btn2 mt-10" type="button" onclick="send_answer('{id}');" value="Отправить"></input>
						<div id="smile_btn" class="smile_btn visible-lg-inline-block" data-container="body" data-toggle="popover" data-placement="top" data-content="empty"></div>
					</div>
				</div>
				<script>

				</script>
			</div>
		</div>
		{else}
		<div class="disabled_input form-control">Тема закрыта <span class="glyphicon glyphicon-ban-circle"></span></div>
		{/if}
	{/if}
	<script>
		$(document).ready(function() {
			init_tinymce("text", "forum", "{file_manager_theme}", "{file_manager}", "{{md5($conf->code)}}");
			get_smiles('#smile_btn', 1);
		});

		$('#smile_btn').popover({ html: true, animation: true, trigger: "click" });
		$('#smile_btn').on('show.bs.popover', function () {
			$(document).mouseup(function (e) {
				var container = $(".popover-content");
				if (container.has(e.target).length === 0){
					$('#smile_btn').popover('hide'); selected = 'gcms_smiles';
				}
			});
		});

		function set_smile(elem){
			var smile =  "<img src=\""+$(elem).attr("src")+"\" class=\"g_smile\" height=\"20px\" width=\"20px\">";
			tinymce.activeEditor.insertContent(smile);
			$('#smile_btn').popover('hide'); selected = 'gcms_smiles';
		}
	</script>
</div>

<div class="right_block">
	<div class="l_block">
		<div class="l_block_head">
			Последняя активность
		</div> 
		<div class="l_block_c">
			<div id="last_activity">
				{func Widgets:last_forum_activity('3')}
			</div>
		</div>
	</div>

	<div class="l_block">
		<div class="l_block_head">
			Топ 5 пользователей
		</div> 
		<div class="l_block_c">
			<div id="top_users">
				{func Widgets:top_users('5')}
			</div>
		</div>
	</div>
</div>