$tl = new TypeLink($cid); $cInfos = $tl->dsql->GetOne("Select arcsta,issend,issystem,usertype,typename,addtable From `#@__channeltype` where id='{$channelid}'; "); if (!is_array($cInfos)) { ShowMsg('模型不存在', '-1'); exit; } $arcsta = $cInfos['arcsta']; //禁止访问无权限的模型 if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) { ShowMsg('你无权限访问该部分', '-1'); exit; } if ($cid == 0) { $positionname = $cInfos['typename'] . " >> "; } else { $positionname = str_replace($cfg_list_symbol, " >> ", $tl->GetPositionName()) . " >> "; } $whereSql = " where arc.channel = '{$channelid}' And arc.mid='{$mid}' "; if ($keyword != '') { $keyword = cn_substr(trim(ereg_replace("[><\\|\"\r\n\t%\\*\\.\\?\\(\\)\$ ;,'%-]", "", stripslashes($keyword))), 30); $keyword = addslashes($keyword); $whereSql .= " And (arc.title like '%{$keyword}%') "; } if ($cid != 0) { $whereSql .= " And arc.typeid in (" . GetSonIds($cid) . ")"; } $query = "select arc.aid,arc.aid as id,arc.typeid,arc.senddate,arc.channel,arc.click,arc.title,arc.mid,tp.typename\r\n from `{$cInfos['addtable']}` arc\r\n left join `#@__arctype` tp on tp.id=arc.typeid\r\n {$whereSql}\r\n order by arc.aid desc "; $dlist = new DataListCP(); $dlist->pageSize = 20; $dlist->SetParameter("dopost", "listArchives"); $dlist->SetParameter("keyword", $keyword);