<!-- IF LOGGED_IN -->
<style type="text/css">
<!-- IF HIDE_FROM -->.from { display: none; }<!-- ENDIF -->
<!-- IF HIDE_AVATAR -->.avatar { display: none; }<!-- ENDIF -->
<!-- IF HIDE_RANK_IMG -->.rank_img { display: none; }<!-- ENDIF -->
<!-- IF HIDE_POST_IMG -->img.postImg, div.postImg-wrap { display: none; }<!-- ENDIF -->
<!-- IF HIDE_SMILE -->.smile { display: none; }<!-- ENDIF -->
<!-- IF HIDE_SIGNATURE -->.signature { display: none; }<!-- ENDIF -->
</style>
<!-- IF SPOILER_OPENED -->
<script type="text/javascript">
	$(document).ready(function(){ $('div.sp-head').click(); });
</script>
<!-- ENDIF -->
<!-- ENDIF / LOGGED_IN -->

<style>
.box,.box-cell {
    overflow: visible !important;
    -webkit-mask-image: none !important;
}
.page-forum-thread-title .label {
    vertical-align: text-bottom;
    font-weight: bold;
}
.box-cell .btn.btn-outline {
    opacity: .4;
}
.box-cell .btn.btn-outline:hover,
.box-cell .btn.btn-outline:focus,
.box-cell .btn.btn-outline:active,
.box-cell .btn.btn-outline.active {
    opacity: 1;
}

#summernote-forum-thread-reply + .note-editor {
    border-radius: 0;
    border: none;
    margin: 0;
}
@media (min-width: 768px) {
.page-forum-thread-counters {
    border-left-style: solid;
    border-left-width: 1px;
}
html[dir="rtl"] .page-forum-thread-counters {
    border-left: 0;
    border-right-style: solid;
    border-right-width: 1px;
}
}
.avatar-top img {
    width: 40px;
    height: 40px;
    border-radius: 100%;
}
  </style>

<!-- IF $bb_cfg['use_ajax_posts'] && (AUTH_DELETE || AUTH_REPLY || AUTH_EDIT) -->
<script type="text/javascript">
ajax.open_edit = false;
function edit_post(post_id, type, text) {
	if(ajax.open_edit && ajax.open_edit != post_id) {
		alert('{L_AJAX_EDIT_OPEN}');
	} else{
		if(ajax.open_edit && !text){
			$('#pp_'+ post_id).show();
			$('#pe_'+ post_id).hide();
		} else{
			$('#pp_'+ post_id).hide();
			$('#pe_'+ post_id).show();
			ajax.exec({
				action   : 'posts',
				post_id  : post_id,
				topic_id : {TOPIC_ID},
				text     : text,
				type     : type
			});
		}
		ajax.open_edit = false;
	}
}
ajax.callback.posts = function(data) {
	if(data.html){
		$('#pp_'+ data.post_id).show().html(data.html);
		initPostBBCode('#pp_'+ data.post_id);
		$('#pe_'+ data.post_id).hide();
		ajax.open_edit = false;
	} else if(data.text){
		ajax.open_edit = data.post_id;
		$('#pe_'+ data.post_id).html(data.text);
	}
	if(data.redirect) document.location.href = data.redirect;
	if(data.hide) {
		if(ajax.open_edit == data.post_id) ajax.open_edit = false;
		$('div#post_'+ data.post_id).hide();
	}
	if(data.quote) $('textarea#message').attr('value', $('textarea#message').val() + data.message +' ').focus();
	if(data.message_html){
		$('#view_message').show();
			$('.view-message').html(data.message_html);
			initPostBBCode('.view-message');
			var maxH   = screen.height - 490;
		$('.view-message').css({ maxHeight: maxH });
	}
};
</script>
<!-- ENDIF -->

<!-- IF SPLIT_FORM -->
<script type="text/javascript">
function set_hid_chbox (id)
{
	$('#del_split_row').show();

	// set checkbox value
	$('#cb_'+id).val( $('#cb_'+id).val() == id ? 0 : id );
	// highlight selected post
	$('#post_'+id+' div').toggleClass('hl-selected-post');

	return false;
}
</script>
<!-- ENDIF / SPLIT_FORM -->

