GetOne("SELECT addcon FROM #@__channeltype WHERE id='$channelid'"); } else { //根据栏目调用发布表单 $row = $dsql->GetOne("SELECT ch.addcon FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$cid' "); } $gurl = $row["addcon"]; if ($gurl == "") { ShowMsg("对不起,您指的栏目可能有误", "catalog_main.php"); exit(); } //跳转并传递参数 header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); exit(); } /*-------------------------- //管理文档 function listArchives(); ---------------------------*/ else if ($dopost == "listArchives") { if (!empty($gurl)) { if (empty($arcrank)) { $arcrank = ''; } $gurl = str_replace('..', '', $gurl); header("location:{$gurl}?arcrank={$arcrank}&cid={$cid}"); exit(); } if ($cid > 0) { $row = $dsql->GetOne("SELECT #@__arctype.typename,#@__channeltype.typename AS channelname,#@__channeltype.id,#@__channeltype.mancon FROM #@__arctype LEFT JOIN #@__channeltype on #@__channeltype.id=#@__arctype.channeltype WHERE #@__arctype.id='$cid'"); $gurl = $row["mancon"]; $channelid = $row["id"]; $typename = $row["typename"]; $channelname = $row["channelname"]; if ($gurl == "") { ShowMsg("对不起,您指的栏目可能有误", "catalog_main.php"); exit(); } } else if ($channelid > 0) { $row = $dsql->GetOne("SELECT typename,id,mancon FROM #@__channeltype WHERE id='$channelid'"); $gurl = $row["mancon"]; $channelid = $row["id"]; $typename = ""; $channelname = $row["typename"]; } if (empty($gurl)) $gurl = 'content_list.php'; header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); exit(); } /*-------------------------- //浏览通用模板目录 function viewTempletDir(); ---------------------------*/ else if ($dopost == "viewTemplet") { header("location:tpl.php?path=/".$cfg_df_style); exit(); } /*------------------------ 浏览单个页面的栏目 function ViewSgPage() ------------------------*/ else if ($dopost == "viewSgPage") { require_once(DEDEINC."/arc.listview.class.php"); $lv = new ListView($cid); $pageurl = $lv->MakeHtml(); ShowMsg("更新缓冲,请稍后", $pageurl); exit(); } /*------------------------ 修改栏目排列顺序 function upRank() ------------------------*/ else if ($dopost == "upRank") { //检查权限许可 CheckPurview('t_Edit,t_AccEdit'); //检查栏目操作许可 CheckCatalog($cid, "您无权修改本栏目"); $row = $dsql->GetOne("SELECT reid,sortrank FROM #@__arctype WHERE id='$cid'"); $reid = $row['reid']; $sortrank = $row['sortrank']; $row = $dsql->GetOne("SELECT sortrank FROM #@__arctype WHERE sortrank<=$sortrank AND reid=$reid ORDER BY sortrank DESC "); if (is_array($row)) { $sortrank = $row['sortrank'] - 1; $dsql->ExecuteNoneQuery("UPDATE #@__arctype SET sortrank='$sortrank' WHERE id='$cid'"); } UpDateCatCache(); ShowMsg("操作成功,返回目录", "catalog_main.php"); exit(); } else if ($dopost == "upRankAll") { //检查权限许可 CheckPurview('t_Edit'); $row = $dsql->GetOne("SELECT id FROM #@__arctype ORDER BY id DESC"); if (is_array($row)) { $maxID = $row['id']; for ($i = 1; $i <= $maxID; $i++) { if (isset(${'sortrank'.$i})) { $dsql->ExecuteNoneQuery("UPDATE #@__arctype SET sortrank='".(${'sortrank'.$i})."' WHERE id='{$i}';"); } } } UpDateCatCache(); ShowMsg("操作成功,正在返回", "catalog_main.php"); exit(); } /*-------------------------- //更新栏目缓存 function UpCatlogCache(); ---------------------------*/ else if ($dopost == "upcatcache") { UpDateCatCache(); $sql = " TRUNCATE TABLE `#@__arctiny`"; $dsql->ExecuteNoneQuery($sql); //导入普通模型微数据 $sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `#@__archives` "; $dsql->ExecuteNoneQuery($sql); //导入单表模型微数据 $dsql->SetQuery("SELECT id,addtable FROM `#@__channeltype` WHERE id < -1 "); $dsql->Execute(); $doarray = array(); while ($row = $dsql->GetArray()) { $tb = str_replace('#@__', $cfg_dbprefix, $row['addtable']); if (empty($tb) || isset($doarray[$tb])) { continue; } else { $sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb` "; $rs = $dsql->executenonequery($sql); $doarray[$tb] = 1; } } ShowMsg("操作成功,正在返回", "catalog_main.php"); exit(); } /*--------------------- 获取JS文件 function GetJs ----------------------*/ else if ($dopost == "GetJs") { header("location:makehtml_js.php"); exit(); } /*----------- 获得子类的内容 function GetSunListsMenu(); -----------*/ else if ($dopost == "GetSunListsMenu") { $userChannel = $cuserLogin->getUserChannel(); require_once(DEDEINC."/typeunit.class.menu.php"); AjaxHead(); PutCookie('lastCidMenu', $cid, 3600 * 24, "/"); $tu = new TypeUnit($userChannel); $tu->LogicListAllSunType($cid, " "); } /*----------- 获得子类的内容 function GetSunLists(); -----------*/ else if ($dopost == "GetSunLists") { require_once(DEDEINC."/typeunit.class.admin.php"); AjaxHead(); PutCookie('lastCid', $cid, 3600 * 24, "/"); $tu = new TypeUnit(); $tu->dsql = $dsql; echo "