<div class="col-md-12">

<div class="pull-right">
	<!-- IF MY_POSTS -->
	<span id="show-edit-btn"><a href="#">{L_EDIT_MY_MESSAGE_LIST}</a></span>
	<span id="edit-sel-topics" style="display: none;"><a href="#" class="bold adm" onclick="$('input.topic-chbox').trigger('click'); return false;">{L_SELECT_INVERT}</a></span>
	<!-- ENDIF -->
	<!-- IF LOGGED_IN --><a href="#" class="med normal" onclick="setCookie('{COOKIE_MARK}', 'all_forums'); post2url ('{SITE_URL}'); return false;">{L_MARK_ALL_FORUMS_READ}</a><!-- ENDIF -->
</div>

<!-- IF DISPLAY_AS_POSTS -->
<ul class="timeline">
<!-- BEGIN t -->
<li class="time-label">
	<span class="bg-with">
		<a href="{FORUM_URL}{t.FORUM_ID}"><i>{t.FORUM_NAME}</i></a> > <a href="{TOPIC_URL}{t.TOPIC_ID}">{t.TOPIC_TITLE}</a>
	</span>
</li>
<!-- BEGIN p -->
<li>
	<i class="{t.TOPIC_ICON} bg-blue"></i>

	<div class="timeline-item">
		<span class="time"><i class="fa fa-clock-o"></i> <a href="{POST_URL}{t.p.POST_ID}#{t.p.POST_ID}" class="text-muted" title="{L_POST_LINK}">{t.p.POST_DATE}</a>
			<span class="dropdown messages-menu">
				<a data-toggle="dropdown" class="dropdown-toggle" href="#" aria-expanded="false"><i class="fa fa-fw fa-navicon"></i></a>
				<ul class="dropdown-menu dropdown-menu-right">
					<!-- IF t.p.QUOTE --><li><a href="{QUOTE_URL}{t.p.POST_ID}">{QUOTE_IMG} {L_REPLY_WITH_QUOTE_TXTB}</a></li><!-- ENDIF -->
					<!-- IF t.p.EDIT --><li><a href="{EDIT_POST_URL}{t.p.POST_ID}">{EDIT_POST_IMG} {L_EDIT_DELETE_POST_TXTB}</a></li><!-- ENDIF -->
					<!-- IF t.p.DELETE --><li><a href="{DELETE_POST_URL}{t.p.POST_ID}">{DELETE_POST_IMG} {L_DELETE_POST_TXTB}</a></li><!-- ENDIF -->
					<!-- IF t.p.IP --><li><a href="{IP_POST_URL}{t.p.POST_ID}&amp;t={t.TOPIC_ID}">{IP_POST_IMG} {L_VIEW_IP_TXTB}</a></li><!-- ENDIF -->
				</ul>
			</span>
		</span>

		<h3 class="timeline-header">{t.p.POSTER}</h3>
		<div class="timeline-body">
		<div class="post_wrap">
			<div class="post_body">{t.p.MESSAGE}</div>
		</div>
		</div>
		</div>
</li>
<!-- END p -->
<!-- END t -->
</ul>

<!-- ELSE / start of !DISPLAY_AS_POSTS -->

<!-- IF DL_CONTROLS -->
<form method="POST" action="{DL_ACTION}">
<!-- ELSEIF MY_POSTS -->
<script type="text/javascript">
ajax.in_edit_mode = false;

$(document).ready(function(){
	$('#show-edit-btn a').click(function(){
		show_edit_options();
		$('#show-edit-btn').html( $('#edit-sel-topics').html() );
		return false;
	});

	$('td.topic_id').click(function(){
		if (!ajax.in_edit_mode) {
			$('#show-edit-btn a').click();
			$(this).find('input').click();
		}
	});
});

function show_edit_options ()
{
	$('td.topic_id').each(function(){
		var topic_id = $(this).attr('id');
		var input = '<input id="sel-'+ topic_id +'" type="checkbox" value="'+ topic_id +'" class="topic-chbox" />';
		$(this).html(input);
	});

	$('input.topic-chbox').click(function(){
		if ($.browser.mozilla) {
			$('#tr-'+this.value+' td').toggleClass('hl-selected-row');
		}	else {
			$('#tr-'+this.value).toggleClass('hl-selected-row');
		}
	});
	$('#pagination a.pg').each(function(){ this.href += '&mod=1'; });
	$('#ed-list-desc').hide();
	$('#mod-action-cell').append( $('#mod-action-content')[0] );
	$('#mod-action-row, #mod-action-content').show();

	$('#mod-action').submit(function(){
		var $form = $(this);
		$('input[name~=topic_id_list]', $form).remove();
		$('input.topic-chbox:checked').each(function(){
			$form.append('<input type="hidden" name="topic_id_list[]" value="'+ this.value +'" />');
			$('#tr-'+this.value).remove();
		});
	});
	ajax.in_edit_mode = true;
}
</script>

