MyCreature
Постоялец
- Регистрация
- 5 Окт 2008
- Сообщения
- 83
- Реакции
- 5
- Автор темы
- #1
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
<table cellspacing="0" cellpadding="0">
{section name=i loop=$root_categories}
{if $smarty.section.i.index is div by 1}{* tr *}{/if}
<tr>
<td align="left" height="30" class="tree">
<a href="index.php?categoryID={$root_categories[0]}">{$root_categories[1]}</a>
</td>
</tr>
{* show sub categories *}
{assign var="tmp" value=0}
{section name=j loop=$root_categories_subs}
{if $root_categories_subs[j][3] == $root_categories[0]}
{if $categoryID == $root_categories_subs[j].categoryID}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <b>{$root_categories_subs[j][1]}
</td>
</tr>
{else}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <a href="index.php?categoryID={$root_categories_subs[j][0]}" class=standard>{$root_categories_subs[j][1]}</a>
</td>
</tr>
{/if}
{/if}
{/section}
{if ($smarty.section.i.index+1) is div by 2}{/if}
{/section}
</table>
<table cellspacing="0" cellpadding="0">
{section name=i loop=$root_categories}
.....
.....
{/section}
</table>
{section name=i loop=$root_categories}
<table cellspacing="0" cellpadding="0">
......
......
</table>
{/section}
{* category navigation tree *}
<ul>
{section name=i loop=$categories_tree}
{if $categories_tree[i].categoryID != 1}
<li class="{if $categories_tree[i].level>1}child{else}parent{/if}{if $categoryID ==
$categories_tree[i].categoryID}_current{/if}">
{section name=j loop=$categories_tree max=$categories_tree[i].level-1}<span class="tab"> </span>{/section}
{if $categories_tree[i].slug}
{assign var=_category_url
value="?categoryID=`$categories_tree[i].categoryID`&category_slug=`$categories_tree[i].slug`"|set_query_html}
{else}
{assign var=_category_url value="?categoryID=`$categories_tree[i].categoryID`"|set_query_html}
{/if}
<span class="bullet"> </span>
{if $categories_tree[i].level==1}<a href='{$_category_url}'><font style="font-size:14px; font-weight: bold; color:
#532919; text-decoration: none;">{$categories_tree[i].name|escape:'html'}</font></a>
{else}
<a href='{$_category_url}'>{$categories_tree[i].name|escape:'html'}</a>
{/if}
{section name=j loop=$categories_tree max=$categories_tree[i].level-1}<span class="tab"> </span>{/section}
</li>
{/if}
{/section}
</ul>
if ( isset($categoryID) )
$out = catGetCategoryCompactCList( $categoryID );
else
$out = catGetCategoryCompactCList( 1 );
$out = catGetCategoryCList( );
{* category navigation tree *}
<ul>
{section name=i loop=$categories_tree} {if $categories_tree[i].categoryID != 1}
<li class="{if $categories_tree[i].level>1}child{else}parent{/if}{if $categoryID == $categories_tree[i].categoryID}_current{/if}">
{section name=j loop=$categories_tree max=$categories_tree[i].level-1}<span class="tab"> </span>{/section}
{if $categories_tree[i].slug}
{assign var=_category_url value="?categoryID=`$categories_tree[i].categoryID`&category_slug=`$categories_tree[i].slug`"|set_query_html}
{else}
{assign var=_category_url value="?categoryID=`$categories_tree[i].categoryID`"|set_query_html}
{/if}
<span class="bullet"> </span><a href='{$_category_url}'>{$categories_tree[i].name|escape:'html'}</a>
</li>
{/if} {/section}
</ul>
function methodCategoryTree(){
global $smarty;
$Register = &Register::getInstance();
/*@var $Register Register*/
// category navigation form
if ( isset($_GET['categoryID']) || $Register->get('categoryID') )
$out = catGetCategoryCompactCList( isset($_GET['categoryID'])?$_GET['categoryID']:$Register->get('categoryID'));
else
$out = catGetCategoryCompactCList( 1 );
$smarty->assign( "categories_tree", $out );
}
{* category navigation tree *}
<ul>
{section name=i loop=$categories_tree}
{if $categories_tree[i].categoryID != 1}
<li class="{if $categories_tree[i].level>[COLOR="Red"][B]0[/B][/COLOR]}child{else}parent{/if}{if $categoryID == $categories_tree[i].categoryID}_current{/if}">
{section name=j loop=$categories_tree max=$categories_tree[i].[COLOR="red"][B]level[/B][/COLOR]}
<span class="tab">
</span>
{/section}
{if $categories_tree[i].slug}
{assign var=_category_url value="?categoryID=`$categories_tree[i].categoryID`&category_slug=`$categories_tree[i].slug`"|set_query_html}
{else}
{assign var=_category_url value="?categoryID=`$categories_tree[i].categoryID`"|set_query_html}
{/if}
<span class="bullet">
</span>
<a href='{$_category_url}'>{$categories_tree[i].name|escape:'html'}</a>
</li>
{/if}
{/section}
</ul>