<!-- IF LOGGED_IN -->
<!-- BEGIN postrow -->
<div class="modal fade" id="pr-{postrow.POSTER_ID}" tabindex="-1">
    <div class="modal-dialog" style="max-width: 450px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">×</button>
                <h4 class="modal-title">{L_PROFILE_USER}</h4>
            </div>
            <div class="modal-body p-a-0">
                <div class="cUserHovercard">
					<div class="ipsPageHead_special bg-primary">
						<!-- IF postrow.POSTER_AVATAR --><a class="UserPhoto" href="{PROFILE_URL}{postrow.POSTER_ID}">{postrow.POSTER_AVATAR}</a><!-- ENDIF -->
						<h2 class="ipsType_reset ipsType_sectionHead ipsTruncate ipsTruncate_line ipsType_blendLinks"><span class="ipsPageHead_barText_small">{postrow.POSTER_NAME}</span></h2>
						<!-- IF postrow.POSTER_RANK --><p class="ipsType_reset ipsType_normal"><span class="ipsPageHead_barText_small"><span class="shadow_members">{postrow.POSTER_RANK}</span></span></p><!-- ENDIF -->
					</div>

					<div class="cUserHovercard_data">
						<!-- IF postrow.RANK_IMAGE --><p class="rank_img">{postrow.RANK_IMAGE}</p><!-- ENDIF -->
						<ul class="ipsDataList ipsDataList_reducedSpacing">
							<!-- IF postrow.POSTER_GENDER -->
							<li class="ipsDataItem">
								<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{L_GENDER}</strong></span>
								<span class="ipsDataItem_main">{postrow.POSTER_GENDER}</span>
							</li>
							<!-- ENDIF -->
							<!-- IF postrow.POSTER_JOINED -->
							<li class="ipsDataItem">
								<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{L_LONGEVITY}</strong></span>
								<span class="ipsDataItem_main"><time title="{postrow.POSTER_JOINED_DATE}">{postrow.POSTER_JOINED}</time></span>
							</li>
							<!-- ENDIF -->
							<!-- IF postrow.POSTER_POSTS -->
							<li class="ipsDataItem">
								<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{L_POSTS}</strong></span>
								<span class="ipsDataItem_main">{postrow.POSTER_POSTS}</span>
							</li>
							<!-- ENDIF -->
							<!-- IF postrow.POSTER_FROM -->
							<li class="ipsDataItem">
								<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{L_LOCATION}</strong></span>
								<span class="ipsDataItem_main">{postrow.POSTER_FROM}</span>
							</li>
							<!-- ENDIF -->
						</ul>
					</div>

					<div class="ipsAreaBackground ipsPad ipsClearfix">
						<ul class="ipsList_inline ipsType_blendLinks">
							<li><a class="btn btn-primary" href="{PM_URL}?mode=post&amp;u={postrow.POSTER_ID}"><i class="fa fa-envelope"></i> Личное сообщение</a></li>
							<li><a class="btn btn-primary" href="{PROFILE_URL}{postrow.POSTER_ID}"><i class="fa fa-user"></i> {L_PROFILE}</a></li>
						</ul>
					</div>
				</div>
            </div>
        </div>
    </div>
</div>

<!-- IF AUTH_MOD -->
<div class="modal fade" id="mc_{postrow.POST_ID}" tabindex="-1">
<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button aria-label="Close" data-dismiss="modal" class="close" type="button">
			<span aria-hidden="true">×</span></button>
			<h4 class="modal-title">{L_MC_TITLE}</h4>
		</div>
		<div class="modal-body">
			<div class="form-group">
				<label>{L_MC_LEGEND}</label>
					{postrow.MC_SELECT_TYPE}
			</div>
			<div class="form-group">
				<textarea name="mc_text_{postrow.POST_ID}" id="mc_text_{postrow.POST_ID}" placeholder="{L_MC_FAQ}" class="form-control" rows="3">{postrow.MC_BBCODE}</textarea>
			</div>
		</div>
		<div class="modal-footer">
			<button class="btn btn-primary pull-right" type="button" onclick="ajax.post_mod_comment({postrow.POST_ID}, $('#mc_text_{postrow.POST_ID}').val(), $('#mc_type_{postrow.POST_ID}').val());" data-dismiss="modal">{L_SUBMIT}</button>
		</div>
	</div>
</div>
</div>
<!-- ENDIF / AUTH_MOD -->

<!-- END postrow -->
<!-- ENDIF / LOGGED_IN -->

<div class="col-xl-12">
<div class="page-header">
	<div class="box m-a-0 bg-transparent">
		<h1 class="box-cell col-md-7 col-lg-8 col-xl-9">
			<span class="text-muted font-weight-light"><i class="page-header-icon ion-monitor"></i><a href="{U_INDEX}">{L_HOME}</a> / </span>
			<span class="text-muted font-weight-light"><a href="{U_VIEWCAT}">{CAT_TITLE}</a> / </span>
			<!-- IF PARENT_FORUM_NAME --><span class="text-muted font-weight-light"><a href="{PARENT_FORUM_HREF}">{PARENT_FORUM_NAME}</a> / </span><!-- ENDIF -->
			<a href="{U_VIEW_FORUM}">{FORUM_NAME}</a>
		</h1>
		<hr class="visible-xs visible-sm">
		<div class="box-cell col-md-5 col-lg-4 col-xl-3">
          <form action="{U_SEARCH}?t={TOPIC_ID}&amp;dm=1&amp;s=1" method="post" class="input-group">
            <input id="search-text" type="text" name="nm" class="form-control" placeholder="{L_SEARCH_IN_TOPIC}" required >
				<span class="input-group-btn">
					<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
				</span>
          </form>
        </div>
    </div>
