function CheckCatalog($cid, $msg)
{
    global $cfg_admin_channel, $admin_catalogs;
    if ($cfg_admin_channel == 'all' || TestAdmin()) {
        return true;
    }
    if (!in_array($cid, $admin_catalogs)) {
        ShowMsg(" {$msg} <br/><br/><a href='javascript:history.go(-1);'>点击此返回上一页&gt;&gt;</a>", 'javascript:;');
        exit;
    }
    return true;
}
	function LogicGetOptionArray($ID,$step,$channeltype,$dsql,$testpur=true)
	{
		global $OptionArrayList,$channels,$adminCats,$suserCatalog;
		$dsql->SetQuery("Select ID,typename,ispart,channeltype From #@__arctype where reID='".$ID."' And ispart<2 order by sortrank asc");
		$dsql->Execute($ID);
		while($row=$dsql->GetObject($ID))
		{
       if($suserCatalog!=-1 && $testpur && !TestAdmin() && !in_array($row->ID,$adminCats)) continue;
       if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>$step".$row->typename."(封面频道)</option>\r\n";
       else if($row->ispart==2) $OptionArrayList .="";
       else if($row->channeltype!=$channeltype) $OptionArrayList .="";
       else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>$step".$row->typename."</option>\r\n";
       LogicGetOptionArray($row->ID,$step."─",$channeltype,$dsql,false);
    }
	}
function CheckCatalogTest($cid,$uc=''){
	if(empty($uc)) $uc = $GLOBALS['cuserLogin']->getUserChannel();
	if(empty($uc)||$uc==-1||TestAdmin()) return true;
	if(!in_array($cid,MyCatalogs())) return false;
  else return true;
}