<!-- IF TPL_SEARCH_MAIN -->
<!--========================================================================-->

<a name="start"></a>

<div class="col-md-12">
<form action="{SEARCH_ACTION}" method="POST" name="post">
{S_HIDDEN_FIELDS}

<div class="box box-primary">
	<div class="box-header with-border"><h3 class="box-title">{L_SEARCH_OPTIONS}</h3></div>
	<div class="box-body no-padding">

	<div class="col-md-6">
		<fieldset>
		<div class="form-group">
			<label>{L_SEARCH_WORDS}<!-- IF $bb_cfg['search_help_url'] --> <a href="{$bb_cfg['search_help_url']}">[?]</a><!-- ENDIF --></label>
			<input id="text_match_input" type="text" class="form-control" name="{TEXT_MATCH_KEY}" placeholder="{L_SEARCH_WORDS}..." />
			<div class="checkbox">
				{TITLE_ONLY_CHBOX}&nbsp;{ALL_WORDS_CHBOX}
			</div>
		</div>
		</fieldset>
	</div>
	<div class="col-md-6">
		<fieldset>
		<div class="form-group">
			<label>{L_SEARCH_AUTHOR}</label>
			<div class="input-group">
				<input id="author" type="text" class="form-control" name="{POSTER_NAME_KEY}" placeholder="{L_SEARCH_AUTHOR}..." />
					<span class="input-group-btn">
						<button class="btn btn-success btn-flat" type="button" onclick="window.open('{U_SEARCH_USER}', '_bbsearch', IWP_US); return false;" /><i class="fa fa-search"></i></button>
					</span>
			</div>
		</div>
		<div class="checkbox">
			<label>
			<input type="checkbox"
				onclick="
					toggle_disabled('author', !this.checked);
					toggle_disabled('{MY_TOPICS_ID}', this.checked);
					if (this.checked) { $p('author').value = '{THIS_USER_NAME}'; }
					else { $p('author').value = ''; $p('{MY_TOPICS_ID}').checked = 0; };
				"
				name="{POSTER_ID_KEY}" value="{THIS_USER_ID}" />
			{L_IN_MY_POSTS}
			</label>
			{MY_TOPICS_CHBOX}
		</div>
		</fieldset>
	</div>

	<div class="col-md-12">
		<p>{L_SEARCH_WORDS_EXPL}</p>
	</div>
	<div class="col-md-6">
		<fieldset>
		<label>{L_FORUM}:</label>
		<div>
			<p class="select">{FORUM_SELECT}</p>
		</div>
		</fieldset>
	</div>
	<div class="col-md-6">
		<fieldset>
		<label>{L_MY_DOWNLOADS}</label>
		<div class="form-group">
			<label>
			<div class="checkbox">
				{DL_COMPL_CHBOX}
				{DL_WILL_CHBOX}
				{DL_DOWN_CHBOX}
				{DL_CANCEL_CHBOX}
			</div>
			</label>
		</div>
		</fieldset>
		<fieldset>
		<label>{L_SEARCH_PREVIOUS}:</label>
		<div class="form-group">
			{TIME_SELECT}
			<div class="checkbox">
				{ONLY_NEW_CHBOX}
				{NEW_TOPICS_CHBOX}
			</div>
		</div>
		</fieldset>
		<fieldset>
		<label>{L_DISPLAY_RESULTS_AS}:</label>
		<div class="form-group">
			{DISPLAY_AS_SELECT}
			{CHARS_SELECT}
		</div>
		</fieldset>
		<fieldset>
		<label>{L_SORT_BY}:</label>
		<div class="form-group">
			{ORDER_SELECT}
		</div>
		<div class="form-group">
			{SORT_SELECT}
		</div>
		</fieldset>
	</div>
	<div class="box-footer text-center">
		<input class="btn btn-success" type="submit" name="submit" value="{L_SEARCH}" />
	</div>
</div>

</form>
</div>

<!--========================================================================-->
<!-- ENDIF / TPL_SEARCH_MAIN -->

<!-- IF TPL_SEARCH_USERNAME -->
<!--========================================================================-->

<script type="text/javascript">
function refresh_username(selected_username)
{
	opener.document.forms['post'].{INPUT_NAME}.value = selected_username;
	opener.focus();
	window.close();
}
</script>

<div class="box box-primary">
	<div class="box-header with-border"><h3 class="box-title">{L_FIND_USERNAME}</h3></div>
	<form method="post" name="search" action="{SEARCH_ACTION}">
		<div class="box-body">
			<div class="input-group">
				<input type="text" name="search_username" value="{USERNAME}" class="form-control" placeholder="{L_USERNAME}..." />
					<span class="input-group-btn">
						<button type="submit" class="btn btn-success btn-flat" onclick="refresh_username(this.form.username_list.options[this.form.username_list.selectedIndex].value);return false;" name="use" />{L_SELECT}</button>
					</span>
			</div>
			<label>{L_SEARCH_AUTHOR_EXPL}</label>

			<!-- IF USERNAME_OPTIONS -->
			<div class="input-group">
				<select name="username_list" class="form-control">{USERNAME_OPTIONS}</select>
					<span class="input-group-btn">
						<button type="submit" class="btn btn-success btn-flat" onclick="refresh_username(this.form.username_list.options[this.form.username_list.selectedIndex].value);return false;" name="use" />{L_SELECT}</button>
					</span>
			</div>
			<!-- ENDIF -->
		</div>

		<div class="box-footer text-center">
			<a href="javascript:window.close();" class="btn btn-sm">{L_CLOSE_WINDOW}</a>
		</div>
	</form>
</div>
<!--========================================================================-->
<!-- ENDIF / TPL_SEARCH_USERNAME -->