예제 #1
0
파일: classfun.php 프로젝트: novnan/meiju
function SetMoreClass($add, $userid, $username)
{
    global $empire, $dbtbpre;
    //验证权限
    CheckLevel($userid, $username, $classid, "setmclass");
    //栏目
    $classid = $add['classid'];
    $count = count($classid);
    if ($count == 0) {
        printerror("NotChangeSetClass", "");
    }
    $cids = '';
    $dh = '';
    for ($i = 0; $i < $count; $i++) {
        $cids .= $dh . intval($classid[$i]);
        $dh = ',';
    }
    $whereclass = 'classid in (' . $cids . ')';
    $seting = '';
    //基本属性
    if ($add['doclasstype']) {
        $seting .= ",classtype='{$add['classtype']}'";
    }
    if ($add['dolisttempid'] && $add[listtempid]) {
        $seting .= ",listtempid='{$add['listtempid']}'";
    }
    if ($add['dodtlisttempid']) {
        $seting .= ",dtlisttempid='{$add['dtlisttempid']}'";
    }
    if ($add['domaxnum']) {
        $seting .= ",maxnum='{$add['maxnum']}'";
    }
    if ($add['dolencord']) {
        $seting .= ",lencord='{$add['lencord']}'";
    }
    if ($add['dosearchtempid']) {
        $seting .= ",searchtempid='{$add['searchtempid']}'";
    }
    if ($add['dowapstyleid']) {
        $seting .= ",wapstyleid='{$add['wapstyleid']}'";
    }
    if ($add['dolistorder']) {
        $seting .= ",listorder='{$add['listorder']}'";
    }
    if ($add['doreorder']) {
        $seting .= ",reorder='{$add['reorder']}'";
    }
    if ($add['dolistdt']) {
        $seting .= ",listdt='{$add['listdt']}'";
    }
    if ($add['doshowdt']) {
        $seting .= ",showdt='{$add['showdt']}'";
    }
    if ($add['doshowclass']) {
        $seting .= ",showclass='{$add['showclass']}'";
    }
    if ($add['doopenadd']) {
        $seting .= ",openadd='{$add['openadd']}'";
    }
    //选项设置[大栏目]
    if ($add['doclasstempid']) {
        $seting .= ",classtempid='{$add['classtempid']}'";
    }
    if ($add['doislist']) {
        $seting .= ",islist='{$add['islist']}'";
    }
    //选项设置[终极栏目]
    if ($add['donewstempid'] && $add[newstempid]) {
        $seting .= ",newstempid='{$add['newstempid']}'";
        if ($add['tobetempinfo']) {
            $donewstemp = 1;
        }
    }
    if ($add['dopltempid']) {
        $seting .= ",pltempid='{$add['pltempid']}'";
    }
    if ($add['dolink_num']) {
        $seting .= ",link_num='{$add['link_num']}'";
    }
    if ($add['doinfopath']) {
        if ($add['infopath'] == 0) {
            $add['ipath'] = '';
        }
        $seting .= ",ipath='{$add['ipath']}'";
    }
    if ($add['donewspath']) {
        $seting .= ",newspath='{$add['newspath']}'";
    }
    if ($add['dofilename_qz']) {
        $seting .= ",filename_qz='{$add['filename_qz']}'";
    }
    if ($add['dofilename']) {
        $seting .= ",filename='{$add['filename']}'";
    }
    if ($add['dofiletype']) {
        $seting .= ",filetype='{$add['filetype']}'";
    }
    if ($add['doopenpl']) {
        $seting .= ",openpl='{$add['openpl']}'";
    }
    if ($add['docheckpl']) {
        $seting .= ",checkpl='{$add['checkpl']}'";
    }
    if ($add['doqaddshowkey']) {
        $seting .= ",qaddshowkey='{$add['qaddshowkey']}'";
    }
    if ($add['docheckqadd']) {
        $seting .= ",checkqadd='{$add['checkqadd']}'";
    }
    if ($add['doqaddgroupid']) {
        $add[qaddgroupid] = DoPostClassQAddGroupid($add[qaddgroupidck]);
        $seting .= ",qaddgroupid='{$add['qaddgroupid']}'";
    }
    if ($add['doqaddlist']) {
        $seting .= ",qaddlist='{$add['qaddlist']}'";
    }
    if ($add['doaddinfofen']) {
        $seting .= ",addinfofen='{$add['addinfofen']}'";
    }
    if ($add['doadminqinfo']) {
        $seting .= ",adminqinfo='{$add['adminqinfo']}'";
    }
    if ($add['doqeditchecked']) {
        $seting .= ",qeditchecked='{$add['qeditchecked']}'";
    }
    if ($add['doaddreinfo']) {
        $seting .= ",addreinfo='{$add['addreinfo']}'";
    }
    if ($add['dohaddlist']) {
        $seting .= ",haddlist='{$add['haddlist']}'";
    }
    if ($add['dosametitle']) {
        $seting .= ",sametitle='{$add['sametitle']}'";
    }
    if ($add['dochecked']) {
        $seting .= ",checked='{$add['checked']}'";
    }
    if ($add['dorepreinfo']) {
        $seting .= ",repreinfo='{$add['repreinfo']}'";
    }
    if ($add['dodefinfovoteid']) {
        $seting .= ",definfovoteid='{$add['definfovoteid']}'";
    }
    if ($add['dogroupid']) {
        $seting .= ",groupid='{$add['groupid']}'";
    }
    if ($add['dodoctime']) {
        $seting .= ",doctime='{$add['doctime']}'";
    }
    //特殊模型设置
    if ($add['dodown_num']) {
        $seting .= ",down_num='{$add['down_num']}'";
    }
    if ($add['doonline_num']) {
        $seting .= ",online_num='{$add['online_num']}'";
    }
    //JS调用设置
    if ($add['dojstempid']) {
        $seting .= ",jstempid='{$add['jstempid']}'";
    }
    if ($add['donewjs']) {
        $seting .= ",newline='{$add['newline']}'";
    }
    if ($add['dohotjs']) {
        $seting .= ",hotline='{$add['hotline']}'";
    }
    if ($add['dogoodjs']) {
        $seting .= ",goodline='{$add['goodline']}'";
    }
    if ($add['dohotpljs']) {
        $seting .= ",hotplline='{$add['hotplline']}'";
    }
    if ($add['dofirstjs']) {
        $seting .= ",firstline='{$add['firstline']}'";
    }
    if (empty($seting)) {
        printerror("NotChangeSetClassInfo", "");
    }
    $seting = substr($seting, 1);
    $sql = $empire->query("update {$dbtbpre}enewsclass set " . $seting . " where " . $whereclass);
    //内容模板应用于子生成的信息
    if ($donewstemp == 1) {
        $csql = $empire->query("select classid,tbname from {$dbtbpre}enewsclass where (" . $whereclass . ") and islast=1");
        while ($r = $empire->fetch($csql)) {
            UpdateAllDataTbField($r['tbname'], "newstempid='{$add['newstempid']}'", " where classid='{$r['classid']}'", 1);
        }
    }
    if ($sql) {
        GetClass();
        //操作日志
        insert_dolog("");
        printerror("SetMoreClassSuccess", "SetMoreClass.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "");
    }
}
예제 #2
0
파일: hinfofun.php 프로젝트: novnan/meiju
function MoveClassNews($add, $userid, $username)
{
    global $empire, $class_r, $dbtbpre, $emod_r;
    $add[classid] = (int) $add[classid];
    $add[toclassid] = (int) $add[toclassid];
    if (empty($add[classid]) || empty($add[toclassid])) {
        printerror("EmptyMovetoClassid", "history.go(-1)");
    }
    if ($class_r[$add[classid]][modid] != $class_r[$add[toclassid]][modid]) {
        printerror("DefModid", "history.go(-1)");
    }
    //验证权限
    CheckLevel($userid, $username, $classid, "movenews");
    //终极栏目
    if (!$class_r[$add[classid]][islast] || !$class_r[$add[toclassid]][islast]) {
        printerror("MovetoClassidMustLastid", "history.go(-1)");
    }
    if ($add[classid] == $add[toclassid]) {
        printerror("MoveClassidsame", "history.go(-1)");
    }
    $mid = $class_r[$add[classid]][modid];
    $tbname = $class_r[$add[classid]][tbname];
    //主表
    $indexsql = $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set classid={$add['toclassid']} where classid='{$add['classid']}'");
    $sql = $empire->query("update {$dbtbpre}ecms_" . $tbname . " set classid={$add['toclassid']} where classid='{$add['classid']}'");
    $empire->query("update {$dbtbpre}ecms_" . $tbname . "_check set classid={$add['toclassid']} where classid='{$add['classid']}'");
    $empire->query("update {$dbtbpre}ecms_" . $tbname . "_doc set classid={$add['toclassid']} where classid='{$add['classid']}'");
    //副表
    UpdateAllDataTbField($tbname, "classid='{$add['toclassid']}'", " where classid='{$add['classid']}'", 1, 1);
    //更新栏目信息数
    $cr = $empire->fetch1("select classid,allinfos,infos from {$dbtbpre}enewsclass where classid='{$add['classid']}'");
    AddClassInfos($add[classid], '-' . $cr[allinfos], '-' . $cr[infos]);
    $tocr = $empire->fetch1("select classid,allinfos,infos from {$dbtbpre}enewsclass where classid='{$add['toclassid']}'");
    AddClassInfos($add[toclassid], '+' . $cr[allinfos], '+' . $cr[infos]);
    //更新信息附加表与附件表
    UpdateMoreInfoOtherData($add[classid], $add[toclassid], 0, 0);
    //生成信息列表
    ListHtml($add[toclassid], $ret_r, 0);
    //移动数据
    $opath = ECMS_PATH . $class_r[$add[classid]][classpath];
    DelPath($opath);
    //删除旧的栏目目录
    $mk = DoMkdir($opath);
    if ($sql) {
        //操作日志
        insert_dolog("classid=" . $add[classid] . "&nbsp;(" . $class_r[$add[classid]][classname] . ")<br>toclassid=" . $add[toclassid] . "(" . $class_r[$add[toclassid]][classname] . ")");
        printerror("MoveClassNewsSuccess", "MoveClassNews.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}