{strip}

{include file='forums/tree.tpl'}
{*
<p class="forum_navi">
  {$navigation}
</p>
*}

{if $ugroup != 2}
<p align="center">
<a href="index.php?p=forum&amp;action=print&amp;what=subscription&amp;area={$area|default:'1'}">{$lang.show_all_abos}</a>
&nbsp;|&nbsp;
<a href="index.php?p=forum&amp;action=print&amp;what=subscription&amp;id={$forum->id}&amp;area={$area|default:'1'}">{$lang.show_all_abos_thisforum}</a>
	{if count($topics)}
&nbsp;|&nbsp;
<a href="index.php?p=forum&amp;action=markread&amp;what=forum&amp;id={$forum->id}&amp;area={$area|default:'1'}">{$lang.mark_topics_asread}</a>
	{/if}
</p>
{/if}
{* wenn kategorien vorhanden sind *}
{if count($categories)}
{* die liste der kategorien durchgehen *}
{foreach from=$categories item=categorie}
<div class="forum_frame " id="cat_{$categorie.id}">
  <table border="0" cellpadding="0" cellspacing="1" class="forum_tableborder" style="width: 100%">
    <tr>
      <td class="forum_header_bolder"><a class="forum_links_cat" href="{$categorie.link}&amp;area={$area|default:'1'}">
       {$categorie.title}
        </a> <br />
        {$categorie.comment}</td>
      <td class="forum_toggle"><div align="center"><img border="0" alt="{$lang.f_toggle_this}" id="img_{$categorie.id}" src="templates/{$theme}/img/page/{$categorie.image|default:'minus.gif'}" 
                onmouseover="this.style.cursor = 'pointer'" 
                onclick="
                    MWJ_changeDisplay('id{$categorie.id}', MWJ_getStyle( 'id{$categorie.id}', 'display' ) ? '' : 'none');
                    koobi4_toggleImage('img_{$categorie.id}', this.src);
                    koobi4_setCookie('categories', 'id{$categorie.id}');" /> </div></td>
    </tr>
  </table>
  <div id="id{$categorie.id}" style="display: {$categorie.display};">
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="forum_tableborder">
      {* wenn foren in kategorie vorhanden sind *}
      {if count($forums[$categorie.title]) gt 0}
      <tr>
        <th class="forum_header">&nbsp;</th>
        <th class="forum_header">{$lang.f_header_forum}</th>
        <th class="forum_header">{$lang.f_header_last_post}</th>
        <th class="forum_header">{$lang.f_header_theme}</th>
        <th class="forum_header">{$lang.f_header_posts}</th>
      </tr>
      {/if}
      {* alle foren zur kategorie ausgeben *}
      {foreach from=$forums[$categorie.title] item=i_forum}
      <tr>
        <td width="1%" class="forum_info_icon">{$i_forum.statusicon}</td>
        <td class="forum_info_main"><a class="forum_links" href="{$i_forum.link}&amp;area={$area|default:'1'}">
          {$i_forum.title}
          </a>
          <div class="f_info_comment">
            {$i_forum.comment|strip_tags}
          </div>
          {* unterforen anzeigen *}
          {if count($i_forum.subforums)}
          <div>
            {$lang.f_lbl_subforums}
            :&nbsp;
            {foreach from=$i_forum.subforums item=subforum}
            <a class="forum_links_small" href="index.php?p=showforum&amp;fid={$subforum->id}&amp;area={$area|default:'1'}">
            {$subforum->title|strip_tags}
            </a>&nbsp;
            {/foreach}
          </div>
          {/if}
        </td>
        <td class="forum_info_meta" width="15%">
		<div align="right">
		{if $i_forum.lastpost->topic_id != ""}
          {$i_forum.lastpost->datum|date_format:"%Y.%m.%d %H:%M"}
          <br />
		 {if $i_forum.lastpost->regdate < 2}
		 {$lang.gguest}
		 {else}
          <a class="forum_info_meta" href="index.php?p=user&amp;id={$i_forum.lastpost->uid}&amp;area={$area|default:'1'}">
          {$i_forum.lastpost->uname}
          </a>
		  {/if}
		  <a href="index.php?p=showtopic&amp;toid={$i_forum.lastpost->topic_id}&amp;pp=15&amp;page={$i_forum.lastpost->page}#pid_{$i_forum.lastpost->id}&amp;area={$area|default:'1'}"> <img class="absmiddle" src="templates/{$theme}/img/forum/post_latest.gif" border="0" alt="{$lang.f_latest_post}" title="latest post" /> </a>
          <br />
		  <a href="index.php?p=showtopic&amp;toid={$i_forum.lastpost->topic_id}&amp;area={$area|default:'1'}">{$i_forum.lastpost->title|truncate:25:" ...":true}</a>
		  {/if}
		</div>
        </td>
        <td class="forum_info_meta" width="10%">{if $i_forum.tcount == 0}
          -
          {else}
          {$i_forum.tcount}
          {/if}</td>
        <td class="forum_info_meta" width="10%">{if $i_forum.pcount == 0}
          -
          {else}
          {$i_forum.pcount}
          {/if}</td>
      </tr>
      {/foreach}
      {* admin funktionen *}
    </table>
  </div>