</div>

<h2 class="maintitle font-weight-semibold m-y-3 text-default">
	<a class="tt-text" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a>
<!-- IF AUTH_MOD -->
<script type="text/javascript">
var $tt_td = $('.maintitle');
function edit_topic_title (mode)
{
	if (mode == 'edit') {
		var tt_text = $tt_td.find('.tt-text').text();

		ajax.tte_orig_html = $tt_td.html();
		$tt_td.html( $('#tt-edit-tpl').html() );
		$('.tt-edit-input', $tt_td).val(tt_text).focus();
	}
	else if (mode == 'save') {
		var topic_title = $('.tt-edit-input', $tt_td).val();

		ajax.edit_topic_title(topic_title);
	}
	else {
		$tt_td.html(ajax.tte_orig_html);
	}
}
ajax.edit_topic_title = function(topic_title) {
	ajax.exec({
		action      : 'mod_action',
		mode        : 'edit_topic_title',
		topic_id    : {TOPIC_ID},
		topic_title : topic_title
	});
};
ajax.callback.mod_action = function(data) {
	$tt_td.html(ajax.tte_orig_html);
	$('.tt-text', $tt_td).html(data.topic_title);
};
ajax.post_mod_comment = function(post_id, mc_text, mc_type) {
	ajax.exec({
		action  : 'post_mod_comment',
		post_id : post_id,
		mc_type : mc_type,
		mc_text : mc_text
	});
};
ajax.callback.post_mod_comment = function(data) {
	if (data.mc_type == 0) {
		$('#mc_text_'+ data.post_id).attr('value', '');
		$('#pc_'+ data.post_id).hide();
	}
	else {
		$('#pc_'+ data.post_id +' h4').html(data.mc_title);
		$('#mc_comment_'+ data.post_id).html(data.mc_text);
		$('#mc_class_'+ data.post_id).attr('class', 'alert alert-'+ data.mc_class);
		initPostBBCode('#pc_'+ data.post_id);
		$('#pc_'+ data.post_id).show();
	}
};
</script>
<a style="cursor: help; color: #800000;" title="{L_EDIT_TOPIC_TITLE}" onclick="edit_topic_title('edit'); return false" href="#">&para;</a>

<div id="tt-edit-tpl" style="display: none;">
	<div class="tt-edit input-group" style="padding: 4px;">
		<input id="search-text" type="text" name="nm" class="form-control tt-edit-input" placeholder="{L_SEARCH_IN_TOPIC}" required >
		<span class="input-group-btn">
			<button type="button" class="btn btn-primary" onclick="edit_topic_title('save'); return false;">{L_SAVE}</button>
			<button type="button" class="btn btn-default" onclick="edit_topic_title('cancel'); return false;">{L_CANCEL}</button>
		</span>
	</div>
</div>
<!-- ENDIF -->
</h2>
<hr class="page-wide-block m-t-0">

<!-- IF SHOW_DL_LIST || SHOW_TOR_ACT --><!-- INCLUDE viewtopic_torrent.tpl --><!-- ENDIF -->

