标签调用
{dede:channelartlist typeid=‘top‘ row=‘10‘}
<li> <a href="{dede:field name=‘typeurl‘/}">{dede:field name=‘typename‘/}</a>
<div class="nav-w">
<div class="section-nav1">
<ul>
{dede:channel type=‘son‘ noself=‘yes‘}
<li><a href="[field:typeurl/]">[field:typename/]</a></li>
{/dede:channel}
</ul>
</div>
</div>
</li>
{/dede:channelartlist}
SQL语句调用
<?php
$dsql->Execute(‘me‘,"SELECT * FROM `#@__arctype` arc WHERE ishidden = ‘0‘ AND topid = ‘0‘ ORDER BY sortrank ASC limit 7");
while($arr = $dsql->GetArray())
{
echo ‘<li>‘;if($arr[‘ispart‘]==2){ echo ‘<a href="‘.$arr[‘typedir‘].‘" >‘;}else{echo ‘<a href="../plus/list.php?tid=‘.$arr[‘id‘].‘" >‘;}echo $arr[‘typename‘].‘</a>
<div class="nav-w">
<div class="section-nav1"><ul>‘;
$dsql->Execute(‘me2‘,"SELECT * FROM `#@__arctype` arc WHERE ishidden = ‘0‘ AND topid = {$arr[‘id‘]} ORDER BY sortrank ASC limit 7");
while($arr2 = $dsql->GetArray(‘me2‘))
{
echo ‘<li>‘;if($arr2[‘ispart‘]==2){ echo ‘<a href="‘.$arr2[‘typedir‘].‘"‘; if($arr2[‘seotitle‘]==1){echo ‘target="_blank"‘;} echo ‘>‘;}else{ echo ‘<a href="../plus/list.php?tid=‘.$arr2[‘id‘].‘" >‘;}echo $arr2[‘typename‘].‘</a></li>‘;
}
echo ‘</ul>
</div>
</div>
</li>‘;
}
?>