</div>
{/foreach}
{/if}
{* kann ein user neuen topic anlegen? *}
{if $forum->permissions.5}
<p style="padding: 2px">
<a class="forum_links" href="index.php?p=newtopic&amp;fid={$smarty.get.fid}&amp;area={$area|default:'1'}"> <img border="0" src="templates/{$theme}/img/forum/newtopic.gif" alt="{$lang.f_newthema}" /> </a> </p>
{/if}
{if count($topics)}
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="forum_tableborder">
  {assign var=announce_header value=true}
  {assign var=sticky_header value=true}
  {assign var=default_header value=true}
  {foreach from=$topics item=topic name=topic_loop}
  {if $topic.type == TOPIC_TYPE_ANNOUNCE && $announce_header}
  {assign var=announce_header value=false}
  <tr>
    <td class="forum_header_bolder" colspan="8"><strong>
      {$lang.f_header_announce}
      </strong> </td>
  </tr>
  <tr>
    <th colspan="2" class="forum_header ">&nbsp;</th>
    <th class="forum_header"><a href="{$sort_by_theme_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_theme}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_reply_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_postreply}
      </a></th>
    <th class="forum_header " width="15%"><a href="{$sort_by_author_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_author}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_hits_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_hits}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_rating_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_rank}
      </a></th>
    <th class="forum_header " width="20%"><a href="{$sort_by_lastpost_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_lastpost}
      </a></th>
  </tr>
  {elseif $topic.type == TOPIC_TYPE_STICKY && $sticky_header}
  {assign var=sticky_header value=false}
  <tr>
    <td class="forum_header_bolder" colspan="8"><strong>
      {$lang.f_header_sticky}
      </strong></td>
  </tr>
  <tr>
    <th colspan="2" class="forum_header "></th>
    <th class="forum_header "><a href="{$sort_by_theme_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_theme}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_reply_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_postreply}
      </a></th>
    <th class="forum_header " width="15%"><a href="{$sort_by_author_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_author}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_hits_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_hits}
      </a></th>
    <th class="forum_header " width="1%"><a href="{$sort_by_rating_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_rank}
      </a></th>
    <th class="forum_header " width="20%"><a href="{$sort_by_lastpost_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_lastpost}
      </a></th>
  </tr>
  {elseif $topic.type == TOPIC_TYPE_NONE && $default_header}
  {assign var=default_header value=false}
  <tr>
    <td class="forum_header_bolder" colspan="8"><strong>
      {$lang.f_header_default}
      </strong></td>
  </tr>
  <tr>
    <th colspan="2" class="forum_header "></th>
    <th class="forum_header "><a href="{$sort_by_theme_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_theme}
      </a></th>
    <th width="1%" nowrap="nowrap" class="forum_header "><a href="{$sort_by_reply_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_postreply}
      </a></th>
    <th class="forum_header" nowrap="nowrap"  width="15%"><a href="{$sort_by_author_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_author}
      </a></th>
    <th class="forum_header" nowrap="nowrap"  width="1%"><a href="{$sort_by_hits_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_hits}
      </a></th>
    <th class="forum_header" nowrap="nowrap"  width="1%"><a href="{$sort_by_rating_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_rank}
      </a></th>
    <th class="forum_header" nowrap="nowrap"  width="20%"><a href="{$sort_by_lastpost_link}&amp;area={$area|default:'1'}" class="forum_head">
      {$lang.f_header_lastpost}
      </a></th>
  </tr>
  {/if}
  <tr>
    <td width="10%" class="forum_info_icon">{if $topic.opened != 1}
      <img src="templates/{$theme}/img/statusicons/must_moderate.gif" alt="{$lang.f_munlock}" border="0" />
      {else}
      {$topic.statusicon}
      {/if}
    </td>
    <td width="10%" class="forum_info_icon">
	<div align="center">
     &nbsp; {get_post_icon icon=$topic.posticon theme=$theme}&nbsp;
    </div>
    </td>
    <td width="50%" class="forum_info_main">
		<a class="forum_links" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;fid={$forum->id}&amp;area={$area|default:'1'}">
      {$topic.title}
      </a>&nbsp;
      {section name=topic_navigation loop=$topic.navigation_page+1 start=1 max=5}
      {if $smarty.section.topic_navigation.first}
      ( <a class="forum_links_smaller" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;pp=15&amp;page={$smarty.section.topic_navigation.index}&amp;area={$area|default:'1'}">
      {$smarty.section.topic_navigation.index}
      </a>&nbsp;
      {elseif $smarty.section.topic_navigation.last}
      <a class="forum_links_smaller" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;pp=15&amp;page={$smarty.section.topic_navigation.index}&amp;area={$area|default:'1'}">
      {$smarty.section.topic_navigation.index}
      </a>
      {else}
      <a class="forum_links_smaller" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;pp=15&amp;page={$smarty.section.topic_navigation.index}&amp;area={$area|default:'1'}">
      {$smarty.section.topic_navigation.index}
&nbsp;</a>
      {/if}
      {/section}
      {if $topic.navigation_page > 5}
      ... <a class="forum_links_smaller" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;pp=15&amp;page={$topic.navigation_page}&amp;area={$area|default:'1'}">
      {$lang.forum_links_last_page}
      </a>&nbsp;)
      {elseif $topic.navigation_page > 0}
      &nbsp;)
      {/if}
    </td>
    <td class="forum_info_meta"><div align="center">{if ($topic.replies-1) == 0}
      -
      {else}
      <a href="#" class="forum_links" onclick="window.open('index.php?p=misc&amp;do=showposter&amp;tid={$topic.id}&amp;area={$area|default:'1'}', 'moo', 'toolbar=no,scrollbars=yes,resizable=yes,width=300,height=400')">
      {$topic.replies-1}
      </a>
      {/if}</div></td>
    <td class="forum_info_main"><div align="center">
	
	{if $topic.user_regdate < 2}
	{$lang.gguest}
	{else}
	<a class="forum_links" href="{$topic.autorlink}&amp;area={$area|default:'1'}">{$topic.autor}</a>
	{/if}
	</div></td>
    <td class="forum_info_meta"><div align="center">
      {$topic.views}
    </div></td>
    <td class="forum_info_meta"><div align="center">
      {if $topic.rating}
      <img src="templates/{$theme}/img/forum/{$topic.rating}.gif" alt="{$lang.f_prating}" />
      {/if}
