<{if count($categories) gt 0}>

  <div id="category_tree">
    <{foreach item=category from=$categories name=ii key=counter}>
      <div style="float:left;width:32%;margin:3px 3px 8px 3px;">
        <{if $category.image != ""}>
          <a href="<{my_make_uri option=$uri_options mydirname=$mydirname controller=$c_tree_controller method=$c_tree_method p_key1=cid p_val1=$category.id}>"><img src="<{$xoops_url}>/<{$catimgpath}>/<{$category.image}>" border="0" alt="" style="vertical-align:text-top;" /></a>
        <{/if}>
        <a href="<{my_make_uri option=$uri_options mydirname=$mydirname controller=$c_tree_controller method=$c_tree_method p_key1=cid p_val1=$category.id}>"><{$category.title}></a>&nbsp;(<{$category.totallink}>)<br /><{* $category.subcategories *}>
          <{foreach item=sub from=$category.subcategories key=count name=i}>
            <{if $sub.cid > 0}>
              <a href="<{my_make_uri option=$uri_options mydirname=$mydirname controller=$c_tree_controller method=$c_tree_method p_key1=cid p_val1=$sub.cid}>"><{$sub.title}></a>
              <{if !$smarty.foreach.i.last && $count<5}>,<{/if}>
            <{else}>
              <{$sub.title}>
            <{/if}>
          <{/foreach}>
      </div>
      <{if ($counter+1) is div by 3 || $smarty.foreach.ii.last}>
        <br style="clear:both;">
      <{/if}>
    <{/foreach}>
  </div>

<{else}>

  <{if ! ($category_id || $submitter_id)}>
    <{$smarty.const._MD_NO_CATEGORY}>
  <{/if}>

<{/if}>
