<ul class='node_children'>
{if $template_event eq 'filter_by'} 
{get_threaded_children_structured listing_amount=23232322323 offset=$offset search_type=$post_vars.search_type link='yes' ordearby=$listing_order search=$post_vars.node_content} 
{else} {get_threaded_children_structured link='yes' thread_depth=2 listing_amount=$listing_amount offset=$offset ordearby=$listing_order} {/if} 

{section name=child loop=$get_threaded_children_structured}
{if $get_threaded_children_structured[child].template_id neq 1549834} 

{*depth in hierarchy*}
{if $template_event eq 'filter_by'}
  {math equation="(x-y)" x=$get_threaded_children_structured[child].child_depth y=$get_threaded_children_structured[child].child_depth_prev assign="p_depth"}
{else}
  {math equation="(x-y)-1" x=$get_threaded_children_structured[child].child_depth y=$get_threaded_children_structured[child].child_depth_prev assign="p_depth"}
{/if}
{assign var=$child_creator value=$get_threaded_children_structured[child].node_creator}

{*obsah childu*}
{capture name=child_container}
{*IGNORE USER CONDITION*}{if $ignore[$child_creator] neq true}
<!-- obsah child prispevku||nody  -->
  <div class='sub-content'>
    <div class='sub-header'>
      {* put.Ty hack *}
      {if $get_threaded_children_structured[child].synapse_creator neq ''}
      <img src='{get_image_link id=$get_threaded_children_structured[child].synapse_creator}' alt='SYNAPSE CREATOR' class='avatar'/>
      {else}
      <img src='{get_image_link id=$get_threaded_children_structured[child].node_creator}' alt='{$get_threaded_children_structured[child].login}' onclick="km();sm('{$get_threaded_children_structured[child].login|escape:"html"}','{$get_threaded_children_structured[child].node_creator}','{$node.node_id}')" class='avatar'/>
      {/if}
      {*end of put.Ty hack *}
    
      <a href='/id/{$get_threaded_children_structured[child].node_creator}' class='childLogin'>{$get_threaded_children_structured[child].login}</a>
      <input type='checkbox' value='{$get_threaded_children_structured[child].node_id}' name='node_chosen[]' />
      {$get_threaded_children_structured[child].node_created|date_format:"%d.%m.%Y - %H:%M:%S"}
      {if $get_threaded_children_structured[child].k > 0} [<span class='most_important'>{$get_threaded_children_structured[child].k}K</span>] {/if}
      {if $get_threaded_children_structured[child].node_created > $node.last_visit and !$get_threaded_children_structured[child].orphan}<span class='most_important'>NEW</span> 
      {elseif $get_threaded_children_structured[child].node_created > $node.last_visit} <span class='most_important'>SIRôTKA</span>{/if}
      {if $get_threaded_children_structured[child].node_status eq 'linked'} <span class='important'>HARDLINK</span>{/if}
      {if $get_threaded_children_structured[child].node_updated > $node.last_visit}<span class='most_important'>!!CONTENT CHANGED!!</span>{/if}
      {if $bookmarks.last_visit eq true and $get_threaded_children_structured[child].lastdescendant_created > $bookmarks.last_visit}<span class='most_important'>!!NEW DESCENDANT!!</span>{/if}
      <div class='sub-title'>
        {if $get_threaded_children_structured[child].node_name eq ''}<a href='/id/{$get_threaded_children_structured[child].node_id}'>enter node {$get_threaded_children_structured[child].node_id}</a>
        {else}<a href='/id/{$get_threaded_children_structured[child].node_id}'>{$get_threaded_children_structured[child].node_name|stripslashes|strip_tags}</a>{/if}
        {if $get_threaded_children_structured[child].node_creator eq $user_id || $get_threaded_children_structured[child].node_permission eq 'master'}| <a href='/id/{$get_threaded_children_structured[child].node_id}/1961033'>conf</a>{/if}
      </div>
    </div>
    <div class='sub-body'>
    {if $permissions.r}
      {if $get_threaded_children_structured[child].nl2br == 1}
        {$get_threaded_children_structured[child].node_content|stripslashes|nl2br|replaceLocalURLs}
      {else}
        {$get_threaded_children_structured[child].node_content|stripslashes|replaceLocalURLs}
      {/if}
    {else}you don't have permissions for viewing this data node{/if}        
    </div>
  </div>
{/if}{*IGNORE USER CONDITION end*}
{/capture} 


