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 EditAd($add, $titlefont, $titlecolor, $userid, $username) { global $empire, $time, $dbtbpre; $add[adid] = (int) $add[adid]; if (!$add[classid] || !$add[title] || !$add[adtype] || !$add[adid]) { printerror("EmptyAd", "history.go(-1)"); } //验证权限 CheckLevel($userid, $username, $classid, "ad"); $add[htmlcode] = AddAddsData(RepPhpAspJspcodeText($add[htmlcode])); $add[reptext] = AddAddsData(RepPhpAspJspcodeText($add[reptext])); $ttitlefont = TitleFont($titlefont, 'no'); //重置 if ($add[reset]) { $a = ",onclick=0"; } //变量处理 $add[pic_width] = (int) $add[pic_width]; $add[pic_height] = (int) $add[pic_height]; $add[classid] = (int) $add[classid]; $add[adtype] = (int) $add[adtype]; $add[t] = (int) $add[t]; $add[ylink] = (int) $add[ylink]; $sql = $empire->query("update {$dbtbpre}enewsad set picurl='{$add['picurl']}',url='{$add['url']}',pic_width={$add['pic_width']},pic_height={$add['pic_height']},classid={$add['classid']},adtype={$add['adtype']},title='{$add['title']}',target='{$add['target']}',alt='{$add['alt']}',starttime='{$add['starttime']}',endtime='{$add['endtime']}',adsay='{$add['adsay']}',titlefont='{$ttitlefont}',titlecolor='{$titlecolor}',htmlcode='{$add['htmlcode']}',t={$add['t']},ylink={$add['ylink']},reptext='{$add['reptext']}'" . $a . " where adid='{$add['adid']}'"); GetAdJs($add[adid]); if ($sql) { //操作日志 insert_dolog("adid=" . $add[adid] . "<br>title=" . $add[title]); printerror("EditAdSuccess", "ListAd.php?time={$time}"); } else { printerror("DbError", "history.go(-1)"); } }
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; }
function EditBq($add, $bqsay, $userid, $username) { global $empire, $dbtbpre; $add[bqid] = (int) $add[bqid]; if (!$add[bqname] || !$add[funname] || !$add[bq] || !$add[bqid]) { printerror("EmptyBqname", "history.go(-1)"); } //验证权限 CheckLevel($userid, $username, $classid, "bq"); //标签重复 $num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewsbq where bq='{$add['bq']}' and bqid<>'{$add['bqid']}' limit 1"); if ($num) { printerror("ReBq", "history.go(-1)"); } //函数是否存在 if (!function_exists($add[funname])) { printerror("NotFun", "history.go(-1)"); } $bqsay = RepPhpAspJspcodeText($bqsay); $classid = (int) $add['classid']; $add[isclose] = (int) $add[isclose]; $myorder = (int) $add[myorder]; $sql = $empire->query("update {$dbtbpre}enewsbq set bqname='{$add['bqname']}',bqsay='" . eaddslashes2($bqsay) . "',funname='{$add['funname']}',bq='{$add['bq']}',bqgs='" . eaddslashes2($add[bqgs]) . "',isclose={$add['isclose']},classid={$classid},myorder='{$myorder}' where bqid='{$add['bqid']}'"); if ($sql) { //操作日志 insert_dolog("bqid=" . $add[bqid] . "<br>bqname=" . $add[bqname]); printerror("EditBqSuccess", "template/ListBq.php?classid={$add['cid']}" . hReturnEcmsHashStrHref2(0)); } else { printerror("DbError", "history.go(-1)"); } }
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); } }