    <?php
        $add_channel_menu = array();
        //如果為遊客訪問，不啟用左側菜單
        if(!empty($cfg_ml->M_ID))
        {
            $channelInfos = array();
            $dsql->Execute('addmod',"SELECT id,nid,typename,useraddcon,usermancon,issend,issystem,usertype,isshow FROM `#@__channeltype` ");	
            while($menurow = $dsql->GetArray('addmod'))
            {
                $channelInfos[$menurow['nid']] = $menurow;
                //禁用的模型
                if($menurow['isshow']==0)
                {
                    continue;
                }
                //其它情況
                if($menurow['issend']!=1 || $menurow['issystem']==1 
                || ( !preg_match("#".$cfg_ml->M_MbType."#", $menurow['usertype']) && trim($menurow['usertype'])!='' ) )
                {
                    continue;
                }
                $menurow['ddcon'] = empty($menurow['useraddcon']) ? 'archives_add.php' : $menurow['useraddcon'];
                $menurow['list'] = empty($menurow['usermancon']) ? 'content_list.php' : $menurow['usermancon'];
                $add_channel_menu[] = $menurow;
            }
            unset($menurow);
		?>
    <div id="mcpsub">
      <div class="topGr"></div>
      <div id="menuBody">
      	<!-- 內容中心菜單-->
      	<?php
      	if($menutype == 'content')
      	{
      	?>
        <h2 class="menuTitle" onclick="menuShow('menuFirst')" id="menuFirst_t"><b></b>系統模型內容</h2>
        <ul id="menuFirst">
        <?php
        //是否啟用文章投稿
        if($channelInfos['article']['issend']==1 && $channelInfos['article']['isshow']==1)
        {
        ?>
          <li class="articles"><a href="../member/content_list.php?channelid=1" title="已發佈的文章"><b></b>文章</a><a href="../member/article_add.php" class="act" title="發表新文章">發表</a></li>
        <?php
      	}
        //是否啟用圖集投稿
        if($channelInfos['image']['issend']==1 && $cfg_mb_album=='Y'  && $channelInfos['image']['isshow']==1 
        && ($channelInfos['image']['usertype']=='' || preg_match("#".$cfg_ml->fields['mtype']."#", $channelInfos['image']['usertype'])) )
        {
        ?>
          
          
          <li class="photo"><a href="../member/content_list.php?channelid=2" title="管理圖集"><b></b>圖集</a><a href="../member/album_add.php" class="act" title="新建圖集">新建</a></li>
	        <?php
	      	}
	      	//是否啟用軟件投稿
	        if($channelInfos['soft']['issend']==1 && $channelInfos['soft']['isshow']==1
	        && ($channelInfos['image']['usertype']=='' || preg_match("#".$cfg_ml->fields['mtype']."#", $channelInfos['image']['usertype']))
	        )
	        {
	        ?>
          <li class="soft"><a href="../member/content_list.php?channelid=3" title="已發佈的軟件"><b></b>軟件</a><a href="../member/soft_add.php" title="上傳軟件"class="act">上傳</a></li>
          <?php
           }
           ?>
        </ul>
				<?php
				//是否允許對自定義模型投稿
				if($cfg_mb_sendall=='Y')
				{
				?>
        <h2 class="menuTitle" onclick="menuShow('menuSec')" id="menuSec_t"><b></b>自定義內容</h2>
        <ul id="menuSec">
					<?php
					foreach($add_channel_menu as $nnarr) {
					?>
					<li class="<?php echo $nnarr['nid'];?>"><a href="../member/<?php echo $nnarr['list'];?>?channelid=<?php echo $nnarr['id'];?>" title="已發佈的<?php echo $nnarr['typename'];?>"><b></b><?php echo $nnarr['typename'];?></a><a href='archives_do.php?dopost=addArc&channelid=<?php echo $nnarr['id'];?>' class="act" title="發表新文章">發表</a></li>
					<?php
					} 
					}
					?>  
        </ul>
        <h2 class="menuTitle" onclick="menuShow('menuThird')" id="menuThird_t"><b></b>其他管理</h2>
        <ul id="menuThird">
        	<li class="icon attachment"><a href="../member/uploads.php"><b></b>附件管理</a></li>
        </ul>
        
        <?php
      }
      ?>
      	<!-- 我的織夢菜單-->
      	<?php
      	if($menutype == 'mydede')
      	{
      	?>
        <h2 class="menuTitle" onclick="menuShow('menuFirst')" id="menuFirst_t"><b></b>會員互動</h2>
        <ul id="menuFirst">
        	<li class="icon mystow"><a href="../member/mystow.php"><b></b>我的收藏夾</a></li>
        <?php
        if($cfg_feedback_forbid=='N')
        {
          //<li class="icon feedback"><a href='../member/myfeedback.php'>我的評論</a></li>
        }
        $dsql->Execute('nn','Select indexname,indexurl From `#@__sys_module` where ismember=1 ');
        while($nnarr = $dsql->GetArray('nn'))
        {
        	@preg_match("/\/(.+?)\//is", $nnarr['indexurl'],$matches);
        	$nnarr['class'] = isset($matches[1]) ? $matches[1] : 'channel';
        	$nnarr['indexurl'] = str_replace("**","=",$nnarr['indexurl']);
        ?>
        <li class="<?php echo $nnarr['class'];?>"><a href="<?php echo $nnarr['indexurl']; ?>"><b></b><?php echo $nnarr['indexname']; ?>模塊</a></li>
        <?php
        }
        ?>
        </ul>
        <?php
      }
      ?>
      	<!-- 系統設置菜單-->
      	<?php
      	if($menutype == 'config')
      	{
      	?>
        <h2 class="menuTitle" onclick="menuShow('menuFirst')" id="menuFirst_t"><b></b><?php echo $cfg_ml->M_MbType; ?>資料</a></h2>
        <ul id="menuFirst">
        	<li class="icon baseinfo"><a href="../member/edit_baseinfo.php"><b></b>基本資料</a></li>
	        <li class="icon myinfo"><a href="../member/edit_fullinfo.php"><b></b><?php echo $cfg_ml->M_MbType; ?>資料</a></li>
	        <li class="icon face"><a href="../member/edit_face.php"><b></b>頭像設置</a></li>
        </ul>
        <h2 class="menuTitle" onclick="menuShow('menuSec')" id="menuSec_t"><b></b>空間管理</h2>
        <ul id="menuSec">
        	<li class="icon mtypes"><a href="../member/mtypes.php"><b></b>分類管理</a></li>
        	<li class="icon flink"><a href="../member/flink_main.php"><b></b>書籤管理</a></li>
        	<li class="icon info"><a href="../member/edit_space_info.php"><b></b>空間設置</a></li>
        	<li class="icon spaceskin"><a href="../member/spaceskin.php"><b></b>風格選擇</a></li>
        </ul>
        
        <?php
      }
      ?>
        <!--<h2 class="menuTitle"><b class="showMenu"></b>操作主菜單項</h2> -->
      </div>
      <div class="buttomGr"></div>
    </div>
    <?php
    }
    ?>
    <!--左側操作菜單項 -->