Esempio n. 1
0
function DoPostInfoVar($add)
{
    global $class_r;
    //组合标题属性
    $add[titlecolor] = RepPhpAspJspcodeText($add[titlecolor]);
    $add['my_titlefont'] = TitleFont($add[titlefont], $add[titlecolor]);
    //组合专题ID
    $add['my_ztid'] = ZtId($add[ztid]);
    //其它变量
    $add[keyboard] = RepPhpAspJspcodeText(DoReplaceQjDh($add[keyboard]));
    $add[titleurl] = RepPhpAspJspcodeText($add[titleurl]);
    $add[checked] = (int) $add[checked];
    $add[istop] = (int) $add[istop];
    $add[dokey] = (int) $add[dokey];
    $add[isgood] = (int) $add[isgood];
    $add[groupid] = (int) $add[groupid];
    $add[newstempid] = (int) $add[newstempid];
    $add[firsttitle] = (int) $add[firsttitle];
    $add[userfen] = (int) $add[userfen];
    $add[closepl] = (int) $add[closepl];
    $add[ttid] = (int) $add[ttid];
    $add[onclick] = (int) $add[onclick];
    $add[totaldown] = (int) $add[totaldown];
    $add[infotags] = RepPhpAspJspcodeText(DoReplaceQjDh($add[infotags]));
    $add[ispic] = $add[titlepic] ? 1 : 0;
    $add[filename] = RepFilenameQz($add[filename], 1);
    $add[newspath] = RepFilenameQz($add[newspath], 1);
    return $add;
}
function EditInfoClass($bclassid, $newsclassid, $add, $ztid, $userid, $username)
{
    global $empire, $class_r, $dbtbpre;
    if (!$add[classid] || !$add[classname]) {
        printerror("EmptyInfoTitleSuccess", "history.go(-1)");
    }
    //操作权限
    CheckLevel($userid, $username, $classid, "cj");
    //父节点与原节点一样
    if ($add[classid] == $bclassid) {
        printerror("OldInfoidNotSingle", "history.go(-1)");
    }
    //选择栏目
    if ($newsclassid) {
        if (!$class_r[$newsclassid][islast]) {
            printerror("CjClassidMustLast", "history.go(-1)");
        }
        //返回采集页面地址
        $add[infourl] = ReturnInfoUrl($add);
        //取得采集字段
        $mr = $empire->fetch1("select cj,tid,tbname from {$dbtbpre}enewsmod where mid='" . $class_r[$newsclassid][modid] . "'");
    }
    //组合专题id
    $newsztid = ZtId($ztid);
    if (empty($add[startday])) {
        $add[startday] = date("Y-m-d");
    }
    if (empty($add[endday])) {
        $add[endday] = "2099-12-31";
    }
    if (empty($add[relistnum])) {
        $add[relistnum] = 1;
    }
    if (empty($add[renum])) {
        $add[renum] = 2;
    }
    if (empty($add[insertnum])) {
        $add[insertnum] = 10;
    }
    //处理变量
    $add[classid] = (int) $add[classid];
    $bclassid = (int) $bclassid;
    $newsclassid = (int) $newsclassid;
    $add[num] = (int) $add[num];
    $add[copyimg] = (int) $add[copyimg];
    $add[renum] = (int) $add[renum];
    $add[titlelen] = (int) $add[titlelen];
    $add[retitlewriter] = (int) $add[retitlewriter];
    $add[smalltextlen] = (int) $add[smalltextlen];
    $add[relistnum] = (int) $add[relistnum];
    $add[keynum] = (int) $add[keynum];
    $add[insertnum] = (int) $add[insertnum];
    $add[copyflash] = (int) $add[copyflash];
    $mr[tid] = (int) $mr[tid];
    $add[pagetype] = (int) $add[pagetype];
    $add[mark] = (int) $add[mark];
    $add[enpagecode] = (int) $add[enpagecode];
    $add[recjtheurl] = (int) $add[recjtheurl];
    $add[hiddenload] = (int) $add[hiddenload];
    $add[justloadin] = (int) $add[justloadin];
    $add[justloadcheck] = (int) $add[justloadcheck];
    $add[delloadinfo] = (int) $add[delloadinfo];
    $add[getfirstpic] = (int) $add[getfirstpic];
    $add[getfirstspic] = (int) $add[getfirstspic];
    $add[getfirstspicw] = (int) $add[getfirstspicw];
    $add[getfirstspich] = (int) $add[getfirstspich];
    $add[doaddtextpage] = (int) $add[doaddtextpage];
    $add[infourlispage] = (int) $add[infourlispage];
    $keeptime = (int) $add['keeptime'];
    $newstextisnull = (int) $add['newstextisnull'];
    //主表
    $sql = $empire->query("update {$dbtbpre}enewsinfoclass set bclassid={$bclassid},classname='" . addslashes($add[classname]) . "',infourl='" . addslashes($add[infourl]) . "',newsclassid={$newsclassid},startday='{$add['startday']}',endday='{$add['endday']}',bz='" . addslashes($add[bz]) . "',num={$add['num']},copyimg={$add['copyimg']},renum={$add['renum']},keyboard='" . addslashes($add[keyboard]) . "',oldword='" . addslashes($add[oldword]) . "',newword='" . addslashes($add[newword]) . "',titlelen={$add['titlelen']},retitlewriter={$add['retitlewriter']},smalltextlen={$add['smalltextlen']},zz_smallurl='" . addslashes($add[zz_smallurl]) . "',zz_newsurl='" . addslashes($add[zz_newsurl]) . "',httpurl='" . addslashes($add[httpurl]) . "',repad='" . addslashes($add[repad]) . "',imgurl='" . addslashes($add[imgurl]) . "',relistnum={$add['relistnum']},zz_titlepicl='" . addslashes($add[zz_titlepicl]) . "',z_titlepicl='" . addslashes($add[z_titlepicl]) . "',qz_titlepicl='" . addslashes($add[qz_titlepicl]) . "',save_titlepicl='{$add['save_titlepicl']}',keynum={$add['keynum']},insertnum={$add['insertnum']},copyflash={$add['copyflash']},tid={$mr['tid']},tbname='{$mr['tbname']}',pagetype={$add['pagetype']},smallpagezz='" . addslashes($add[smallpagezz]) . "',pagezz='" . addslashes($add[pagezz]) . "',smallpageallzz='" . addslashes($add[smallpageallzz]) . "',pageallzz='" . addslashes($add[pageallzz]) . "',mark={$add['mark']},enpagecode={$add['enpagecode']},recjtheurl={$add['recjtheurl']},hiddenload={$add['hiddenload']},justloadin={$add['justloadin']},justloadcheck={$add['justloadcheck']},delloadinfo={$add['delloadinfo']},pagerepad='" . addslashes($add[pagerepad]) . "',newsztid='{$newsztid}',getfirstpic={$add['getfirstpic']},oldpagerep='" . addslashes($add[oldpagerep]) . "',newpagerep='" . addslashes($add[newpagerep]) . "',keeptime='{$keeptime}',newstextisnull={$newstextisnull},getfirstspic={$add['getfirstspic']},getfirstspicw={$add['getfirstspicw']},getfirstspich={$add['getfirstspich']},doaddtextpage={$add['doaddtextpage']},infourlispage={$add['infourlispage']} where classid='{$add['classid']}'");
    if ($newsclassid) {
        //是否已有记录
        $havenum = $empire->num("select count(*) as total from {$dbtbpre}ecms_infoclass_" . $mr[tbname] . " where classid='{$add['classid']}' limit 1");
        //原本是父栏目
        if (empty($add[oldnewsclassid]) && !$havenum) {
            $ret_r = ReturnAddCj($add, $mr[cj], 0);
            //写入副表
            $usql = $empire->query("insert into {$dbtbpre}ecms_infoclass_" . $mr[tbname] . "(classid" . $ret_r[0] . ") values({$add['classid']}" . $ret_r[1] . ");");
        } else {
            $ret_r = ReturnAddCj($add, $mr[cj], 1);
            //副表
            $usql = $empire->query("update {$dbtbpre}ecms_infoclass_" . $mr[tbname] . " set classid='{$add['classid']}'" . $ret_r[0] . " where classid='{$add['classid']}'");
        }
    }
    //来源
    if ($_POST['from']) {
        $returnurl = "ListPageInfoClass.php";
    } else {
        $returnurl = "ListInfoClass.php";
    }
    if ($sql) {
        //操作日志
        insert_dolog("classid=" . $add[classid] . "<br>classname=" . $add[classname]);
        printerror("EditInfoClassSuccess", $returnurl);
    } else {
        printerror("DbError", "history.go(-1)");
    }
}