<!-- IF TOPIC_HAS_POLL or CAN_MANAGE_POLL -->
<form id="poll-form" method="post" action="poll.php" style="display: none;">
<input id="poll-mode" type="hidden" name="mode" value="" />
<input type="hidden" name="topic_id" value="{TOPIC_ID}" />
<input type="hidden" name="{TOPIC_HASH}" value="1" />
<input type="hidden" name="start" value="{START}" />
<input type="hidden" name="forum_id" value="{FORUM_ID}" />
<input id="vote-id" type="hidden" name="vote_id" value="-1" />
<input id="poll-submit-btn" type="submit" name="submit" value="1" />
<input id="poll-caption-val" name="poll_caption" type="hidden" value="" />
<textarea id="poll-votes-val" name="poll_votes" rows="10" cols="10"></textarea>
</form>
<!-- ENDIF -->
<!-- IF CAN_MANAGE_POLL -->
<script type="text/javascript">
// заполняет #poll-form и отправляет запрос
function poll_manage (mode, confirm_msg)
{
	if (confirm_msg != null && !window.confirm( confirm_msg )) {
		return false;
	}
	$('#poll-mode').val(mode);
	$('#poll-caption-val').val( $('#poll-caption-inp').val() );
	$('#poll-votes-val').val( $('#poll-votes-inp').val() );
	$('#poll-submit-btn').click();
	return false;
}
function build_poll_add_form (src_el)
{
	$('#poll').empty().append( $('#poll-edit-tpl').contents() ).show();
	$('#poll-legend').html('{L_ADD_POLL}');
	$('#poll-edit-submit-btn').click(function(){
		return poll_manage('poll_add');
	});
	$(src_el).remove();
	return false;
}
</script>
<div id="poll-edit-tpl" style="display: none;">
	<div class="panel-heading text-center">
		<span class="panel-title" id="poll-legend"></span>
	</div>
	<div class="panel-body text-center">
		<div class="col-xl-6" style="margin: 0 auto;float: none;">
		<div class="form-group">
			<label class="control-label" for="poll-caption-inp">{L_NEW_POLL_M_TITLE}:</label>
			<input id="poll-caption-inp" name="poll_caption" type="text" value="" class="form-control">
		</div>
		<div class="form-group">
			<label class="control-label" for="poll-votes-inp">{L_NEW_POLL_M_VOTES}:</label>
			<textarea id="poll-votes-inp" rows="8" cols="10" wrap="off" class="form-control"></textarea>
		</div>
		</div>
	</div>
	<div class="panel-footer text-center">
		<div class="med"><i>{L_NEW_POLL_M_EXPLAIN}: {$bb_cfg['max_poll_options']})</i></div>
        <input onclick="window.location.reload();" type="button" class="btn btn-danger" value="{L_CANCEL}" />
		<input id="poll-edit-submit-btn" type="button" value="{L_SUBMIT}" class="btn btn-primary">
	</div>
</div>
<!-- ENDIF -->
<!-- IF TOPIC_HAS_POLL or CAN_ADD_POLL -->
<div id="poll" class="panel" style="display: none;">
<!-- IF TOPIC_HAS_POLL --><!-- INCLUDE viewtopic_poll.tpl --><!-- ENDIF -->
</div>
<!-- ENDIF -->

<!-- IF LOGGED_IN -->
<div class="modal fade" id="topic-options" tabindex="-1">
<div class="modal-dialog modal-sm">
	<div class="modal-content">
		<div class="modal-header">
			<button aria-label="Close" data-dismiss="modal" class="close" type="button">
			<span aria-hidden="true">×</span></button>
			<h4 class="modal-title">{L_DISPLAYING_OPTIONS}</h4>
		</div>
		<div class="modal-body">
			<h6 class="m-t-0 m-b-2 font-weight-semibold text-muted">{L_HIDE_IN_TOPIC}</h6>
			<div class="form-group">
                <label class="custom-control custom-checkbox">
                    <input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_FROM -->{CHECKED}<!-- ENDIF -->onclick="user.set('h_from', this.checked ? 1 : 0);"/>
                    <span class="custom-control-indicator"></span>
                    {L_LOCATION}
                </label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_AVATAR -->{CHECKED}<!-- ENDIF -->onclick="user.set('h_av', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_AVATARS}
				</label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_RANK_IMG -->{CHECKED}<!-- ENDIF --><!-- IF HIDE_RANK_IMG_DIS -->{DISABLED}<!-- ENDIF -->onclick="user.set('h_rnk_i', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_RANK_IMAGES}
				</label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_POST_IMG -->{CHECKED}<!-- ENDIF -->onclick="user.set('h_post_i', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_POST_IMAGES}
				</label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_SMILE -->{CHECKED}<!-- ENDIF -->onclick="user.set('h_smile', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_SMILIES}
				</label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF HIDE_SIGNATURE -->{CHECKED}<!-- ENDIF -->onclick="user.set('h_sig', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_SIGNATURES}
				</label>
			</div>
			<hr class="divider">
			<h6 class="m-t-0 m-b-2 font-weight-semibold text-muted">{L_SHOW}</h6>
			<div class="form-group">
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF SPOILER_OPENED -->{CHECKED}<!-- ENDIF -->onclick="user.set('sp_op', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_SHOW_OPENED}
				</label>
				<label class="custom-control custom-checkbox">
					<input class="topic-chbox custom-control-input" type="checkbox" <!-- IF SHOW_IMG_AFTER_LOAD -->{CHECKED}<!-- ENDIF -->onclick="user.set('i_aft_l', this.checked ? 1 : 0);"/>
					<span class="custom-control-indicator"></span>
					{L_DOWNLOAD_PIC}
				</label>
			</div>
		</div>
		<div class="modal-footer">
			<input class="btn btn-primary pull-right" type="button" value="{L_SUBMIT}" onclick="window.location.reload();" />
		</div>
	</div>
</div>
</div>
<!-- ENDIF / LOGGED_IN -->