{*stromcek prestri sa*}
{if $smarty.section.child.first && $node.child_starter < $get_threaded_children_structured[child].child_depth}
{section name=sta loop=$get_threaded_children_structured[child].ph_depth}
<li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}
{/if}
{if $get_threaded_children_structured[child].node_parent neq $node.node_id && $get_threaded_children_structured[child].node_status neq 'linked' && $get_threaded_children_structured[child].node_parent neq $get_threaded_children_structured[child.index_prev].node_id && $get_threaded_children_structured[child].child_depth_prev < $get_threaded_children_structured[child].child_depth} 
{section name=sta loop=$p_depth}
<li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}
{elseif $get_threaded_children_structured[child].node_parent neq $node.node_id && $get_threaded_children_structured[child.index_prev].node_status neq 'linked' && $get_threaded_children_structured[child].node_parent neq $get_threaded_children_structured[child.index_prev].node_id && $get_threaded_children_structured[child].child_depth_prev < $get_threaded_children_structured[child].child_depth} 
{section name=sta loop=$p_depth}
<li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}
{elseif $get_threaded_children_structured[child].thread_root neq $get_threaded_children_structured[child].thread_root_prev && $get_threaded_children_structured[child].node_parent neq $node.node_id && $get_threaded_children_structured[child].node_status neq 'linked'}
{section name=sta loop=$get_threaded_children_structured[child].ph_depth}
<li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}
{elseif $get_threaded_children_structured[child].thread_root neq $get_threaded_children_structured[child].thread_root_prev && $get_threaded_children_structured[child].node_parent neq $node.node_id && $get_threaded_children_structured[child.index_prev].node_status neq 'linked'} 
{section name=sta loop=$get_threaded_children_structured[child].ph_depth}
<li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}
{/if}
  <li id='sub{$get_threaded_children_structured[child].node_id}' class='level{$get_threaded_children_structured[child].child_depth}'>
    <a href='/id/{$get_threaded_children_structured[child].node_parent}' class='vector'>{$get_threaded_children_structured[child].node_vector}</a>
    {$smarty.capture.child_container} {*obsah*}
    
{if $get_threaded_children_structured[child].child_depth_next > $get_threaded_children_structured[child].child_depth && $get_threaded_children_structured[child].thread_root neq $get_threaded_children_structured[child].thread_root_prev && $get_threaded_children_structured[child].node_parent neq $node.node_id}
{section name=con loop=$get_threaded_children_structured[child].c_depth}
  <li class='level{$get_threaded_children_structured[child].child_depth}' title='virtual'><ul>
{/section}

{elseif $get_threaded_children_structured[child].child_depth_next > $get_threaded_children_structured[child].child_depth && $get_threaded_children_structured[child].thread_root eq $get_threaded_children_structured[child].thread_root_next && $get_threaded_children_structured[child.index_next].node_status neq 'linked'}<ul>
    {elseif $get_threaded_children_structured[child].child_depth_next > $get_threaded_children_structured[child].child_depth && $get_threaded_children_structured[child.index_next].node_status eq 'linked'} <ul>{else}{if $get_threaded_children_structured[child].node_children_count}<a href='/id/{$get_threaded_children_structured[child].node_id}'>{$get_threaded_children_structured[child].node_children_count} more descendats</a>{/if}

   </li>
{/if}{if $get_threaded_children_structured[child].child_depth_next < $get_threaded_children_structured[child].child_depth || $get_threaded_children_structured[child].thread_root neq $get_threaded_children_structured[child].thread_root_next || $smarty.section.child.last}
{section name=fin loop=$get_threaded_children_structured[child].hierarchy_depth}{if $get_threaded_children_structured[child].node_children_count}<a href='/id/{$get_threaded_children_structured[child].node_id}'>{$get_threaded_children_structured[child].node_children_count} more descendats</a>{/if}
   </ul></li>
{/section}{/if}
{/if}{/section}
</ul>
