﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Baldwin's DNN</title>
    <description>在此研究DNN的所有相关课题，希望给DNN在中国的广为人知贡献一点绵薄之力....</description>
    <link>http://www.dnnsun.com/Community/BaldwinsBlog/tabid/67/blogid/1/Default.aspx</link>
    <language>zh-CN</language>
    <managingEditor>dnnsun@gmail.com</managingEditor>
    <webMaster>dnnsun@gmail.com</webMaster>
    <pubDate>Tue, 06 Jan 2009 06:36:21 GMT</pubDate>
    <lastBuildDate>Tue, 06 Jan 2009 06:36:21 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>SunBlog RSS Generator Version 2.1.0.0</generator>
    <item>
      <title>如何定制DNN站点的网站管理和主机管理</title>
      <description>&lt;div&gt;申明一下,这一篇文章是参考&lt;a href="http://www.dnnskin.cn/"&gt;http://www.dnnskin.cn&lt;/a&gt;站点上的某一贴子而写,就是对此有所总结。(大家有兴趣不妨去看看,挺不错的:)&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="126" alt="admin configure" src="http://www.dnnsun.com/WindowsLiveWriter/DNN_12B2A/admin_configure_6.gif" width="147" align="left" border="0" /&gt; &lt;/div&gt;  &lt;div&gt;在DNN使用中，我们可能有这样的需求，那就不想开放过多的权限给管理员以防止误删的事件，当然可能也有这样的需求， 增加某一个管理页面，对此的一般做法设置为管理员可见，这样就可以保证只有管理员才能查看和编辑这个页面，但是红色的边框提示确实比较难看，或许你需要把这个页面加入到admin或者host菜单，这样更方便管理和显得合理。在这里我们列举如何利用SQL Script来实现(当然也可能也有其他方法，但SQL应该是比较方便和直接的，前提你具有host帐号权限),接下来我们就分别对这两种情况讲解.&lt;/div&gt;  &lt;div&gt;&lt;font color="#ff0000"&gt;注意：以下更改之后必须重启IIS方才生效。&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;1) 屏蔽某些管理页面，也就是隐藏这些页面,最简捷的解决方案就是把类似以下的脚本拷贝到 &lt;strong&gt;主机管理/SQL服务&lt;/strong&gt;下 当作脚本执行即可隐藏这些页面,不过缺点也是明显,如果你直接拷贝原来的Url仍然可以访问这一页面,实质就是我们只不过玩弄一下技巧吧了,当然你也可以设置IsDeleted或DisableLink这一属性,这就可以彻底的防止通过Url访问了。&lt;/div&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;UPDATE&lt;/span&gt; {databaseOwner}[{objectQualifier}Tabs]
        &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; [IsVisible]=&lt;span style="color: #006080"&gt;'0'&lt;/span&gt; &lt;span style="color: #008000"&gt;-- Apply to the admin tab to not show&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; tabid=52&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;2) 增加管理页面并加入网站管理或主机管理菜单中。&lt;/div&gt;

&lt;div align="left"&gt;首先我们新建一个页面，要记得查看页面id并记录下来 ,页面权限为正常即可，不必设置为管理员可见，然后添加管理模块到该页面,之后把类似以下的脚本拷贝到 &lt;strong&gt;主机管理/SQL服务&lt;/strong&gt;下 当作脚本执行即可完成把管理页面改到管理菜单下&lt;/div&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;UPDATE&lt;/span&gt; {databaseOwner}[{objectQualifier}Tabs] 
        &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; [TabOrder]=&lt;span style="color: #006080"&gt;'10032'&lt;/span&gt;,
            [IsVisible]=&lt;span style="color: #006080"&gt;'1'&lt;/span&gt;,
            [PortalID]=0, &lt;span style="color: #008000"&gt;-- the filed related to which portal the admin menu exist &lt;/span&gt;
            [ParentID]=&lt;span style="color: #006080"&gt;'38'&lt;/span&gt;,
            [&lt;span style="color: #0000ff"&gt;Level&lt;/span&gt;]=&lt;span style="color: #006080"&gt;'1'&lt;/span&gt;,   &lt;span style="color: #008000"&gt;-- the filed is the menu level, 0 is 1st, 1 apply to 2st...&lt;/span&gt;
            [TabPath]=&lt;span style="color: #006080"&gt;'//Admin//YourTabName'&lt;/span&gt;, &lt;span style="color: #008000"&gt;-- YourTabName is your tabName which you will insert into the admin menus&lt;/span&gt;
            [IconFile]=&lt;span style="color: #006080"&gt;'yourTabimage src'&lt;/span&gt; &lt;span style="color: #008000"&gt;-- this filed is optional&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; tabid=57&lt;/pre&gt;