<div id="mod-action-content" style="display: none;">
<form id="mod-action" method="POST" action="{U_SEARCH}" target="_blank">
	<table class="borderless pad_0" cellpadding="0" cellspacing="0">
	    <tr>
		    <td class="pad_4">
		        <input type="submit" name="del_my_post" value="{L_DEL_LIST_MY_MESSAGE}" class="bold" onclick="if (!window.confirm( this.value +'?' )){ return false };" />
	        </td>
			<td class="med" style="padding: 0 8px;">{L_DEL_LIST_MY_MESSAGE_INFO}</td>
		</tr>
	</table>
</form>
</div>
<!-- ENDIF -->
<div class="box box-primary">
<div class="box-body">
<table class="table table-hover">
<col class="row1">
<col class="row1" width="25%">
<col class="row4" width="75%">
<col class="row1">
<col class="row4">
<col class="row1">
<tr>
	<th>&nbsp;</th>
	<th>{L_FORUM}</th>
	<th>{L_TOPICS}</th>
	<th>{L_AUTHOR}</th>
	<th>{L_REPLIES_SHORT}</th>
	<th>{L_LASTPOST}</th>
</tr>
<!-- BEGIN t -->
<tr id="tr-{t.TOPIC_ID}" class="tCenter">
	<td id="{t.TOPIC_ID}" class="topic_id">
		<!-- IF DL_CONTROLS -->
			<input type="checkbox" name="dl_topics_id_list[]" value="{t.TOPIC_ID}" />
		<!-- ELSE -->
			<i class="{t.TOPIC_ICON}"></i>
		<!-- ENDIF -->
	</td>
	<td><a href="{FORUM_URL}{t.FORUM_ID}" class="gen">{t.FORUM_NAME}</a></td>
		<td class="tLeft" style="padding: 2px 5px 3px 4px;">
		<div class="topictitle" onmousedown="$p('tid_{t.TOPIC_ID}').className='opened'">
			<!-- IF t.IS_UNREAD --><a href="{TOPIC_URL}{t.HREF_TOPIC_ID}{NEWEST_URL}">{ICON_NEWEST_REPLY}</a><!-- ENDIF -->
			<!-- IF t.STATUS == MOVED --><span class="topicMoved">{L_TOPIC_MOVED}</span>
				<!-- ELSEIF t.TYPE == ANNOUNCE --><span class="topicAnnounce">{L_TOPIC_ANNOUNCEMENT}</span>
				<!-- ELSEIF t.DL_CLASS --><span class="{t.DL_CLASS} iconDL">{L_TOPIC_DL}</span>
				<!-- ELSEIF t.ATTACH and not t.DL -->{TOPIC_ATTACH_ICON}
			<!-- ENDIF -->
			<!-- IF t.POLL --><span class="topicPoll">{L_TOPIC_POLL}</span><!-- ENDIF -->
			<a href="{TOPIC_URL}{t.TOPIC_ID}" class="topictitle"><span id="tid_{t.TOPIC_ID}">{t.TOPIC_TITLE}</span></a>
		<!-- IF t.PAGINATION --><span class="topicPG">[{ICON_GOTOPOST}{L_GOTO_SHORT} {t.PAGINATION} ]</span><!-- ENDIF -->
		</div>
	</td>
	<td class="med nowrap">{t.TOPIC_AUTHOR}</td>
	<td class="small">{t.REPLIES}</td>
	<td class="small nowrap" style="padding: 1px 4px 3px 4px;">
		<p>{t.LAST_POST_TIME}</p>
		<p>
			{t.LAST_POSTER}
			<span onmousedown="$p('tid_{t.TOPIC_ID}').className='opened'"><a href="{POST_URL}{t.LAST_POST_ID}#{t.LAST_POST_ID}">{ICON_LATEST_REPLY}</a></span>
		</p>
	</td>
</tr>
<!-- END t -->
<!-- IF MY_POSTS -->
<tr id="mod-action-row">
	<td colspan="6" id="mod-action-cell" class="row2">
		<span id="ed-list-desc" class="small">{L_DEL_LIST_INFO}</span>
	</td>
</tr>
<!-- ENDIF -->
</table>
</div>
<div class="box-footer">
	<!-- IF DL_CONTROLS -->
	<input type="submit" name="dl_set_will" value="{L_DLWILL}" class="btn btn-default btn-flat" />
	<input type="submit" name="dl_set_down" value="{L_DLDOWN}" class="btn btn-default btn-flat" />
	<input type="submit" name="dl_set_complete" value="{L_DLCOMPLETE}" class="btn btn-default btn-flat" />
	<input type="submit" name="dl_set_cancel" value="{L_DLCANCEL}" class="btn btn-default btn-flat" />
	<input type="hidden" name="redirect_type" value="search" />
	<input type="hidden" name="mode" value="set_topics_dl_status" />
	<!-- ELSE -->
	&nbsp;
	<!-- ENDIF -->
</div>
</div>
<!-- IF DL_CONTROLS -->
</form>
<!-- ENDIF -->

<!-- ENDIF -->

<!-- IF PAGINATION -->
<div class="col-md-12" id="pagination">
	<div class="pull-right">
	<ul class="pagination" style="margin: 0">
		{PAGINATION}
	</ul>
	</div>
	<div class="pull-left">
	<strong>{PAGE_NUMBER}</strong>
	</div>
</div>
<!-- ENDIF -->

</div><!--/col-md-12-->