<!-- BEGIN postrow -->
<!-- IF postrow.IS_FIRST_POST -->
<div id="post_{postrow.POST_ID}" class="panel"><a name="{postrow.POST_ID}"></a><!-- IF postrow.IS_NEWEST --><a name="newest"></a><!-- ENDIF -->
    <div class="page-forum-thread-title panel-title p-y-1">
        <div class="box m-y-0 bg-transparent">
          <div class="box-row">
            <div class="box-cell col-md-4">
              <div class="box-container">
                <div class="box-row">
                  <!-- IF postrow.POSTER_AVATAR --><div class="box-cell avatar-top" style="width: 40px;"><a href="#pr-{postrow.POSTER_ID}" data-toggle="modal">{postrow.POSTER_AVATAR}</a></div><!-- ENDIF -->
                  <div class="box-cell p-l-1">
					<div class="line-height-1" title="{L_INS_NAME_TIP}" onclick="bbcode.onclickPoster('{postrow.POSTER_NAME_JS}', {postrow.POST_ID});"><span class="font-size-11 text-muted">by
						<!-- IF QUICK_REPLY -->
						<a href="#" onclick="return false;"><strong>{postrow.POSTER_NAME}</strong></a> <!-- IF postrow.POSTER_AUTHOR --><sup>&reg;</sup><!-- ENDIF -->
						<!-- ELSE -->
						<strong>{postrow.POSTER_NAME}</strong> <!-- IF postrow.POSTER_AUTHOR --><sup>&reg;</sup><!-- ENDIF -->
						<!-- ENDIF -->
					</span></div>
                    <span class="font-size-11 text-muted">
						<a href="{POST_URL}{postrow.POST_ID}#{postrow.POST_ID}" title="{L_POST_LINK}">{postrow.POST_DATE}</a>
						<!-- IF postrow.POSTED_AFTER -->
						({L_POSTED_AFTER} {postrow.POSTED_AFTER})
						<!-- ENDIF -->
					</span>
                  </div>
                </div>
              </div>
            </div>

            <hr class="m-y-1 visible-xs visible-sm">
            <div class="page-forum-thread-counters box-cell col-md-4 text-xs-center">
              <div class="box-container">
                <div class="box-row">
                  <div class="box-cell input-group-btn text-right" style="vertical-align: middle;">
                    <!-- IF postrow.IS_FIRST_POST and CAN_ADD_POLL --><a href="#" onclick="return build_poll_add_form(this);" class="btn btn-outline btn-outline-colorless b-a-0 font-size-14">{POLL_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
					<!-- IF postrow.QUOTE --><a class="btn btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="ajax.exec({ action: 'posts', post_id: {postrow.POST_ID}, type: 'reply'}); return false;<!-- ELSE -->{QUOTE_URL}{postrow.POST_ID}<!-- ENDIF -->">{QUOTE_IMG}</a><!-- ENDIF -->
					<!-- IF postrow.EDIT --><a class="btn btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="edit_post({postrow.POST_ID}, 'edit'); return false;<!-- ELSE -->{EDIT_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{EDIT_POST_IMG}</a><!-- ENDIF -->
					<!-- IF postrow.DELETE --><a class="btn btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="ajax.exec({ action: 'posts', post_id: {postrow.POST_ID}, topic_id : {TOPIC_ID}, type: 'delete'}); return false;<!-- ELSE -->{DELETE_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{DELETE_POST_IMG}</a><!-- ENDIF -->
					<!-- IF postrow.IP --><a class="btn btn-outline btn-outline-colorless b-a-0 font-size-14" href="{IP_POST_URL}{postrow.POST_ID}&amp;t={TOPIC_ID}">{IP_POST_IMG}</a><!-- ENDIF -->

					<!-- IF AUTH_MOD -->
						<a class="menu-root menu-alt1 btn btn-outline btn-outline-colorless b-a-0 font-size-14" href data-toggle="modal" data-target="#mc_{postrow.POST_ID}">{MC_IMG}</a>
						<!-- IF not IN_MODERATION --><a class="btn btn-outline btn-outline-colorless b-a-0 font-size-14" href="{PAGE_URL}&amp;mod=1&amp;start={PAGE_START}#{postrow.POST_ID}">{MOD_POST_IMG}</a><!-- ENDIF -->
					<!-- ENDIF / AUTH_MOD -->

					<!-- IF LOGGED_IN -->
						<div class="dropdown pull-right">
							<a class="btn dropdown-toggle" data-toggle="dropdown">
							  <i class="fa fa-reorder"></i>
							</a>
							<div class="dropdown-menu">
								<!-- IF AUTH_MOD -->
									<!-- IF IN_MODERATION -->
									<li><a href>{L_MODERATE_TOPIC}</a></li>
									<!-- ELSE -->
									<li><a href="{PAGE_URL}&amp;mod=1&amp;start={PAGE_START}">{L_MODERATE_TOPIC}</a></li>
									<!-- ENDIF -->
									<li><a href="{PIN_HREF}">{PIN_TITLE}</a></li>
								<!-- IF SELECT_PPP -->
									<li class="divider"></li>
									<li class="dropdown-header">{L_SELECT_POSTS_PER_PAGE}</li>
									<form id="ppp" action="{PAGE_URL_PPP}" method="post">{SELECT_PPP}</form>
									<li class="divider"></li>
								<!-- ENDIF / SELECT_PPP -->
								<!-- ENDIF / AUTH_MOD -->

								<!-- IF LOGGED_IN -->
								<li><a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></li>
								<li><a href="#topic-options" data-toggle="modal">{L_DISPLAYING_OPTIONS}</a></li>
								<!-- ENDIF / LOGGED_IN -->
							</div>
						</div>
					<!-- ENDIF / LOGGED_IN -->

					<!-- IF postrow.MOD_CHECKBOX -->
					<label class="custom-control custom-checkbox custom-control-blank">
						<input type="checkbox" onclick="set_hid_chbox('{postrow.POST_ID}');" class="topic-chbox custom-control-input">
						<span class="custom-control-indicator"></span>
					</label>
					<!-- ENDIF -->
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
    </div>
	<hr>
	<h6 class="m-y-0 m-x-1 font-weight-semibold text-muted" style="opacity: 0.5;">{TOPIC_TITLE}</h6><hr>
	<div class="panel-body p-a-1 font-size-14">
		<div class="post_body">
			<div class="post_wrap">
				<span id="pe_{postrow.POST_ID}"></span>
				<span id="pp_{postrow.POST_ID}">{postrow.MESSAGE}</span>
				<!-- IF postrow.RG_NAME -->
				<div id="pg_{postrow.POST_ID}" class="alert alert-gray" style="width: 92%;">
					<h4 class="alert-heading">{L_RELEASE_FROM_RG} — <a href="{postrow.RG_URL}">{postrow.RG_NAME}</a></h4>
					<div id="pg_info_{postrow.POST_ID}">
						<!-- IF postrow.RG_AVATAR --><hr /><a href="{postrow.RG_URL}">{postrow.RG_AVATAR}</a><!-- ENDIF -->
                        <!-- IF postrow.RG_DESC --><div class="post-wrap">{L_DESCRIPTION}: {postrow.RG_DESC}</div><!-- ENDIF -->
                        <!-- IF postrow.RG_SIG and postrow.RG_SIG_ATTACH --><hr /><div id="rg_sig">{L_SIGNATURE}: {postrow.RG_SIG}</div><!-- ENDIF -->
                        <hr /><a href="{postrow.RG_FIND_URL}">{L_MORE_RELEASES}</a>
					</div>
				</div>
				<!-- ENDIF -->
				<div id="pc_{postrow.POST_ID}" <!-- IF not postrow.MC_COMMENT -->style="display: none;"<!-- ENDIF -->>
					<div id="mc_class_{postrow.POST_ID}" class="alert alert-{postrow.MC_CLASS}" style="width: 92%;">
						<h4 class="alert-heading">{postrow.MC_TITLE}</h4><hr />
						<div id="mc_comment_{postrow.POST_ID}">{postrow.MC_COMMENT}</div>
					</div>
				</div>
			</div><!--/post_wrap-->
			<!-- IF postrow.SIGNATURE -->{postrow.SIGNATURE}<!-- ENDIF -->
			<!-- IF postrow.EDITED_MESSAGE --><div class="last_edited">{postrow.EDITED_MESSAGE}</div><!-- ENDIF -->
		</div>
    </div>
    {postrow.ATTACHMENTS}
</div>
<hr class="page-wide-block">

<!-- ELSE -->

<div class="box bg-transparent" id="post_{postrow.POST_ID}">
    <div class="box-row">
        <!-- IF postrow.POSTER_AVATAR -->
		<div class="box-cell avatar-top p-y-1" style="width: 40px;">
			<a href="#pr-{postrow.POSTER_ID}" data-toggle="modal">{postrow.POSTER_AVATAR}</a>
        </div>
		<!-- ENDIF -->
        <div class="box-cell p-l-2"><a name="{postrow.POST_ID}"></a><!-- IF postrow.IS_NEWEST --><a name="newest"></a><!-- ENDIF -->
			<div class="panel m-a-0">
				<div class="panel-body p-a-1">
					<div class="row">
					<div class="col-md-6">
					<!-- IF QUICK_REPLY -->
					<span title="{L_INS_NAME_TIP}" onclick="bbcode.onclickPoster('{postrow.POSTER_NAME_JS}', {postrow.POST_ID});">
						<a href="#" onclick="return false;">{postrow.POSTER_NAME}</a> <!-- IF postrow.POSTER_AUTHOR --><sup>&reg;</sup><!-- ENDIF -->
					</span>
					<!-- ELSE -->
					<span class="nick">{postrow.POSTER_NAME} <!-- IF postrow.POSTER_AUTHOR --><sup>&reg;</sup><!-- ENDIF --></span>
					<!-- ENDIF -->
					<div class="text-muted font-size-12">
						<a href="{POST_URL}{postrow.POST_ID}#{postrow.POST_ID}" title="{L_POST_LINK}">{postrow.POST_DATE}</a>
						<!-- IF postrow.POSTED_AFTER -->
						({L_POSTED_AFTER} {postrow.POSTED_AFTER})
						<!-- ENDIF -->
					</div>
					</div>
					<hr class="m-y-1 visible-xs visible-sm">
					<div class="page-forum-thread-actions text-right p-t-1 col-md-6">
						<!-- IF postrow.QUOTE --><a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="ajax.exec({ action: 'posts', post_id: {postrow.POST_ID}, type: 'reply'}); return false;<!-- ELSE -->{QUOTE_URL}{postrow.POST_ID}<!-- ENDIF -->">{QUOTE_IMG}</a><!-- ENDIF -->
						<!-- IF postrow.EDIT --><a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="edit_post({postrow.POST_ID}, 'edit'); return false;<!-- ELSE -->{EDIT_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{EDIT_POST_IMG}</a><!-- ENDIF -->
						<!-- IF postrow.DELETE --><a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="ajax.exec({ action: 'posts', post_id: {postrow.POST_ID}, topic_id : {TOPIC_ID}, type: 'delete'}); return false;<!-- ELSE -->{DELETE_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{DELETE_POST_IMG}</a><!-- ENDIF -->
						<!-- IF postrow.IP --><a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href="{IP_POST_URL}{postrow.POST_ID}&amp;t={TOPIC_ID}">{IP_POST_IMG}</a><!-- ENDIF -->
						<!-- IF AUTH_MOD -->
							<a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href data-toggle="modal" data-target="#mc_{postrow.POST_ID}">{MC_IMG}</a>
							<!-- IF not IN_MODERATION --><a class="btn btn-sm btn-outline btn-outline-colorless b-a-0 font-size-14" href="{PAGE_URL}&amp;mod=1&amp;start={PAGE_START}#{postrow.POST_ID}">{MOD_POST_IMG}</a><!-- ENDIF -->
						<!-- ENDIF -->
						<!-- IF postrow.MOD_CHECKBOX -->
						<label class="custom-control custom-checkbox custom-control-blank pull-right">
							<input type="checkbox" onclick="set_hid_chbox('{postrow.POST_ID}');" class="topic-chbox custom-control-input">
							<span class="custom-control-indicator"></span>
						</label>
						<!-- ENDIF -->
					</div>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="panel-body">
					<div class="post_body">
						<div class="post_wrap">
							<span id="pe_{postrow.POST_ID}"></span>
							<span id="pp_{postrow.POST_ID}">{postrow.MESSAGE}</span>
							<div id="pc_{postrow.POST_ID}" <!-- IF not postrow.MC_COMMENT -->style="display: none;"<!-- ENDIF -->>
								<div id="mc_class_{postrow.POST_ID}" class="alert alert-{postrow.MC_CLASS}" style="width: 92%;">
									<h4 class="alert-heading">{postrow.MC_TITLE}</h4><hr />
									<div id="mc_comment_{postrow.POST_ID}">{postrow.MC_COMMENT}</div>
								</div>
							</div>
						</div><!--/post_wrap-->
						<!-- IF postrow.SIGNATURE -->{postrow.SIGNATURE}<!-- ENDIF -->
						<!-- IF postrow.EDITED_MESSAGE --><div class="last_edited">{postrow.EDITED_MESSAGE}</div><!-- ENDIF -->
					</div>
				</div>
			</div>
        </div>
    </div>
</div>
<!-- ENDIF / IS_FIRST_POST -->
<!-- END postrow -->

<!-- IF SPLIT_FORM -->
<table>
<tr id="del_split_row" class="row5" style="display: none;">
	<td colspan="2" class="med pad_4 td2">
	<form method="post" action="{S_SPLIT_ACTION}">
	<input type="hidden" name="redirect" value="modcp.php?t={TOPIC_ID}&amp;mode=split" />
	<input type="hidden" name="{POST_FORUM_URL}" value="{FORUM_ID}" />
	<input type="hidden" name="{POST_TOPIC_URL}" value="{TOPIC_ID}" />
	<input type="hidden" name="start" value="{START}" />
	<input type="hidden" name="mode" value="split" />

		<!-- BEGIN postrow -->
		<input type="hidden" name="post_id_list[]" id="cb_{postrow.POST_ID}" />
		<!-- END postrow -->

		<table class="bordered bCenter">
		<tr>
			<td class="row1">{L_NEW_TOPIC_TITLE}</td>
			<td class="row2"><input class="post" type="text" size="35" style="width: 500px" maxlength="120" name="subject" /></td>
		</tr>
		<tr>
			<td class="row1">{L_FORUM_FOR_NEW_TOPIC}</td>
			<td class="row2">{S_FORUM_SELECT}</td>
		</tr>
		<tr>
			<td colspan="2" class="row2 tCenter">
				<label><input type="checkbox" name="after_split_to_old" checked="checked" /> {L_BOT_AFTER_SPLIT_TO_OLD}</label>
				&nbsp;
				<label><input type="checkbox" name="after_split_to_new" checked="checked" /> {L_BOT_AFTER_SPLIT_TO_NEW}</label>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" class="row3">
				<input type="submit" name="delete_posts" id="del" value="{L_DELETE_POSTS}" disabled="disabled" onclick="return window.confirm('{L_DELETE_POSTS}?');" />
				<input type="submit" name="split_type_all" id="spl_all" value="{L_SPLIT_POSTS}" disabled="disabled" onclick="return window.confirm('{L_SPLIT_POSTS}?');" />
				<input type="submit" name="split_type_beyond" id="spl_b" value="{L_SPLIT_AFTER}" disabled="disabled" onclick="return window.confirm('{L_SPLIT_AFTER}?');" />
				<label for="spl_cnf">
					{L_CONFIRM}
					<input id="spl_cnf" type="checkbox" name="confirm" value="1" onclick="
						toggle_disabled('del', this.checked);
						toggle_disabled('spl_all', this.checked);
						toggle_disabled('spl_b', this.checked);
					" />
				</label>
			</td>
		</tr>
		</table>
	</form>
	</td>
</tr>
</table>
<!-- ENDIF / SPLIT_FORM -->


<!-- IF HIDE_POST_IMG --><script type="text/javascript">$('img.postImg').remove();</script><!-- ENDIF -->
<!-- IF HIDE_SMILE --><script type="text/javascript">$('img.smile').remove();</script><!-- ENDIF -->

<!-- IF PAGINATION -->
<nav>
    <ul class="pagination pagination-sm m-y-0">
        {PAGINATION}
    </ul>
	<span class="pull-right">{PAGE_NUMBER}</span>
</nav>
<!-- ENDIF -->

<!-- IF QUICK_REPLY -->
<form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
<input type="hidden" name="mode" value="reply" />
<input type="hidden" name="t" value="{QR_TOPIC_ID}" />

<div class="panel">
	<div class="panel-heading">
        <div class="panel-title">{L_QUICK_REPLY}</div>
    </div>
    <div class="panel-body p-a-1">
		<div id="view_message" style="display:none;">
			<div class="tLeft view-message"></div>
		</div>
		<div>
			<!-- IF not LOGGED_IN -->
			<p class="mrg_6"><b>{L_QR_USERNAME}: </b><input type="text" name="username" size="20" maxlength="25" /></p>
			<!-- ENDIF -->

			<!-- INCLUDE posting_editor.tpl -->
		</div>

        <!-- IF S_WATCH_TOPIC -->
		<label class="custom-control custom-checkbox">
			<input type="checkbox" name="notify" <!-- IF QR_NOTIFY_CHECKED -->checked="checked"<!-- ENDIF --> <!-- IF not LOGGED_IN -->disabled="disabled"<!-- ENDIF --> class="topic-chbox custom-control-input">
			<span class="custom-control-indicator"></span>
			{L_QR_NOTIFY}
		</label>
        <!-- ENDIF -->
	</div>
</div>

</form>
<!-- ENDIF / QUICK_REPLY -->

<!--bottom_info-->
<div class="bottom_info">
	<div class="jumpbox" style="max-width: 350px;float: right;"></div>
</div><!--/bottom_info-->

<table width="100%">
<tr>
	<td width="40%" valign="top" nowrap="nowrap"><span class="small">{S_WATCH_TOPIC}</span><br />
	<div class="small">
<!-- IF S_TOPIC_ADMIN -->
		<br clear="all" />
		<div style="float: left;">{S_TOPIC_ADMIN}</div>
<!-- ENDIF -->
<!-- IF IS_ADMIN -->
		<div class="med" style="float: right;">
        {L_ADMIN}:&nbsp;
		<a href="{U_LOGS}">{L_LOGS}</a>&nbsp;
		</div>
<!-- ENDIF -->
<!-- IF S_DL_DELETE -->
		<br clear="all" />
		<div style="float: left;">{S_DL_DELETE}</div>
<!-- ENDIF -->
		<br clear="all" />
		<div style="float: left;">{S_AUTH_LIST}</div>
	</div>
	</td>
</tr>
</table>

</div>
