?? inc_menu.php
字號:
<?
require_once(dirname(__FILE__)."/../../include/config_base.php");
require_once(dirname(__FILE__)."/../../include/pub_dedetag.php");
$dsql = new DedeSql(false);
//載入可發(fā)布頻道
$dsql->SetQuery("Select ID,typename,addcon From #@__channeltype where ID>0 And isshow=1 order by ID asc");
$dsql->Execute();
$addset = "";
while($row = $dsql->GetObject())
{
$addset .= " <m:item name='發(fā)布".$row->typename."' link='".$row->addcon."?channelid=".$row->ID."' rank='1' target='main' />\r\n";
}
//載入插件
$dsql->SetQuery("Select * From #@__plus where isshow=1 order by aid asc");
$dsql->Execute();
$plusset = "";
while($row = $dsql->GetObject())
{
$plusset .= $row->menustring."\r\n";
}
$dsql->Close();
//////////////////////////
$menus = "
-----------------------------------------------
<m:top name='頻道管理' display='block' rank='1'>
<m:item name='網站欄目管理' link='catalog_main.php' rank='1' target='main' />
<m:item name='頻道模型管理' link='mychannel_main.php' rank='5' target='main' />
<m:item name='自定義標記' link='mytag_main.php' rank='5' target='main' />
<m:item name='全局標記測試' link='tag_test.php' rank='5' target='main' />
<m:item name='單獨頁面管理' link='templets_one.php' rank='5' target='main' />
<m:item name='瀏覽模板目錄' link='catalog_do.php?dopost=viewTemplet' rank='5' target='main' />
</m:top>
<m:top name='文檔維護' display='block' rank='1'>
<m:item name='普通內容列表' link='content_list.php' rank='1' target='main' />
<m:item name='圖文混排列表' link='content_i_list.php' rank='1' target='main' />
<m:item name='關鍵詞維護' link='article_keywords_main.php' rank='5' target='main' />
<m:item name='評論管理' link='feedback_main.php' rank='1' target='main' />
</m:top>
<m:top name='內容發(fā)布' display='block' rank='1'>
$addset
</m:top>
<m:top name='HTML更新' display='block' rank='5'>
<m:item name='更新主頁HTML' link='makehtml_homepage.php' rank='5' target='main' />
<m:item name='更新欄目HTML' link='makehtml_list.php' rank='5' target='main' />
<m:item name='更新文檔HTML' link='makehtml_archives.php' rank='5' target='main' />
<m:item name='更新網站地圖' link='makehtml_map_guide.php' rank='5' target='main' />
<m:item name='更新RSS文件' link='makehtml_rss.php' rank='5' target='main' />
<m:item name='獲取JS文件' link='makehtml_js.php' rank='5' target='main' />
</m:top>
<m:top name='專題管理' display='none' rank='5'>
<m:item name='創(chuàng)建新專題' link='spec_add.php' rank='5' target='main' />
<m:item name='專題列表' link='content_s_list.php' rank='5' target='main' />
<m:item name='更新專題HTML' link='makehtml_spec.php' rank='5' target='main' />
</m:top>
<m:top name='采集管理' display='none' rank='5'>
<m:item name='采集節(jié)點管理' link='co_main.php' rank='5' target='main' />
<!--m:item name='導出規(guī)則管理' link='co_export_rule.php' rank='5' target='main' /-->
<m:item name='已下載內容管理' link='co_url.php' rank='5' target='main' />
</m:top>
<m:top name='附助插件' display='none' rank='1'>
<m:item name='插件管理器' link='plus_main.php' rank='10' target='main' />
$plusset
</m:top>
<m:top name='會員管理' display='none' rank='5'>
<!--m:item name='外部系統(tǒng)整合' link='javascript:;' rank='5' target='main' /-->
<m:item name='注冊會員列表' link='member_main.php' rank='5' target='main' />
<m:item name='會員權限管理' link='member_rank.php' rank='5' target='main' />
</m:top>
<m:top name='系統(tǒng)管理' display='none' rank='10'>
<m:item name='系統(tǒng)帳號管理' link='sys_admin_user.php' rank='10' target='main' />
<m:item name='數(shù)據(jù)備份還原' link='sys_back_data.php' rank='10' target='main' />
</m:top>
<m:top name='系統(tǒng)幫助' display='none' rank='1'>
<m:item name='系統(tǒng)主頁' link='index_body.php' rank='1' target='main' />
<m:item name='模板代碼參考' link='help_templet.php' rank='1' target='main' />
<m:item name='織夢官方論壇' link='http://bbs.dedecms.com/' rank='1' target='_blank' />
</m:top>
-----------------------------------------------
";
function GetMenus($userrank)
{
$headTemplet = "<table width='130' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2' height='24' align='center' background='img/menu_top.gif' onClick='showHide(\"items~cc~\")' class='top'>~channelname~</td>
</tr>
<tr style='display:~display~' id='items~cc~'>
<td colspan='2' align='center'>
<table width='130' border='0' cellspacing='0' cellpadding='0' bgcolor='#F4FBF4'>
";
$footTemplet = " </table>
</td>
</tr>
</table>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr><td height='3'></td></tr>
</table>
";
$itemTemplet = " <tr>
<td align='center' class='tdline-left' width='20%'><img src='img/newitem.gif' width='7' height='10' alt=''/></td>
<td class='tdline-right' width='80%'><a href='~link~' target='~target~'>~itemname~</a></td>
</tr>
";
/////////////////////////////////////////
global $menus;
$dtp = new DedeTagParse();
$dtp->SetNameSpace("m","<",">");
$dtp->LoadSource($menus);
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("m","<",">");
foreach($dtp->CTags as $i=>$ctag)
{
if($ctag->GetName()=="top" && $ctag->GetAtt("rank")<=$userrank)
{
echo "<!-- Item ".($i+1)." Strat -->\r\n";
$htmp = str_replace("~channelname~",$ctag->GetAtt("name"),$headTemplet);
$htmp = str_replace("~display~",$ctag->GetAtt("display"),$htmp);
$htmp = str_replace("~cc~",$i,$htmp);
echo $htmp;
$dtp2->LoadSource($ctag->InnerText);
foreach($dtp2->CTags as $j=>$ctag2)
{
if($ctag2->GetName()=="item" && $ctag2->GetAtt("rank")<=$userrank)
{
$itemtmp = str_replace("~link~",$ctag2->GetAtt("link"),$itemTemplet);
$itemtmp = str_replace("~target~",$ctag2->GetAtt("target"),$itemtmp);
$itemtmp = str_replace("~n~",$i,$itemtmp);
$itemtmp = str_replace("~itemname~",$ctag2->GetAtt("name"),$itemtmp);
echo $itemtmp;
}
}
echo $footTemplet;
echo "<!-- Item ".($i+1)." End -->\r\n";
}
}
}//End Function
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -