地区联动显示 ,仅用于搜索页面显示,
如公司搜索页面:
1、在顶级地区上面几行加入代码:
-
{php $barea=get_area($areaid);}
2、顶级地区显示代码:
-
<ul class="wapper-w945" id="lei2">
<li><a href="{$MOD[linkurl]}list.php?catid={$catid}" {if !$areaid}class="cur"{/if} >不限</a></li>
<!--{php $tagsss=tag("table=area&condition=parentid=0&order=areaid ASC&pagesize=50&template=null");}-->
{loop $tagsss $i $v}
<li><a href="{$MOD[linkurl]}search.php?areaid={$v[areaid]}&catid={$catid}" {if $areaid==$v[areaid] || $barea[parentid]==$v[areaid]}class="cur"{/if}>{$v[areaname]}</a></li>
{/loop}
</ul>
3、联动2级代码:
-
{if $barea[parentid]}
{php $arid=$barea['parentid'];}
{else}
{php $arid=$areaid;}
{/if}
<ul class="wapper-w945" id="lei3" {if !$areaid}style="display:none"{/if}>
<li><a href="{$MOD[linkurl]}list.php?catid={$catid}" {if !$areaid}class="cur"{/if} >不限</a></li>
<!--{php $tagsss=tag("table=area&condition=parentid=$arid&order=areaid ASC&pagesize=50&template=null");}-->
{loop $tagsss $i $v}
<li><a href="{$MOD[linkurl]}search.php?areaid={$v[areaid]}&catid={$catid}" {if $v[areaid]==$areaid}class="cur"{/if}>{$v[areaname]}</a></li>
{/loop}
</ul>