</div></td>
    <td class="forum_info_main"><div align="right">
        {$topic.lastposter->datum|date_format:"%Y.%m.%d %H:%M"}
        <br />
		
        {$topic.lastposter->link}
        <a class="forum_links" href="index.php?p=showtopic&amp;toid={$topic.id}&amp;pp=15&amp;page={$topic.next_page}#pid_{$topic.lastposter->id}&amp;area={$area|default:'1'}"><img class="absmiddle" src="templates/{$theme}/img/forum/post_latest.gif" border="0" alt="{$lang.f_latest_post}"  /></a>
		
		</div></td>
  </tr>
  {/foreach}
  <tr>
    <td colspan="8" class="forum_post_footer"><table width="100%" cellpadding="5">
        <tr>
          <td><form action="index.php?p=showforum&amp;fid={$smarty.get.fid}&amp;area={$area|default:'1'}" method="post">
              <input type="hidden" name="unit" value="d" />
              <input type="hidden" name="fid" value="{$smarty.get.fid}" />
              <select name="period">
                <option value="1" {if $smarty.post.period == 1 || $smarty.get.period == 1}selected{/if}>
                {$lang.f_opt_last}
                {$lang.f_opt_day}
                </option>
                <option value="2" {if $smarty.post.period == 2 || $smarty.get.period == 2}selected{/if}>
                {$lang.f_opt_last}
                2
                {$lang.f_opt_day}
                </option>
                <option value="5" {if $smarty.post.period == 5 || $smarty.get.period == 5}selected{/if}>
                {$lang.f_opt_last}
                5
                {$lang.f_opt_day}
                </option>
                <option value="10" {if $smarty.post.period == 10 || $smarty.get.period == 10}selected{/if}>
                {$lang.f_opt_last}
                10
                {$lang.f_opt_day}
                </option>
                <option value="20" {if $smarty.post.period == 20 || $smarty.get.period == 20}selected{/if}>
                {$lang.f_opt_last}
                20
                {$lang.f_opt_day}
                </option>
                <option value="30" {if $smarty.post.period == 30 || $smarty.get.period == 30}selected{/if}>
                {$lang.f_opt_last}
                30
                {$lang.f_opt_day}
                </option>
                <option value="40" {if $smarty.post.period == 40 || $smarty.get.period == 40}selected{/if}>
                {$lang.f_opt_last}
                40
                {$lang.f_opt_day}
                </option>
                <option value="50" {if $smarty.post.period == 50 || $smarty.get.period == 50}selected{/if}>
                {$lang.f_opt_last}
                50
                {$lang.f_opt_day}
                </option>
                <option value="100" {if $smarty.post.period == 100 || $smarty.get.period == 100}selected{/if}>
                {$lang.f_opt_last}
                100
                {$lang.f_opt_day}
                </option>
                <option value="365" {if $smarty.post.period == 365 || $smarty.get.period == 365}selected{/if}>
                {$lang.f_opt_this_year}
                </option>
              </select>
              <select name="sort">
                <option value="desc" {if $smarty.post.sort == 'desc' || $smarty.get.sort == 'desc'}selected{/if}>
                {$lang.f_opt_desc}
                </option>
                <option value="asc" {if $smarty.post.sort == 'asc' || $smarty.get.sort == 'asc'}selected{/if}>
                {$lang.f_opt_asc}
                </option>
              </select>
              <input type="submit" class="button" value="{$lang.showbutt}" />
            </form></td>
        </tr>
      </table></td>
  </tr>
