1 把nic_menu目錄,放在dede的根目錄
2 然后,打開include\config_base.php 文件,在最后的“?>”之前 插入仿chinaz.com二級下拉.txt內(nèi)的代碼
3 打開模板文件,在您需要顯示下拉導(dǎo)航條的地方,插入以下代碼,即可:
{dede:global name='szsy_menu'/}
最主要的php實(shí)現(xiàn)代碼
復(fù)制代碼 代碼如下:
require_once(dirname(__FILE__)."/inc_channel_unit_functions.php");
$szsy_sql=new DedeSql(false);
$szsy_sql2=new DedeSql(false);
$inquery = "select * from dede_arctype where reID=0 ";
$szsy_sql->SetQuery($inquery);
$szsy_sql->execute();
global $szsy_menu;
$szsy_menu="<div class='nav'><div class='navinner'><ul class='navlist'><li><a href='/'>首頁</a></li>";
$menu_i=1;
while ($row=$szsy_sql->GetArray()){
$type_path=GetTypeUrl($row['ID'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
$szsy_menu=$szsy_menu."<li><a href='".$type_path."' id='nav_".$menu_i."' onmouseover=\"showMenu('nav_".$menu_i."','subnav".$menu_i."')\">".$row[typename]."</a>";
//遍歷二級欄目
$szsy_sql2->SetQuery("select * from dede_arctype where reID=".$row[ID]);
$szsy_sql2->execute();
if ($szsy_sql2->GetTotalRow()>0) {
$szsy_menu=$szsy_menu."<div class=\"subnav disable\" id='subnav".$menu_i."'><p class='pointer'>.</p><p><span>";
while ($row2=$szsy_sql2->GetArray()){
$type_path2=GetTypeUrl($row2['ID'],MfTypedir($row2['typedir']),$row2['isdefault'],$row2['defaultname'],$row2['ispart'],$row2['namerule2'],$row2['siteurl']);
$szsy_menu=$szsy_menu."<a href='".$type_path2."'>".$row2[typename]."</a> | ";
}
$szsy_menu=substr($szsy_menu,0,strlen($szsy_menu)-2);
$szsy_menu=$szsy_menu."</span></p></div>";
}
$szsy_menu=$szsy_menu."</li>";
$menu_i++;
}
$szsy_menu=$szsy_menu."</ul></div></div>";
//echo "";
$szsy_sql->close();
$szsy_sql2->close();
本地下載