コード例 #1
0
function SpInfoReBak($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $spid = (int) $add[spid];
    $sid = (int) $add[sid];
    $bid = (int) $add[bid];
    if (!$spid || !$sid || !$bid) {
        printerror('ErrorUrl', '');
    }
    //验证
    $spr = CheckSpInfoLevel($spid);
    if ($spr['sptype'] != 3) {
        printerror('ErrorUrl', '');
    }
    $br = $empire->fetch1("select bid,sptext from {$dbtbpre}enewssp_3_bak where bid='{$bid}' and sid='{$sid}' and spid='{$spid}'");
    if (!$br['bid']) {
        printerror('ErrorUrl', '');
    }
    $sql = $empire->query("update {$dbtbpre}enewssp_3 set sptext='" . StripAddsData($br[sptext]) . "' where sid='{$sid}'");
    if ($sql) {
        //操作日志
        insert_dolog("spid=" . $spid . "&spname=" . $spr[spname] . "<br>sid={$sid}&bid={$bid}");
        echo "<script>opener.ReSpInfoBak();window.close();</script>";
        exit;
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
コード例 #2
0
function ReturnAddF($add, $modid, $userid, $username, $do = 0, $rdata = 0, $ch = 0)
{
    global $empire, $public_r, $dbtbpre, $emod_r;
    if ($do == 0 || $do == 1) {
        //导入gd处理文件
        if ($add['mark'] || $add['getfirsttitlespic'] || $add['mcreatespic']) {
            include_once ECMS_PATH . 'e/class/gd.php';
        }
    }
    $ret_r['tb'] = $emod_r[$modid]['deftb'];
    $r = explode(',', $emod_r[$modid][enter]);
    $count = count($r) - 1;
    if (empty($do)) {
        //数据库操作
        for ($i = 1; $i < $count; $i++) {
            $f = $r[$i];
            if ($f == 'special.field' || !strstr($emod_r[$modid]['canaddf'], ',' . $f . ',')) {
                continue;
            }
            $add[$f] = ReturnCheckboxAddF($add[$f], $modid, $f);
            //复选框
            $value = RepPhpAspJspcodeText($add[$f]);
            if ($f == 'newstime') {
                $value = empty($value) ? time() : to_time($value);
            } elseif ($f == "morepic") {
                $value = ReturnMorepicpath($add['msmallpic'], $add['mbigpic'], $add['mpicname'], $add['mdelpicid'], $add['mpicid'], $add, $add['mpicurl_qz'], 0);
            } elseif ($f == "downpath") {
                $value = ReturnDownpath($add['downname'], $add['downpath'], $add['delpathid'], $add['pathid'], $add['downuser'], $add['fen'], $add['thedownqz'], $add, $add['foruser'], $add['downurl_qz'], 0);
            } elseif ($f == "onlinepath") {
                $value = ReturnDownpath($add['odownname'], $add['odownpath'], $add['odelpathid'], $add['opathid'], $add['odownuser'], $add['ofen'], $add['othedownqz'], $add, $add['oforuser'], $add['onlineurl_qz'], 0);
            } elseif ($f == "smalltext") {
                if (!trim($value)) {
                    $value = SubSmalltextVal($add[newstext], $public_r[smalltextlen]);
                    //截取新闻内容
                }
            } elseif ($f == 'infoip') {
                $value = egetip();
            } elseif ($f == 'infozm') {
                $value = $value ? $value : GetInfoZm($add[title]);
            }
            //处理函数
            $value = DoFFun($modid, $f, $value, 1, 0);
            //检测必填字段
            if ($ch == 1 && empty($add['titleurl'])) {
                ChMustAddF($modid, $f, $value);
                ChIsOnlyAddF($modid, 0, $f, $value, 0);
                //唯一值
            }
            //编辑器
            if ($f == "newstext") {
                //远程保存
                $value = addslashes(CopyImg(stripSlashes($value), $add[copyimg], $add[copyflash], $add[classid], $add[qz_url], $username, $add['id'], $add['filepass'], $add['mark']));
                //替换关键字和字符
                $value = DoReplaceKeyAndWord($value, $add['dokey']);
                //自动分页
                if ($add[autopage] && !strstr($value, "[!--empirenews.page--]")) {
                    if (empty($add[autosize])) {
                        $add[autosize] = 5000;
                    }
                    $value = AutoDoPage($value, $add[autosize]);
                }
            }
            //存文本
            if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) {
                //建立目录
                $thetxtfile = GetFileMd5();
                $truevalue = MkDirTxtFile(date("Y/md"), $thetxtfile);
                //写放文件
                EditTxtFieldText($truevalue, $value);
                $value = $truevalue;
            }
            if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) {
                $ret_r['datafields'] .= "," . $f;
                $ret_r['datavalues'] .= ",'" . addslashes($value) . "'";
            } else {
                $ret_r['fields'] .= "," . $f;
                $ret_r['values'] .= ",'" . addslashes($value) . "'";
            }
        }
    } elseif ($do == 1) {
        //数据库操作
        for ($i = 1; $i < $count; $i++) {
            $f = $r[$i];
            if ($f == "special.field" || !strstr($emod_r[$modid]['caneditf'], ',' . $f . ',')) {
                continue;
            }
            $add[$f] = ReturnCheckboxAddF($add[$f], $modid, $f);
            //复选框
            $value = RepPhpAspJspcodeText($add[$f]);
            if ($f == 'newstime') {
                $value = empty($value) ? time() : to_time($value);
            } elseif ($f == "morepic") {
                $value = ReturnMorepicpath($add['msmallpic'], $add['mbigpic'], $add['mpicname'], $add['mdelpicid'], $add['mpicid'], $add, $add['mpicurl_qz'], 1);
            } elseif ($f == "downpath") {
                $value = ReturnDownpath($add['downname'], $add['downpath'], $add['delpathid'], $add['pathid'], $add['downuser'], $add['fen'], $add['thedownqz'], $add, $add['foruser'], $add['downurl_qz'], 1);
            } elseif ($f == "onlinepath") {
                $value = ReturnDownpath($add['odownname'], $add['odownpath'], $add['odelpathid'], $add['opathid'], $add['odownuser'], $add['ofen'], $add['othedownqz'], $add, $add['oforuser'], $add['onlineurl_qz'], 1);
            } elseif ($f == "smalltext") {
                if (!trim($value)) {
                    $value = SubSmalltextVal($add[newstext], $public_r[smalltextlen]);
                    //截取新闻内容
                }
            } elseif ($f == 'infozm') {
                $value = $value ? $value : GetInfoZm($add[title]);
            }
            //处理函数
            $value = DoFFun($modid, $f, $value, 0, 0);
            //检测必填字段
            if ($ch == 1 && empty($add['titleurl'])) {
                ChMustAddF($modid, $f, $value);
                ChIsOnlyAddF($modid, $add[id], $f, $value, 0);
                //唯一值
            }
            //数据同步
            SameDataAddF($add[id], $add[classid], $modid, $f, $value);
            //内容
            if ($f == "newstext") {
                //远程保存
                $value = addslashes(CopyImg(stripSlashes($value), $add[copyimg], $add[copyflash], $add[classid], $add[qz_url], $username, $add['id'], $add['filepass'], $add['mark']));
                //自动分页
                if ($add[autopage] && !strstr($value, "[!--empirenews.page--]")) {
                    if (empty($add[autosize])) {
                        $add[autosize] = 5000;
                    }
                    $value = AutoDoPage($value, $add[autosize]);
                }
            }
            //存文本
            if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) {
                //建立目录
                $newstexttxt_r = explode("/", $add[newstext_url]);
                $thetxtfile = $newstexttxt_r[2];
                $truevalue = MkDirTxtFile($newstexttxt_r[0] . "/" . $newstexttxt_r[1], $thetxtfile);
                //写放文件
                EditTxtFieldText($truevalue, $value);
                $value = $truevalue;
            }
            if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) {
                $ret_r['datafields'] .= "," . $f;
                $ret_r['datavalues'] .= "," . $f . "='" . addslashes($value) . "'";
            } else {
                $ret_r['fields'] .= "," . $f;
                $ret_r['values'] .= "," . $f . "='" . addslashes($value) . "'";
            }
        }
    } elseif ($do == 8) {
        //数据库操作
        for ($i = 1; $i < $count; $i++) {
            $f = $r[$i];
            if ($f == 'special.field') {
                continue;
            }
            $value = $add[$f];
            //存文本
            if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) {
                //建立目录
                $newstexttxt_r = explode("/", $add[newstext_url]);
                $thetxtfile = $newstexttxt_r[2];
                $truevalue = MkDirTxtFile($newstexttxt_r[0] . "/" . $newstexttxt_r[1], $thetxtfile);
                //写放文件
                EditTxtFieldText($truevalue, $value);
                $value = $truevalue;
            }
            if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) {
                $ret_r['datafields'] .= "," . $f;
                $ret_r['datavalues'] .= "," . $f . "='" . StripAddsData($value) . "'";
            } else {
                $ret_r['fields'] .= "," . $f;
                $ret_r['values'] .= "," . $f . "='" . StripAddsData($value) . "'";
            }
        }
    } elseif ($do == 9) {
        //数据库操作
        for ($i = 1; $i < $count; $i++) {
            $f = $r[$i];
            if ($f == 'special.field') {
                continue;
            }
            $value = $add[$f];
            //存文本
            if ($emod_r[$modid]['savetxtf'] && $f == $emod_r[$modid]['savetxtf']) {
                //建立目录
                $thetxtfile = GetFileMd5();
                $truevalue = MkDirTxtFile(date("Y/md"), $thetxtfile);
                //写放文件
                EditTxtFieldText($truevalue, $value);
                $value = $truevalue;
            }
            if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) {
                $ret_r['datafields'] .= "," . $f;
                $ret_r['datavalues'] .= ",'" . StripAddsData($value) . "'";
            } else {
                $ret_r['fields'] .= "," . $f;
                $ret_r['values'] .= ",'" . StripAddsData($value) . "'";
            }
        }
    } elseif ($do == 10) {
        //数据库操作
        for ($i = 1; $i < $count; $i++) {
            $f = $r[$i];
            if ($f == 'special.field') {
                continue;
            }
            $value = $add[$f];
            if (strstr($emod_r[$modid]['tbdataf'], ',' . $f . ',')) {
                $ret_r['datafields'] .= "," . $f;
                $ret_r['datavalues'] .= ",'" . StripAddsData($value) . "'";
            } else {
                $ret_r['fields'] .= "," . $f;
                $ret_r['values'] .= ",'" . StripAddsData($value) . "'";
            }
        }
    }
    return $ret_r;
}
コード例 #3
0
ファイル: hinfofun.php プロジェクト: novnan/meiju
function DoDocInfo($tb, $r, $ecms = 0)
{
    global $empire, $dbtbpre, $class_r, $emod_r;
    if ($ecms == 1) {
        $table = $dbtbpre . 'ecms_' . $tb . '_doc_index';
        //索引表
        $table1 = $dbtbpre . 'ecms_' . $tb . '_doc';
        //主表
        $table2 = $dbtbpre . 'ecms_' . $tb . '_doc_data';
        //副表
        $ytable = $dbtbpre . 'ecms_' . $tb . '_index';
        //目标索引表
        $ytable1 = $dbtbpre . 'ecms_' . $tb;
        //目标主表
        $ytable2 = $dbtbpre . 'ecms_' . $tb . '_data_' . $r[stb];
        //目标副表
    } else {
        $table = $dbtbpre . 'ecms_' . $tb . '_index';
        //索引表
        $table1 = $dbtbpre . 'ecms_' . $tb;
        //主表
        $table2 = $dbtbpre . 'ecms_' . $tb . '_data_' . $r[stb];
        //副表
        $ytable = $dbtbpre . 'ecms_' . $tb . '_doc_index';
        //目标索引表
        $ytable1 = $dbtbpre . 'ecms_' . $tb . '_doc';
        //目标主表
        $ytable2 = $dbtbpre . 'ecms_' . $tb . '_doc_data';
        //目标副表
    }
    $mid = $class_r[$r[classid]][modid];
    //索引表
    $index_r = $empire->fetch1("select * from " . $table . " where id='{$r['id']}' limit 1");
    if ($index_r['checked'] == 0) {
        return '';
    }
    //副表
    $fr = $empire->fetch1("select " . ReturnSqlFtextF($mid) . " from " . $table2 . " where id='{$r['id']}' limit 1");
    $r = array_merge($r, $fr);
    $ret_r = ReturnAddF($r, $mid, $userid, $username, 10, 0, 0);
    //返回自定义字段
    //索引表
    $empire->query("insert into " . $ytable . "(id,classid,checked,newstime,truetime,lastdotime,havehtml) values('{$index_r['id']}','{$index_r['classid']}','{$index_r['checked']}','{$index_r['newstime']}','{$index_r['truetime']}','{$index_r['lastdotime']}','{$index_r['havehtml']}');");
    //主表
    $empire->query("replace into " . $ytable1 . "(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard" . $ret_r[fields] . ") values('{$r['id']}','{$r['classid']}','{$r['ttid']}','{$r['onclick']}','{$r['plnum']}','{$r['totaldown']}','" . StripAddsData($r[newspath]) . "','" . StripAddsData($r[filename]) . "','{$r['userid']}','" . StripAddsData($r[username]) . "','{$r['firsttitle']}','{$r['isgood']}','{$r['ispic']}','{$r['istop']}','{$r['isqf']}','{$r['ismember']}','{$r['isurl']}','{$r['truetime']}','{$r['lastdotime']}','{$r['havehtml']}','{$r['groupid']}','{$r['userfen']}','" . StripAddsData($r[titlefont]) . "','" . StripAddsData($r[titleurl]) . "','{$r['stb']}','{$r['fstb']}','{$r['restb']}','" . StripAddsData($r[keyboard]) . "'" . $ret_r[values] . ");");
    //副表
    $empire->query("replace into " . $ytable2 . "(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags" . $ret_r[datafields] . ") values('{$r['id']}','{$r['classid']}','{$r['keyid']}','{$r['dokey']}','{$r['newstempid']}','{$r['closepl']}','{$r['haveaddfen']}','" . StripAddsData($r[infotags]) . "'" . $ret_r[datavalues] . ");");
    //删除
    $empire->query("delete from " . $table . " where id='{$r['id']}'");
    $empire->query("delete from " . $table1 . " where id='{$r['id']}'");
    $empire->query("delete from " . $table2 . " where id='{$r['id']}'");
    //更新栏目信息数
    if ($ecms == 1) {
        AddClassInfos($r['classid'], '+1', '+1');
    } else {
        AddClassInfos($r['classid'], '-1', '-1');
    }
}
コード例 #4
0
function ChangeDocDataTableF($add, $userid, $username)
{
    global $empire, $dbtbpre, $public_r, $fun_r;
    //验证权限
    CheckLevel($userid, $username, $classid, "f");
    $fid = (int) $add[fid];
    $tid = (int) $add[tid];
    $tbname = RepPostVar($add[tbname]);
    $line = (int) $add[line];
    $start = (int) $add[start];
    if (!$fid || !$tid || !$tbname) {
        printerror("ErrorUrl", "history.go(-1)");
    }
    if (empty($line)) {
        $line = 200;
    }
    $fr = $empire->fetch1("select * from {$dbtbpre}enewsf where fid='{$fid}'");
    if (!$fr[fid]) {
        printerror("ErrorUrl", "history.go(-1)");
    }
    if (empty($fr[isadd])) {
        printerror("NotIsAdd", "history.go(-1)");
    }
    $tid = $fr[tid];
    $tbname = $fr[tbname];
    $f = $fr[f];
    $selectf = '';
    if (empty($fr[tbdataf])) {
        $selectf = ',' . $fr[f];
    }
    $b = 0;
    $sql = $empire->query("select id,stb" . $selectf . " from {$dbtbpre}ecms_" . $tbname . "_doc where id>{$start} order by id limit " . $line);
    while ($r = $empire->fetch($sql)) {
        $b = 1;
        $newstart = $r['id'];
        if ($fr[tbdataf]) {
            $finfor = $empire->fetch1("select " . $f . " from {$dbtbpre}ecms_" . $tbname . "_doc_data where id='{$r['id']}'");
            $value = $finfor[$f];
            $empire->query("update {$dbtbpre}ecms_" . $tbname . "_doc set " . $f . "='" . StripAddsData($value) . "' where id='{$r['id']}'");
        } else {
            $value = $r[$f];
            $empire->query("update {$dbtbpre}ecms_" . $tbname . "_doc_data set " . $f . "='" . StripAddsData($value) . "' where id='{$r['id']}'");
        }
    }
    if (empty($b)) {
        //删除字段
        if ($fr[tbdataf]) {
            $tbr = $empire->fetch1("select datatbs from {$dbtbpre}enewstable where tid='{$tid}'");
            if ($tbr['datatbs']) {
                $dtbr = explode(',', $tbr['datatbs']);
                $count = count($dtbr);
                for ($i = 1; $i < $count - 1; $i++) {
                    $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_data_" . $dtbr[$i] . " drop COLUMN " . $fr[f]);
                }
            }
            //归档副表
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc_data drop COLUMN " . $fr[f]);
        } else {
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . " drop COLUMN " . $fr[f]);
            $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc drop COLUMN " . $fr[f]);
        }
        $newtbdataf = $fr[tbdataf] ? 0 : 1;
        $empire->query("update {$dbtbpre}enewsf set tbdataf='{$newtbdataf}' where fid='{$fid}'");
        //删除模型中字段项
        if (empty($tbr['datatbs'])) {
            $record = "<!--record-->";
            $field = "<!--field--->";
            $like = $field . $fr[f] . $record;
            $slike = "," . $fr[f] . ",";
            $dsql = $empire->query("select mid,searchvar,listandf,listtempvar,orderf from {$dbtbpre}enewsmod where tid='{$tid}' and (searchvar like '%" . $slike . "%' or listtempvar like '%" . $like . "%' or listandf like '%" . $slike . "%' or orderf like '%" . $slike . "%')");
            while ($r = $empire->fetch($dsql)) {
                $listtempvar = "";
                $searchvar = "";
                $listandf = "";
                $orderf = "";
                $re = "";
                $re1 = "";
                $and = "";
                $dh = "";
                //列表模板变量
                if (strstr($r[listtempvar], $like)) {
                    $re1 = explode($record, $r[listtempvar]);
                    for ($i = 0; $i < count($re1) - 1; $i++) {
                        if (strstr($re1[$i] . $record, $like)) {
                            continue;
                        }
                        $listtempvar .= $re1[$i] . $record;
                    }
                    $and .= $dh . "listtempvar='{$listtempvar}'";
                }
                $dh = "";
                //搜索变量
                if (strstr($r[searchvar], $slike)) {
                    if (!empty($and)) {
                        $dh = ",";
                    }
                    $searchvar = str_replace($slike, ",", $r[searchvar]);
                    $and .= $dh . "searchvar='{$searchvar}'";
                }
                //结合项
                $dh = "";
                if (strstr($r[listandf], $slike)) {
                    if (!empty($and)) {
                        $dh = ",";
                    }
                    $listandf = str_replace($slike, ",", $r[listandf]);
                    $and .= $dh . "listandf='{$listandf}'";
                }
                //排序项
                $dh = "";
                if (strstr($r[orderf], $slike)) {
                    if (!empty($and)) {
                        $dh = ",";
                    }
                    $orderf = str_replace($slike, ",", $r[orderf]);
                    $and .= $dh . "orderf='{$orderf}'";
                }
                if ($and) {
                    $empire->query("update {$dbtbpre}enewsmod set " . $and . " where mid='{$r['mid']}'");
                }
            }
        }
        GetConfig(1);
        //更新缓存
        insert_dolog("tid={$tid}&tbname={$tbname}<br>fid={$fid}&field={$f}&tbdataf=" . $newtbdataf);
        //操作日志
        printerror("ChangeDataTableFSuccess", "db/ListF.php?tid={$tid}&tbname={$tbname}");
    }
    echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><meta http-equiv=\"refresh\" content=\"" . $public_r['realltime'] . ";url=ecmsmod.php?enews=ChangeDocDataTableF&tid={$tid}&tbname={$tbname}&fid={$fid}&line={$line}&start={$newstart}\">" . $fun_r[OneChangeDocDataTableFSuccess] . "(ID:<font color=red><b>" . $newstart . "</b></font>)";
    exit;
}
コード例 #5
0
ファイル: tempfun.php プロジェクト: novnan/meiju
function ReEBakTemp($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $bid = (int) $add['bid'];
    if (!$bid) {
        printerror("NotBakTemp", "history.go(-1)");
    }
    $r = $empire->fetch1("select * from {$dbtbpre}enewstempbak where bid='{$bid}'");
    if (!$r['bid']) {
        printerror("NotBakTemp", "history.go(-1)");
    }
    //操作权限
    if ($r['temptype'] == 'tempvar') {
        CheckLevel($userid, $username, $classid, "tempvar");
    } else {
        CheckLevel($userid, $username, $classid, "template");
    }
    $gid = (int) $r['gid'];
    if (!$gid) {
        $gid = GetDoTempGid();
    }
    if ($temptype == 'indexpage') {
        $gid = 1;
    }
    if ($r['temptype'] == 'bqtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsbqtemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',modid='{$r['modid']}',showdate='" . StripAddsData($r[showdate]) . "',listvar='" . addslashes($r[listvar]) . "',subnews='{$r['subnews']}',rownum='{$r['rownum']}',classid='{$r['classid']}',docode='{$r['docode']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'classtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsclasstemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',classid='{$r['classid']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'jstemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsjstemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',classid='{$r['classid']}',showdate='" . StripAddsData($r[showdate]) . "',modid='{$r['modid']}',subnews='{$r['subnews']}',subtitle='{$r['subtitle']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'listtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewslisttemp", $gid) . " set subnews='{$r['subnews']}',tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',listvar='" . addslashes($r[listvar]) . "',rownum='{$r['rownum']}',modid='{$r['modid']}',showdate='" . StripAddsData($r[showdate]) . "',subtitle='{$r['subtitle']}',classid='{$r['classid']}',docode='{$r['docode']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'newstemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsnewstemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',showdate='" . StripAddsData($r[showdate]) . "',modid='{$r['modid']}',classid='{$r['classid']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'pltemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspltemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'printtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsprinttemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',showdate='" . StripAddsData($r[showdate]) . "',modid='{$r['modid']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'searchtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewssearchtemp", $gid) . " set subnews='{$r['subnews']}',tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "',listvar='" . addslashes($r[listvar]) . "',rownum='{$r['rownum']}',modid='{$r['modid']}',showdate='" . StripAddsData($r[showdate]) . "',subtitle='{$r['subtitle']}',classid='{$r['classid']}',docode='{$r['docode']}' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'tempvar') {
        $sql = $empire->query("update " . GetDoTemptb("enewstempvar", $gid) . " set myvar='" . StripAddsData($r[tempname]) . "',varname='" . StripAddsData($r[listvar]) . "',varvalue='" . addslashes($r[temptext]) . "',classid='{$r['classid']}',isclose='{$r['docode']}',myorder='{$r['subnews']}' where varid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'votetemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewsvotetemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'pagetemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspagetemp", $gid) . " set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'indexpage') {
        $sql = $empire->query("update {$dbtbpre}enewsindexpage set tempname='" . StripAddsData($r[tempname]) . "',temptext='" . addslashes($r[temptext]) . "' where tempid='{$r['tempid']}'");
    } elseif ($r['temptype'] == 'pubindextemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set indextemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubcptemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set cptemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubsearchtemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set searchtemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubsearchjstemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set searchjstemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubsearchjstemp1') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set searchjstemp1='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubotherlinktemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set otherlinktemp='" . addslashes($r[temptext]) . "',otherlinktempsub='{$r['subtitle']}',otherlinktempdate='" . StripAddsData($r[showdate]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubdownsofttemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set downsofttemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubonlinemovietemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set onlinemovietemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'publistpagetemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set listpagetemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubpljstemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set pljstemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubdownpagetemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set downpagetemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubgbooktemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set gbooktemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'publoginiframe') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set loginiframe='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'publoginjstemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set loginjstemp='" . addslashes($r[temptext]) . "' limit 1");
    } elseif ($r['temptype'] == 'pubschalltemp') {
        $sql = $empire->query("update " . GetDoTemptb("enewspubtemp", $gid) . " set schalltemp='" . addslashes($r[temptext]) . "',schallsubnum='{$r['subnews']}',schalldate='" . StripAddsData($r[showdate]) . "' limit 1");
    }
    if ($sql) {
        //操作日志
        insert_dolog("bid={$bid}&temptype={$r['temptype']}<br>tempid={$r['tempid']}&tempname={$r['tempname']}&gid={$r['gid']}");
        echo "<script>opener.ReTempBak();window.close();</script>";
        exit;
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
コード例 #6
0
function DoDocInfo($tb, $r, $ecms = 0)
{
    global $empire, $dbtbpre, $class_r, $emod_r;
    if ($ecms == 1) {
        $table1 = $dbtbpre . 'ecms_' . $tb . '_doc';
        //主表
        $table2 = $dbtbpre . 'ecms_' . $tb . '_doc_data';
        //副表
        $ytable1 = $dbtbpre . 'ecms_' . $tb;
        //目标主表
        $ytable2 = $dbtbpre . 'ecms_' . $tb . '_data_' . $r[stb];
        //目标副表
    } else {
        $table1 = $dbtbpre . 'ecms_' . $tb;
        //主表
        $table2 = $dbtbpre . 'ecms_' . $tb . '_data_' . $r[stb];
        //副表
        $ytable1 = $dbtbpre . 'ecms_' . $tb . '_doc';
        //目标主表
        $ytable2 = $dbtbpre . 'ecms_' . $tb . '_doc_data';
        //目标副表
    }
    $mid = $class_r[$r[classid]][modid];
    //副表
    if ($emod_r[$mid]['tbdataf'] && $emod_r[$mid]['tbdataf'] != ',') {
        $selectdataf = substr($emod_r[$mid]['tbdataf'], 1, -1);
        $fr = $empire->fetch1("select " . $selectdataf . " from " . $table2 . " where id='{$r['id']}'");
        $r = array_merge($r, $fr);
    }
    $ret_r = ReturnAddF($r, $mid, $userid, $username, 10, 0, 0);
    //返回自定义字段
    //主表
    $empire->query("replace into " . $ytable1 . "(id,classid,onclick,newspath,keyboard,keyid,userid,username,ztid,checked,istop,truetime,ismember,dokey,userfen,isgood,titlefont,titleurl,filename,groupid,newstempid,plnum,firsttitle,isqf,totaldown,closepl,havehtml,lastdotime,haveaddfen,infopfen,infopfennum,votenum,stb,copyids,ttid,infotags,ispic" . $ret_r[fields] . ") values('{$r['id']}','{$r['classid']}','{$r['onclick']}','" . StripAddsData($r[newspath]) . "','" . StripAddsData($r[keyboard]) . "','{$r['keyid']}','{$r['userid']}','" . StripAddsData($r[username]) . "','{$r['ztid']}','{$r['checked']}','{$r['istop']}','{$r['truetime']}','{$r['ismember']}','{$r['dokey']}','{$r['userfen']}','{$r['isgood']}','" . StripAddsData($r[titlefont]) . "','" . StripAddsData($r[titleurl]) . "','" . StripAddsData($r[filename]) . "','{$r['groupid']}','{$r['newstempid']}','{$r['plnum']}','{$r['firsttitle']}','{$r['isqf']}','{$r['totaldown']}','{$r['closepl']}','{$r['havehtml']}','{$r['lastdotime']}','{$r['haveaddfen']}','{$r['infopfen']}','{$r['infopfennum']}','{$r['votenum']}','{$r['stb']}','{$r['copyids']}','{$r['ttid']}','" . StripAddsData($r[infotags]) . "','{$r['ispic']}'" . $ret_r[values] . ");");
    //副表
    $empire->query("replace into " . $ytable2 . "(id,classid" . $ret_r[datafields] . ") values('{$r['id']}','{$r['classid']}'" . $ret_r[datavalues] . ");");
    //删除
    $empire->query("delete from " . $table1 . " where id='{$r['id']}'");
    $empire->query("delete from " . $table2 . " where id='{$r['id']}'");
}