</table>
{/if}
<br />
{if $ugroup != 2}
<p align="center">
<a href="index.php?p=forum&amp;action=print&amp;what=subscription&amp;area={$area|default:'1'}">{$lang.show_all_abos}</a>
&nbsp;|&nbsp;
<a href="index.php?p=forum&amp;action=print&amp;what=subscription&amp;id={$forum->id}&amp;area={$area|default:'1'}">{$lang.show_all_abos_thisforum}</a>
	{if count($topics)}
&nbsp;|&nbsp;
<a href="index.php?p=forum&amp;action=markread&amp;what=forum&amp;id={$forum->id}&amp;area={$area|default:'1'}">{$lang.mark_topics_asread}</a>
	{/if}
</p>
{/if}
<p>
  {$pages}
</p>
<p></p>
<table width="100%"  border="0" cellpadding="4" cellspacing="1">
  <tr valign="top">
    <td><table width="350" border="0" cellpadding="4" cellspacing="1" class="forum_tableborder">
        <tr>
          <td class="forum_header_bolder">{$lang.mods_this_forum}</td>
        </tr>
        <tr>
          <td class="forum_info_main">{if $get_mods}
            {$get_mods}
            {else}
            {$lang.this_forum_hasno_mods}
            {/if}</td>
        </tr>
      </table>
      <br />
      <img src="templates/{$theme}/img/statusicons/thread_new.gif">&nbsp;<small> {$lang.f_lbl_new_post} </small><br />
      <img src="templates/{$theme}/img/statusicons/thread.gif"><small>&nbsp; {$lang.f_lbl_no_new_post}</small>      <br />
      <img src="templates/{$theme}/img/statusicons/thread_hot_new.gif">&nbsp;<small> {$lang.f_lbl_hot_post} </small>      <br />
      <img src="templates/{$theme}/img/statusicons/thread_hot.gif">&nbsp;<small>{$lang.f_lbl_hot_post}</small><br />
      <img src="templates/{$theme}/img/statusicons/thread_lock_new.gif">&nbsp;<small> {$lang.f_lbl_lock_post} </small>      <br />
      <img src="templates/{$theme}/img/statusicons/thread_lock.gif">&nbsp;<small> {$lang.f_lbl_lock_post}</small>      </td>
    <td><div align="right">
        <table width="320" border="0" cellpadding="4" cellspacing="1" class="forum_tableborder">
          <tr>
            <td class="forum_header_bolder">{$lang.jump_to}</td>
          </tr>
          <tr>
            <td nowrap="nowrap" class="forum_info_main">{include file="forums/selector.tpl"}</td>
          </tr>
        </table>
        <br>
        <table width="320" border="0" cellpadding="2" cellspacing="0">
          <tr>
            <td><div align="right" class="forum_info_main">
                {if $forum->permissions.4 == 1}
                {$lang.f_lbl_may_download_attachment}
                <br />
                {else}
                {$lang.f_lbl_may_not_download_attachment}
                <br />
                {/if}
                {if $forum->permissions.5 == 1}
                {$lang.f_lbl_may_post_new_topic}
                <br />
                {else}
                {$lang.f_lbl_may_not_post_new_topic}
                <br />
                {/if}
                {if $forum->permissions.7 == 1}
                {$lang.f_lbl_may_post_replies}
                <br />
                {else}
                {$lang.f_lbl_may_not_post_new_topic}
                <br />
                {/if}
                {if $forum->permissions.10 == 1}
                {$lang.f_lbl_may_edit_own_post}
                <br />
                {else}
                {$lang.f_lbl_may_not_edit_own_post}
                <br />
                {/if}
              </div></td>
          </tr>
        </table>
        <br />
      </div></td>
  </tr>
</table>
</p>
{/strip}
