<div id="forum">
{include file="forum/forum_bar.tpl"}
{if $smarty.get.search}<div class="forum_search">Вы искали: <span class="forum_hl">{$smarty.get.search|escape}</span></div>{/if}
{if $no_result}
<div>К сожалению, ничего не найдено!</div>
{else}
<table class="themes" cellpadding="0" cellspacing="0">
<colgroup>
	<col id="col_status" />
	<col id="col_theme" />
	<col id="col_author" />
	<col id="col_total_posts" />
	<col id="col_last_post" />
	{if $access_moderator}<col width="20" />{/if}
</colgroup>
<thead>
	<tr><td>&nbsp;</td><td class="align_left">Тема</td><td>Автор</td><td>Сбщ.</td><td>Последний ответ</td>{if !$forum_id}<td>Форум</td>{/if}{if $access_moderator}<td></td>{/if}</tr>
</thead>
<tbody>
{foreach $themes as $theme}
<tr class="{if $theme.new && $smarty.session.forum.themes[$theme.theme_id]<$theme.last_post} new{/if}{if $theme.hidden} hidden{/if}">
<td>
	{if $theme.pinup}
		{if $access_moderator}<a title="Открепить" href="{url action="toggle" var1=$theme.theme_id token=1}"><img class="icon" src="/skins/default/images/icons/simple_pin.png" alt="Открепить" /></a>
		{else}<img class="icon" src="/skins/default/images/icons/simple_pin.png" alt="Прикреплена" />{/if}
	{else}
		{if $access_moderator}<a title="Прикрепить" href="{url action="toggle" var1=$theme.theme_id token=1}"><img class="icon" src="/skins/default/images/icons/simple_doc.png" alt="Прикрепить" /></a>
		{else}<img class="icon" src="/skins/default/images/icons/simple_doc.png" alt="Не прикреплена" />{/if}
	{/if}
</td>
<td class="align_left"><a href="{url action='theme' var1=$theme.theme_id var2=1 var3=$smarty.get.search}">{$theme.subject_html}</a>
{if $theme.total_pages>1}
{for $page=1 to $theme.total_pages}
 | <a href="{url action='theme' var1=$theme.theme_id var2=$page var3=$smarty.get.search}">{$page}</a>
{/for}
{/if}
{if $theme.hidden}<b>[удалена {$theme.hidden|escape}]</b>{/if}
</td>
<td class="center"><span{if $theme.author_id} class="registred"{/if}>{$theme.author|escape}</span></td>
<td class="center">{$theme.total_posts}</td>
<td class="center">
	<a href="{url action='theme' var1=$theme.theme_id var2=999 var3=$smarty.get.search}#last">
		{$theme.last_post|date_format:"%H:%M %d.%m.%Y"}
		<br />
		<span{if $theme.last_user_id} class="registred"{/if}>{$theme.last_user|escape}</span>
	</a>
</td>
{if $theme.forum_id}<td class="center"><a href="{url var1=$theme.forum_id}">{$theme.forum_name}</a></td>{/if}
{if access('admin, moderetor')}<td class="center">
	{if $theme.hidden}
		<a href="{url action='unhide_theme' var1=$theme.theme_id token=1}" title='восстановить тему'><img class="icon" src="/skins/default/images/icons/simple_component.png" alt="восстановить тему" /></a>
		<a href="{url action='delete_theme_hidden' var1=$theme.theme_id token=1}" title='удалить тему'  onclick="return confirm('Уверен?');"><img class="icon" src="/skins/default/images/icons/simple_delete.png" alt="удалить тему" /></a>
	{else}
		<a href="{url action='hide_theme' var1=$theme.theme_id token=1}" title='скрыть тему'  onclick="return confirm('Уверен?');"><img class="icon" src="/skins/default/images/icons/simple_noaccess.png" alt="скрыть тему" /></a>
		{if access('admin')}<a href="{url action='delete_theme' var1=$theme.theme_id token=1}" title='удалить тему'  onclick="return confirm('Уверен?');"><img class="icon" src="/skins/default/images/icons/simple_delete.png" alt="удалить тему" /></a>{/if}
	{/if}
	
</td>{/if}
</tr>
{foreachelse}
<tr><td colspan="{if access('admin, moderetor')}6{else}5{/if}">Пока нет ни одной темы</td></tr>
{/foreach}
</tbody>
</table>
{/if}

{if $pager.pages}
<div class="navigate">
	{foreach $pager.pages as $page}
		{if !$page} ... {elseif $page==$pager.current}
			<b>{$page}</b>	
		{else}
			<a href="{url action=$smarty.get.action var1=$forum_id var2=$page var3=$smarty.get.search}">{$page}</a>
		{/if}
		{if !$page@last}|{/if}
	{/foreach}
</div>
{/if}
</div>