{* header *}{include file="1549864.tpl"}

{if $user_id eq false}
  <center>{* loginbox *}{include file="1549885.tpl"}</center>
{else}
  <form method="post" style="text-align: center;">
    <div style="color:red;">
      UPOZORNENIE!!<br />
      hladany vyraz musi obsahovat minimalne 2 znaky!!
    </div>
    <br />
    <input type="text" name="search" tabindex="1" id="search" value="{$smarty.post.search}" />
    <input type="submit" name="template_event" tabindex="2" value="search" />
    <script language="javascript" type="text/javascript">document.getElementById('search').focus();</script>
    <br />
    <br />
    {strip}
      <b>order by:</b>&nbsp;&nbsp;
      <label for="order_by_default">default:</label>
      <input type="radio" name="order_by" id="order_by_default" value="default" {if $smarty.post.order_by neq true or $smarty.post.order_by == "default"}checked="checked"{/if} />
      &nbsp;
      <label for="order_by_k">K:</label>
      <input type="radio" name="order_by" id="order_by_k" value="k" {if $smarty.post.order_by == "k"}checked="checked"{/if} />
      &nbsp;
      <label for="order_by_node_views">node views:</label>
      <input type="radio" name="order_by" id="order_by_node_views" value="node_views" {if $smarty.post.order_by == "node_views"}checked="checked"{/if} />
      &nbsp;
      <label for="order_by_node_created">node created:</label>
      <input type="radio" name="order_by" id="order_by_node_created" value="node_created" {if $smarty.post.order_by == "node_created"}checked="checked"{/if} />
      <br />
      <b>show content:</b>&nbsp;&nbsp;
      <label for="show_content_full">full:</label>
      <input type="radio" name="show_content" id="show_content_full" value="full" {if $smarty.post.show_content == "full"}checked="checked"{/if} />
      &nbsp;
      <label for="show_content_short">short:</label>
      <input type="radio" name="show_content" id="show_content_short" value="short" {if $smarty.post.show_content neq true or $smarty.post.show_content == "short"}checked="checked"{/if} />
      &nbsp;
      <label for="show_content_hide">hide:</label>
      <input type="radio" name="show_content" id="show_content_hide" value="hide" {if $smarty.post.show_content == "hide"}checked="checked"{/if} />
    {/strip}
  </form>
  <br />
  <br />

  {get_search listing_amount=$listing_amount offset=$offset}

  {foreach from=$get_search item=child}
  <table class="bordered" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" valign="top" rowspan="2">
        <img vspace="5" hspace="5" width="50" src="{get_image_link id=$child.node_creator}">
        {if $child.k eq true}
        <span class="most_important">{$child.k} k</span>
        {/if}
      </td>
      <td valign="top" style="width: 100%">
        <table width="100%">
          <tr class="header" width="100%" valign="top">
            <td>
              {if $child.percent >= 0}&nbsp;{$child.percent}%{/if}
              &nbsp;<a href="/id/{$child.node_creator}" title="{$child.node_creator_name}">{$child.node_creator_name}</a>
              &nbsp;&nbsp;{$child.node_created|date_format:"%H:%M:%S - %d.%m.%Y"}&nbsp;
              &nbsp;&nbsp;<a href="/id/{$child.node_id}" title="{$child.node_name|strip_tags}">{$child.node_name|strip_tags}</a>&nbsp;&nbsp;
              {if $child.node_created > $node.last_visit}
                <span class="most_important">&nbsp;&nbsp;NEW</span>
              {/if}
              {if $child.node_children_count}
                <span class="most_important">{$child.node_children_count}&nbsp;&nbsp;CHILDREN</span>
              {/if}
            </td>
          </tr>
          <tr>
            <td>
              {if $search_show_content == "hide"}
                &nbsp;
              {elseif $search_show_content == "full"}
                {if $child.nl2br == 1}
                  {$child.node_content|stripslashes|nl2br}
                {else}
                  {$child.node_content|stripslashes}
                {/if}
              {else}
                {if $child.nl2br == 1}
                  {$child.node_content|html_substr:320:'...'|stripslashes|nl2br}
                {else}
                  {$child.node_content|html_substr:320:'...'|stripslashes}
                {/if}
              {/if}
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <br>
  
  {/foreach}
{/if}
{* footer *}{include file="1549377.tpl"}