&lt;/div&gt;

&lt;div align="left"&gt;&lt;strong&gt;参数解析:&lt;/strong&gt;&lt;/div&gt;

&lt;div align="left"&gt;1) TabOrder: 站点管理菜单TabOrder值截止到10031，也就是说你可以用10032 10033 10034……&lt;/div&gt;

&lt;div align="left"&gt;2) ParentID: ParentID的计算，站点ID为0时，ParentID为38，站点ID为1时，ParentID为56，站点ID为2时，ParentID为74，站点id加1，ParentID加18&lt;/div&gt;

&lt;div align="left"&gt;portalid=0 ParentID=38&lt;/div&gt;

&lt;div align="left"&gt;portalid=1 ParentID=56&lt;/div&gt;

&lt;div align="left"&gt;portalid=2 ParentID=74&lt;/div&gt;

&lt;div align="left"&gt;portalid=3 ParentID=92&lt;/div&gt;

&lt;div align="left"&gt;……&lt;/div&gt;

&lt;div align="left"&gt;这一方法待考证.&lt;/div&gt;

&lt;div align="left"&gt;3) tabid: 你要加进管理菜单的页面的id&lt;/div&gt;

&lt;div align="left"&gt;类似如果想要把管理菜单写入host菜单下，需要修改语句如下：&lt;/div&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;UPDATE&lt;/span&gt; {databaseOwner}[{objectQualifier}Tabs] 
    &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; [TabOrder]=&lt;span style="color: #006080"&gt;'24'&lt;/span&gt;,
        [IsVisible]=&lt;span style="color: #006080"&gt;'1'&lt;/span&gt;,
        [PortalID]=&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
        [ParentID]=&lt;span style="color: #006080"&gt;'7'&lt;/span&gt;,
        [&lt;span style="color: #0000ff"&gt;Level&lt;/span&gt;]=&lt;span style="color: #006080"&gt;'1'&lt;/span&gt;,   &lt;span style="color: #008000"&gt;-- the filed is the menu level, 0 is 1st, 1 apply to 2st...&lt;/span&gt;
        [TabPath]=&lt;span style="color: #006080"&gt;'//Host//YourTabName'&lt;/span&gt;, &lt;span style="color: #008000"&gt;-- YourTabName is your tabName which you will insert into the admin menus&lt;/span&gt;
        [IconFile]=&lt;span style="color: #006080"&gt;'yourTabimage src'&lt;/span&gt;  &lt;span style="color: #008000"&gt;-- this filed is optional&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; tabid=57&lt;/pre&gt;
&lt;/div&gt;

&lt;div align="left"&gt;
  &lt;div align="left"&gt;&lt;span style="font-size: 9pt"&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;strong&gt;参数解析:&lt;/strong&gt;&lt;/div&gt;

&lt;div align="left"&gt;1) TabOrder: TabOrder主机管理菜单TabOrder值截止23,你可以用24 25 26……&lt;/div&gt;

&lt;div align="left"&gt;2) PortalID: 主机管理菜单PortalID值不变,因为主机管理是全局的,故PortalID默认为NULL&lt;/div&gt;

&lt;div align="left"&gt;2) ParentID: 类似PortalID，因为主机管理是全局的,故ParentID一般为7&lt;/div&gt;

&lt;div align="left"&gt;3) tabid: 你要加进管理菜单的页面的id&lt;/div&gt;

&lt;div align="left"&gt;当然还可以在Admin或者是Host菜单下添加二级管理菜单,只需要加上TabPath='//Admin//一级//二级//…',&lt;/div&gt;</description>
      <link>http://www.dnnsun.com/Community/BaldwinsBlog/tabid/67/entryid/28/How-to-Customize-Website-Admin-and-Host-Manage-In-DNN-Framework.aspx</link>
      <author>dnnsun@gmail.com</author>
      <comments>http://www.dnnsun.com/Community/BaldwinsBlog/tabid/67/entryid/28/How-to-Customize-Website-Admin-and-Host-Manage-In-DNN-Framework.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dnnsun.com/Community/BaldwinsBlog/tabid/67/entryid/28/How-to-Customize-Website-Admin-and-Host-Manage-In-DNN-Framework.aspx</guid>
      <pubDate>Mon, 07 Apr 2008 15:55:03 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dnnsun.com/DesktopModules/SunBlog/Trackback.aspx?id=28</trackback:ping>
    </item>
  </channel>
</rss>