Example #1
0
function ViewOnlineKFen($showdown_r, $u, $userid, $classid, $id, $pathid, $r)
{
    global $user_tablename, $level_r, $user_group, $user_userid, $class_r, $dbtbpre, $public_r, $user_userdate, $user_userfen, $user_username, $empire, $have_bak, $have_fen;
    if ($showdown_r[2]) {
        //下载次数限制
        $setuserday = "";
        if ($level_r[$u[$user_group]][daydown]) {
            $setuserday = DoCheckMDownNum($userid, $u[$user_group], 1);
        }
        //点数是否足够
        $showdown_r[3] = intval($showdown_r[3]);
        if ($showdown_r[3]) {
            if ($have_fen == 1) {
                //去除点数
                $usql = $empire->query("update " . $user_tablename . " set " . $user_userfen . "=" . $user_userfen . "-" . $showdown_r[3] . " where " . $user_userid . "='{$userid}'");
            }
            if ($have_bak == 0) {
                //备份下载记录
                $utfusername = doUtfAndGbk($u[$user_username], 1);
                BakDown($classid, $id, $pathid, $userid, $utfusername, $r[title], $showdown_r[3], 1);
            }
        }
        //更新用户下载次数
        if ($setuserday) {
            $usql = $empire->query($setuserday);
        }
    }
    //总下载数据增一
    $usql = $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " set totaldown=totaldown+1 where id='{$id}'");
}
function CheckShowNewsLevel($infor)
{
    global $check_path, $level_r, $empire, $user_userfen, $user_userid, $user_tablename, $user_userdate, $gotourl, $toreturnurl, $public_r, $dbtbpre, $class_r;
    $groupid = $infor['groupid'];
    $userfen = $infor['userfen'];
    $id = $infor['id'];
    $classid = $infor['classid'];
    //是否登陆
    $user_r = ViewCheckLogin($infor);
    //验证权限
    if ($class_r[$infor[classid]]['cgtoinfo']) {
        $checkcr = $empire->fetch1("select cgroupid from {$dbtbpre}enewsclass where classid='{$infor['classid']}'");
        if ($checkcr['cgroupid']) {
            if (!strstr($checkcr[cgroupid], ',' . $user_r[groupid] . ',')) {
                $infor['eclass_cgroupid'] = $checkcr[cgroupid];
                if (!getcvar('returnurl')) {
                    esetcookie("returnurl", $toreturnurl, 0);
                }
                $msg = "您没有足够权限查看此信息! <a href='{$gotourl}'><u>点击这里</u></a>重新登陆;注册请<a href='" . $public_r['newsurl'] . "e/member/register/'><u>点击这里</u></a>。";
                ShowViewInfoMsg($infor, $msg);
            }
        }
    }
    if ($groupid) {
        if ($level_r[$groupid][level] > $level_r[$user_r[groupid]][level]) {
            if (!getcvar('returnurl')) {
                esetcookie("returnurl", $toreturnurl, 0);
            }
            $msg = "您的会员级别不足(您的当前级别:" . $level_r[$user_r[groupid]][groupname] . "),没有查看此信息的权限! <a href='{$gotourl}'><u>点击这里</u></a>重新登陆;注册请<a href='" . $public_r['newsurl'] . "e/member/register/'><u>点击这里</u></a>。";
            ShowViewInfoMsg($infor, $msg);
        }
    }
    //扣点
    if (!empty($userfen)) {
        //是否有历史记录
        $bakr = $empire->fetch1("select id,truetime from {$dbtbpre}enewsdownrecord where id='{$id}' and classid='{$classid}' and userid='{$user_r['userid']}' and online=2 order by truetime desc limit 1");
        if ($bakr['id'] && time() - $bakr['truetime'] <= $public_r['redoview'] * 3600) {
        } else {
            if ($user_r[userdate] - time() > 0) {
            } else {
                if ($user_r[userfen] < $userfen) {
                    if (!getcvar('returnurl')) {
                        esetcookie("returnurl", $toreturnurl, 0);
                    }
                    $msg = "您的点数不足(您当前拥有的点数 " . $user_r[userfen] . " 点),没有查看此信息的权限! <a href='{$gotourl}'><u>点击这里</u></a>重新登陆;注册请<a href='" . $public_r['newsurl'] . "e/member/register/'><u>点击这里</u></a>。";
                    ShowViewInfoMsg($infor, $msg);
                }
                //扣点
                $usql = $empire->query("update " . $user_tablename . " set " . $user_userfen . "=" . $user_userfen . "-" . $userfen . " where " . $user_userid . "='{$user_r['userid']}'");
            }
            //备份下载记录
            $utfusername = $user_r['username'];
            BakDown($classid, $id, 0, $user_r['userid'], $utfusername, $infor[title], $userfen, 2);
        }
    }
}
Example #3
0
function GetSofturl($classid, $id, $pathid, $p, $pass, $onlinetime, $onlinepass)
{
    global $empire, $dbtbpre, $public_r, $class_r, $emod_r, $level_r, $ecms_config;
    //验证IP
    eCheckAccessDoIp('onlineinfo');
    $classid = (int) $classid;
    $id = (int) $id;
    $pathid = (int) $pathid;
    $onlinetime = (int) $onlinetime;
    $p = RepPostVar($p);
    if (!$classid || empty($id) || empty($p)) {
        exit;
    }
    $p_r = explode(":::", $p);
    $userid = $p_r[0];
    $rnd = $p_r[1];
    //验证码
    $cpass = md5(ReturnDownSysCheckIp() . "wm_chief" . $public_r[downpass] . $userid);
    if ($cpass != $pass) {
        exit;
    }
    //验证验证码
    CheckOnlinePass($onlinetime, $onlinepass);
    //表不存在
    if (empty($class_r[$classid][tbname])) {
        exit;
    }
    $mid = $class_r[$classid][modid];
    $tbname = $class_r[$classid][tbname];
    $r = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id='{$id}' limit 1");
    if (empty($r['id']) || $r['classid'] != $classid) {
        exit;
    }
    //副表
    $finfor = $empire->fetch1("select " . ReturnSqlFtextF($mid) . " from {$dbtbpre}ecms_" . $tbname . "_data_" . $r[stb] . " where id='{$r['id']}' limit 1");
    $r = array_merge($r, $finfor);
    //区分下载地址
    $path_r = explode("\r\n", $r[onlinepath]);
    if (!$path_r[$pathid]) {
        exit;
    }
    $showdown_r = explode("::::::", $path_r[$pathid]);
    $downgroup = $showdown_r[2];
    //下载权限
    if ($downgroup) {
        $userid = (int) $userid;
        $rnd = RepPostVar($rnd);
        //取得会员资料
        $u = $empire->fetch1("select " . eReturnSelectMemberF('*') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}' and " . egetmf('rnd') . "='{$rnd}' limit 1");
        if (empty($u['userid'])) {
            exit;
        }
        //下载次数限制
        $setuserday = "";
        if ($level_r[$u['groupid']]['daydown']) {
            $setuserday = DoCheckMDownNum($userid, $u['groupid'], 1);
        }
        if ($level_r[$downgroup][level] > $level_r[$u[groupid]][level]) {
            exit;
        }
        //点数是否足够
        $showdown_r[3] = intval($showdown_r[3]);
        if ($showdown_r[3]) {
            //---------是否有历史记录
            $bakr = $empire->fetch1("select id,truetime from {$dbtbpre}enewsdownrecord where id='{$id}' and classid='{$classid}' and userid='{$userid}' and pathid='{$pathid}' and online=1 order by truetime desc limit 1");
            if ($bakr[id] && time() - $bakr[truetime] <= $public_r[redodown] * 3600) {
            } else {
                //包月卡
                if ($u['userdate'] - time() > 0) {
                } else {
                    if ($showdown_r[3] > $u['userfen']) {
                        exit;
                    }
                    //去除点数
                    $usql = $empire->query("update " . eReturnMemberTable() . " set " . egetmf('userfen') . "=" . egetmf('userfen') . "-" . $showdown_r[3] . " where " . egetmf('userid') . "='{$userid}'");
                }
                //备份下载记录
                $utfusername = $u['username'];
                BakDown($classid, $id, $pathid, $userid, $utfusername, $r[title], $showdown_r[3], 1);
            }
        }
        //更新用户下载次数
        if ($setuserday) {
            $usql = $empire->query($setuserday);
        }
    }
    //总下载数据增一
    $usql = $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " set totaldown=totaldown+1 where id='{$id}'");
    //选择播放器
    $ftype = GetFiletype($showdown_r[1]);
    if (strstr($ecms_config['sets']['realplayertype'], ',' . $ftype . ',')) {
        Header("Content-Type: audio/x-pn-realaudio");
    } else {
        Header("Content-Type: video/x-ms-asf");
    }
    $downurl = stripSlashes($showdown_r[1]);
    $downurlr = ReturnDownQzPath($downurl, $showdown_r[4]);
    $downurl = $downurlr['repath'];
    //防盗链
    @(include ECMS_PATH . DASHBOARD . "/DownSys/class/enpath.php");
    $downurl = DoEnOnlinepath($downurl);
    db_close();
    $empire = null;
    echo $downurl;
    exit;
}
Example #4
0
function CheckNews_all($classid, $id, $userid, $username)
{
    global $empire, $class_r, $dbtbpre, $emod_r, $adddatar;
    $classid = (int) $classid;
    if (empty($classid)) {
        printerror("ErrorUrl", "history.go(-1)");
    }
    //验证权限
    $doselfinfo = CheckLevel($userid, $username, $classid, "news");
    //权限
    if (!$doselfinfo['docheckinfo']) {
        printerror("NotCheckInfoLevel", "history.go(-1)");
    }
    $count = count($id);
    if (empty($count)) {
        printerror("NotCheckNewsid", "history.go(-1)");
    }
    $dopubid = 0;
    $donum = 0;
    $dolog = '';
    //附加链接参数
    $addecmscheck = empty($_POST['ecmscheck']) ? '&ecmscheck=1' : '';
    $add = '';
    for ($i = 0; $i < $count; $i++) {
        $infoid = (int) $id[$i];
        if (empty($infoid)) {
            continue;
        }
        $infor = $empire->fetch1("select * from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check where id='{$infoid}' limit 1");
        if (!$infor['id'] || $infor['isqf'] == 1) {
            continue;
        }
        $sql = $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index set checked=1 where id='{$infoid}'");
        //投稿增加积分
        if ($infor['ismember'] && $infor['userid']) {
            $cr = $empire->fetch1("select classid,addinfofen from {$dbtbpre}enewsclass where classid='{$infor['classid']}'");
            if ($cr['addinfofen']) {
                $finfor = $empire->fetch1("select haveaddfen from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check_data where id='{$infoid}' limit 1");
                if (!$finfor['haveaddfen']) {
                    AddInfoFen($cr[addinfofen], $infor[userid]);
                    if ($cr['addinfofen'] < 0) {
                        BakDown($infor[classid], $infor[id], 0, $infor[userid], $infor[username], $infor[title], abs($cr[addinfofen]), 3);
                    }
                }
            }
            $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check_data set haveaddfen=1 where id='{$infoid}'");
        }
        //未审核表转换
        MoveCheckInfoData($class_r[$classid][tbname], 0, $infor['stb'], "id='{$infoid}'");
        //更新栏目信息数
        AddClassInfos($infor['classid'], '', '+1');
        //刷新信息
        GetHtml($infor['classid'], $infor['id'], $infor, 1);
        $donum++;
        if ($donum == 1) {
            $dopubid = ReturnInfoPubid($infor['classid'], $infor['id']);
            $dolog = "classid=" . $infor['classid'] . "<br>id=" . $infor['id'] . "<br>title=" . $infor['title'];
        }
    }
    //刷新列表
    //ReListHtml($classid,1);
    $returl = $_SERVER['HTTP_REFERER'];
    //发送通知
    if ($adddatar['causetext'] && $infoid) {
        if (!$infor['id']) {
            $infor = $empire->fetch1("select * from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " where id='{$infoid}' limit 1");
        }
        DoInfoSendNotice($userid, $username, $infor['userid'], $infor['username'], $adddatar['causetext'], $infor, 2);
        if ($adddatar['ecmsfrom'] && (stristr($adddatar['ecmsfrom'], 'ListNews.php') || stristr($adddatar['ecmsfrom'], 'ListAllInfo.php'))) {
            $returl = $adddatar['ecmsfrom'];
        } else {
            $returl = "ListNews.php?bclassid={$adddatar['bclassid']}&classid={$adddatar['classid']}" . $addecmscheck . hReturnEcmsHashStrHref2(0);
        }
    }
    //操作日志
    if ($donum == 1) {
        insert_dolog($dolog, $dopubid);
    } else {
        insert_dolog("classid=" . $classid . "<br>classname=" . $class_r[$classid][classname]);
    }
    printerror("CheckNewsSuccess", $returl);
}
Example #5
0
function CheckNews_all($classid, $id, $userid, $username)
{
    global $empire, $class_r, $dbtbpre, $emod_r;
    $classid = (int) $classid;
    if (empty($classid)) {
        printerror("ErrorUrl", "history.go(-1)");
    }
    //验证权限
    $doselfinfo = CheckLevel($userid, $username, $classid, "news");
    //编辑权限
    if (!$doselfinfo['doeditinfo']) {
        printerror("NotEditInfoLevel", "history.go(-1)");
    }
    $count = count($id);
    if (empty($count)) {
        printerror("NotCheckNewsid", "history.go(-1)");
    }
    for ($i = 0; $i < $count; $i++) {
        $add .= "id='" . intval($id[$i]) . "' or ";
    }
    $add = substr($add, 0, strlen($add) - 4);
    $sql = $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " set checked=1 where isqf=0 and (" . $add . ")");
    $sql = $empire->query("select * from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " where " . $add);
    while ($r = $empire->fetch($sql)) {
        //投稿增加积分
        if ($r[ismember] && $r[userid] && !$r[haveaddfen]) {
            $cr = $empire->fetch1("select classid,addinfofen from {$dbtbpre}enewsclass where classid='{$r['classid']}'");
            if ($cr[addinfofen]) {
                AddInfoFen($cr[addinfofen], $r[userid]);
                if ($cr[addinfofen] < 0) {
                    BakDown($r[classid], $r[id], 0, $r[userid], $r[username], $r[title], abs($cr[addinfofen]), 3);
                }
            }
            $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . " set haveaddfen=1 where id={$r['id']}");
        }
        //刷新信息
        GetHtml($r, '');
    }
    //刷新列表
    //ReListHtml($classid,1);
    if ($sql) {
        //操作日志
        insert_dolog("classid=" . $classid . "<br>classname=" . $class_r[$classid][classname]);
        printerror("CheckNewsSuccess", $_SERVER['HTTP_REFERER']);
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Example #6
0
function DodoInfo($add, $ecms = 0)
{
    global $empire, $public_r, $emod_r, $level_r, $class_r, $dbtbpre, $fun_r;
    //验证来源
    if ($ecms == 0 || $ecms == 1) {
        CheckCanPostUrl();
    }
    //开启投稿
    if ($public_r['addnews_ok']) {
        printerror("CloseQAdd", "", 1);
    }
    //验证本时间允许操作
    eCheckTimeCloseDo('info');
    $classid = (int) $add['classid'];
    $mid = (int) $class_r[$classid]['modid'];
    if (!$mid || !$classid) {
        printerror("EmptyQinfoCid", "", 1);
    }
    $tbname = $emod_r[$mid]['tbname'];
    $qenter = $emod_r[$mid]['qenter'];
    if (!$tbname || !$qenter || $qenter == ',') {
        printerror("ErrorUrl", "history.go(-1)", 1);
    }
    $muserid = (int) getcvar('mluserid');
    $musername = RepPostVar(getcvar('mlusername'));
    $mrnd = RepPostVar(getcvar('mlrnd'));
    //取得栏目信息
    $isadd = 0;
    if ($ecms == 0) {
        $isadd = 1;
    }
    $setuserday = '';
    $cr = DoQCheckAddLevel($classid, $muserid, $musername, $mrnd, $ecms, $isadd);
    $setuserday = $cr['checkaddnumquery'];
    $filepass = (int) $add['filepass'];
    $id = (int) $add['id'];
    $infor = array();
    //组合标题属性
    $titlecolor = RepPostStr(RepPhpAspJspcodeText($add[titlecolor]));
    $titlefont = TitleFont($add[titlefont], $titlecolor);
    $titlecolor = "";
    $titlefont = "";
    $ttid = (int) $add['ttid'];
    $keyboard = addslashes(RepPostStr(trim(DoReplaceQjDh($add[keyboard]))));
    $keyid = '';
    //返回关键字组合
    if ($keyboard && strstr($qenter, ',special.field,')) {
        $keyboard = str_replace('[!--f--!]', 'ecms', $keyboard);
        $keyid = GetKeyid($keyboard, $classid, $id, $class_r[$classid][link_num]);
    }
    //验证码
    $keyvname = 'checkinfokey';
    //moreport
    if (Moreport_ReturnMustDt()) {
        define('ECMS_SELFPATH', eReturnEcmsMainPortPath());
        Moreport_ResetMainTempGid();
    }
    //-----------------增加
    if ($ecms == 0) {
        //时间
        $lasttime = getcvar('lastaddinfotime');
        if ($lasttime) {
            if (time() - $lasttime < $public_r['readdinfotime']) {
                printerror("QAddInfoOutTime", "", 1);
            }
        }
        //验证码
        if ($cr['qaddshowkey']) {
            ecmsCheckShowKey($keyvname, $add['key'], 1);
        }
        //IP发布数限制
        $check_ip = egetip();
        $check_checked = $cr['wfid'] ? 0 : $cr['checkqadd'];
        eCheckIpAddInfoNum($check_ip, $tbname, $mid, $check_checked);
        //返回字段
        $ret_r = ReturnQAddinfoF($mid, $add, $infor, $classid, $filepass, $muserid, $musername, 0);
        $checked = $cr['checkqadd'];
        $havehtml = 0;
        $newspath = date($cr['newspath']);
        $truetime = time();
        $newstime = $truetime;
        $newstempid = $cr['newstempid'];
        $haveaddfen = 0;
        //强制签发
        $isqf = 0;
        if ($cr['wfid']) {
            $checked = 0;
            $isqf = 1;
        }
        //增扣点
        if ($checked && $muserid) {
            AddInfoFen($cr['addinfofen'], $muserid);
            $haveaddfen = 1;
        }
        if (empty($muserid)) {
            $musername = $fun_r['guest'];
        }
        //会员投稿数更新
        if ($setuserday) {
            $empire->query($setuserday);
        }
        //发布时间
        if (!strstr($qenter, ',newstime,')) {
            $ret_r[0] = ",newstime" . $ret_r[0];
            $ret_r[1] = ",'{$newstime}'" . $ret_r[1];
        } else {
            if ($add['newstime']) {
                $newstime = to_time($add['newstime']);
                $newstime = intval($newstime);
            }
        }
        //附加链接参数
        $addecmscheck = empty($checked) ? '&ecmscheck=1' : '';
        //索引表
        $indexsql = $empire->query("insert into {$dbtbpre}ecms_" . $tbname . "_index(classid,checked,newstime,truetime,lastdotime,havehtml) values('{$classid}','{$checked}','{$newstime}','{$truetime}','{$truetime}','{$havehtml}');");
        $id = $empire->lastid();
        //返回表信息
        $infotbr = ReturnInfoTbname($tbname, $checked, $ret_r[4]);
        //主表
        $sql = $empire->query("insert into " . $infotbr['tbname'] . "(id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard" . $ret_r[0] . ") values('{$id}','{$classid}','{$ttid}',0,0,0,'{$newspath}','','" . $muserid . "','" . addslashes($musername) . "',0,0,0,'{$isqf}',1,0,'{$truetime}','{$truetime}','{$havehtml}',0,0,'{$titlefont}','','{$ret_r['4']}','{$public_r['filedeftb']}','{$public_r['pldeftb']}','{$keyboard}'" . $ret_r[1] . ");");
        //副表
        $fsql = $empire->query("insert into " . $infotbr['datatbname'] . "(id,classid,keyid,dokey,newstempid,closepl,haveaddfen,infotags" . $ret_r[2] . ") values('{$id}','{$classid}','{$keyid}',1,'{$newstempid}',0,'{$haveaddfen}',''" . $ret_r[3] . ");");
        //扣点记录
        if ($haveaddfen) {
            if ($cr['addinfofen'] < 0) {
                BakDown($classid, $id, 0, $muserid, $musername, RepPostStr($add[title]), abs($cr['addinfofen']), 3);
            }
        }
        //签发
        if ($isqf == 1) {
            InfoInsertToWorkflow($id, $classid, $cr['wfid'], $muserid, addslashes($musername));
        }
        //文件命名
        $filename = ReturnInfoFilename($classid, $id, '');
        //信息地址
        $infourl = GotoGetTitleUrl($classid, $id, $newspath, $filename, 0, 0, '');
        $usql = $empire->query("update " . $infotbr['tbname'] . " set filename='{$filename}',titleurl='{$infourl}' where id='{$id}'");
        //修改ispic
        UpdateTheIspic($classid, $id, $checked);
        //修改附件
        if ($filepass) {
            UpdateTheFile($id, $filepass, $classid, $public_r['filedeftb']);
        }
        //更新栏目信息数
        AddClassInfos($classid, '+1', '+1', $checked);
        //更新新信息数
        DoUpdateAddDataNum('info', $class_r[$classid]['tid'], 1);
        //清除验证码
        ecmsEmptyShowKey($keyvname);
        esetcookie("qeditinfo", "", 0);
        //生成页面
        if ($checked && !$cr['showdt']) {
            $titleurl = qAddGetHtml($classid, $id);
        }
        //生成列表
        if ($checked) {
            qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']);
            //生成上一篇
            if ($cr['repreinfo']) {
                $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1");
                GetHtml($prer['classid'], $prer['id'], $prer, 1);
            }
        }
        if ($sql) {
            $reurl = DoingReturnUrl("AddInfo.php?classid={$classid}&mid={$mid}" . $addecmscheck, $add['ecmsfrom']);
            if ($add['gotoinfourl'] && $checked) {
                if ($cr['showdt'] == 1) {
                    $reurl = $public_r[newsurl] . "e/action/ShowInfo/?classid={$classid}&id={$id}";
                } elseif ($cr['showdt'] == 2) {
                    $rewriter = eReturnRewriteInfoUrl($classid, $id, 1);
                    $reurl = $rewriter['pageurl'];
                } else {
                    $reurl = $titleurl;
                }
            }
            esetcookie("lastaddinfotime", time(), time() + 3600 * 24);
            //设置最后发表时间
            printerror("AddQinfoSuccess", $reurl, 1);
        } else {
            printerror("DbError", "history.go(-1)", 1);
        }
    } elseif ($ecms == 1) {
        if (!$id) {
            printerror("ErrorUrl", "history.go(-1)", 1);
        }
        //检测权限
        $infor = CheckQdoinfo($classid, $id, $muserid, $tbname, $cr['adminqinfo'], 1);
        //检测时间
        if ($public_r['qeditinfotime']) {
            if (time() - $infor['truetime'] > $public_r['qeditinfotime'] * 60) {
                printerror("QEditInfoOutTime", "history.go(-1)", 1);
            }
        }
        $iaddfield = '';
        $addfield = '';
        $faddfield = '';
        //返回字段
        $ret_r = ReturnQAddinfoF($mid, $add, $infor, $classid, $filepass, $muserid, $musername, 1);
        if ($keyboard) {
            $addfield = ",keyboard='{$keyboard}'";
            $faddfield = ",keyid='{$keyid}'";
        }
        //时间
        if (strstr($qenter, ',newstime,')) {
            if ($add['newstime']) {
                $newstime = to_time($add['newstime']);
                $newstime = intval($newstime);
                $iaddfield .= ",newstime='{$newstime}'";
            }
        }
        //修改是否需要审核
        $ychecked = $infor['checked'];
        if ($cr['qeditchecked']) {
            $infor['checked'] = 0;
            $iaddfield .= ",checked=0";
            $relist = 1;
            //删除原页面
            DelNewsFile($infor[filename], $infor[newspath], $infor[classid], $infor[newstext], $infor[groupid]);
        }
        //会员投稿数更新
        if ($setuserday) {
            //$empire->query($setuserday);
        }
        $lastdotime = time();
        //附加链接参数
        $addecmscheck = empty($infor['checked']) ? '&ecmscheck=1' : '';
        //索引表
        $indexsql = $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set lastdotime={$lastdotime},havehtml=0" . $iaddfield . " where id='{$id}'");
        //返回表信息
        $infotbr = ReturnInfoTbname($tbname, $ychecked, $infor['stb']);
        //主表
        $sql = $empire->query("update " . $infotbr['tbname'] . " set lastdotime={$lastdotime},havehtml=0,ttid='{$ttid}'" . $addfield . $ret_r[0] . " where id={$id} and classid={$classid} and userid='{$muserid}' and ismember=1");
        //副表
        $fsql = $empire->query("update " . $infotbr['datatbname'] . " set classid='{$classid}'" . $faddfield . $ret_r[3] . " where id='{$id}'");
        //修改ispic
        UpdateTheIspic($classid, $id, $ychecked);
        //更新附件
        UpdateTheFileEdit($classid, $id, $infor['fstb']);
        //未审核信息互转
        if ($ychecked != $infor['checked']) {
            MoveCheckInfoData($tbname, $ychecked, $infor['stb'], "id='{$id}'");
            //更新栏目信息数
            if ($infor['checked']) {
                AddClassInfos($classid, '', '+1');
            } else {
                AddClassInfos($classid, '', '-1');
            }
        }
        esetcookie("qeditinfo", "", 0);
        //生成页面
        if ($infor['checked'] && !$cr['showdt']) {
            $titleurl = qAddGetHtml($classid, $id);
        }
        //生成列表
        if ($infor['checked'] || $relist == 1) {
            qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']);
        }
        //生成上一篇
        if ($cr['repreinfo'] && $infor['checked']) {
            $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1");
            GetHtml($prer['classid'], $prer['id'], $prer, 1);
        }
        if ($sql) {
            $reurl = DoingReturnUrl("ListInfo.php?mid={$mid}" . $addecmscheck, $add['ecmsfrom']);
            if ($add['editgotoinfourl'] && $infor['checked']) {
                if ($cr['showdt'] == 1) {
                    $reurl = $public_r[newsurl] . "e/action/ShowInfo/?classid={$classid}&id={$id}";
                } elseif ($cr['showdt'] == 2) {
                    $rewriter = eReturnRewriteInfoUrl($classid, $id, 1);
                    $reurl = $rewriter['pageurl'];
                } else {
                    $reurl = $titleurl;
                }
            }
            printerror("EditQinfoSuccess", $reurl, 1);
        } else {
            printerror("DbError", "history.go(-1)", 1);
        }
    } elseif ($ecms == 2) {
        if (!$id) {
            printerror("ErrorUrl", "history.go(-1)", 1);
        }
        //检测权限
        $r = CheckQdoinfo($classid, $id, $muserid, $tbname, $cr['adminqinfo'], 2);
        //附加链接参数
        $addecmscheck = empty($r['checked']) ? '&ecmscheck=1' : '';
        //返回表信息
        $infotbr = ReturnInfoTbname($tbname, $r['checked'], $r['stb']);
        $stf = $emod_r[$mid]['savetxtf'];
        $pf = $emod_r[$mid]['pagef'];
        //分页字段
        if ($pf) {
            if (strstr($emod_r[$mid]['tbdataf'], ',' . $pf . ',')) {
                $finfor = $empire->fetch1("select " . $pf . " from " . $infotbr['datatbname'] . " where id='{$id}' limit 1");
                $r[$pf] = $finfor[$pf];
            }
        }
        //存文本
        if ($stf) {
            $newstextfile = $r[$stf];
            $r[$stf] = GetTxtFieldText($r[$stf]);
            //删除文件
            DelTxtFieldText($newstextfile);
        }
        //删除信息文件
        DelNewsFile($r[filename], $r[newspath], $classid, $r[$pf], $r[groupid]);
        $indexsql = $empire->query("delete from {$dbtbpre}ecms_" . $tbname . "_index where id='{$id}'");
        $sql = $empire->query("delete from " . $infotbr['tbname'] . " where id={$id} and classid={$classid} and userid='{$muserid}' and ismember=1");
        $fsql = $empire->query("delete from " . $infotbr['datatbname'] . " where id={$id}");
        esetcookie("qdelinfo", "", 0);
        //更新栏目信息数
        AddClassInfos($classid, '-1', '-1', $r['checked']);
        //删除其它表记录和附件
        DelSingleInfoOtherData($classid, $id, $r, 0, 0);
        //生成列表
        if ($r['checked']) {
            qAddListHtml($classid, $mid, $cr['qaddlist'], $cr['listdt']);
            //生成上一篇
            if ($cr['repreinfo']) {
                $prer = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id<{$id} and classid='{$classid}' order by id desc limit 1");
                GetHtml($prer['classid'], $prer['id'], $prer, 1);
                //下一篇
                $nextr = $empire->fetch1("select * from {$dbtbpre}ecms_" . $tbname . " where id>{$id} and classid='{$classid}' order by id limit 1");
                if ($nextr['id']) {
                    GetHtml($nextr['classid'], $nextr['id'], $nextr, 1);
                }
            }
        }
        if ($sql) {
            $reurl = DoingReturnUrl("ListInfo.php?mid={$mid}", $add['ecmsfrom']);
            printerror("DelQinfoSuccess", $reurl, 1);
        } else {
            printerror("DbError", "history.go(-1)", 1);
        }
    } else {
        printerror("ErrorUrl", "", 1);
    }
}