function ReInfoUrl($start, $classid, $from, $retype, $startday, $endday, $startid, $endid, $tbname, $userid, $username) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre; //验证权限 //CheckLevel($userid,$username,$classid,"changedata"); $start = (int) $start; $tbname = RepPostVar($tbname); if (empty($tbname) || !eCheckTbname($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } $add1 = ''; //按栏目刷新 $classid = (int) $classid; if ($classid) { if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $add1 = " and (" . $where . ")"; } //按ID刷新 if ($retype) { $startid = (int) $startid; $endid = (int) $endid; if ($endid) { $add1 .= " and id>={$startid} and id<={$endid}"; } } else { $startday = RepPostVar($startday); $endday = RepPostVar($endday); if ($startday && $endday) { $add1 .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); } } $b = 0; $sql = $empire->query("select id,classid,checked from {$dbtbpre}ecms_" . $tbname . "_index where id>{$start}" . $add1 . " order by id limit " . $public_r[delnewsnum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r[id]; //返回表 $infotb = ReturnInfoMainTbname($tbname, $r['checked']); $infor = $empire->fetch1("select newspath,filename,groupid,isurl,titleurl from " . $infotb . " where id='{$r['id']}' limit 1"); $infourl = GotoGetTitleUrl($r['classid'], $r['id'], $infor['newspath'], $infor['filename'], $infor['groupid'], $infor['isurl'], $infor['titleurl']); $empire->query("update " . $infotb . " set titleurl='{$infourl}' where id='{$r['id']}' limit 1"); } if (empty($b)) { insert_dolog(""); //操作日志 printerror("ReInfoUrlSuccess", $from); } echo $fun_r[OneReInfoUrlSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ReInfoUrl.php?enews=ReInfoUrl&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}" . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
function ClearTags($start, $line, $userid, $username) { global $empire, $dbtbpre, $class_r, $fun_r; $line = (int) $line; if (empty($line)) { $line = 500; } $start = (int) $start; $b = 0; $sql = $empire->query("select id,classid,tid,tagid from {$dbtbpre}enewstagsdata where tid>{$start} order by tid limit " . $line); while ($r = $empire->fetch($sql)) { $b = 1; $newstart = $r['tid']; if (empty($class_r[$r[classid]]['tbname'])) { $empire->query("delete from {$dbtbpre}enewstagsdata where tid='{$r['tid']}'"); $empire->query("update {$dbtbpre}enewstags set num=num-1 where tagid='{$r['tagid']}'"); continue; } $index_r = $empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_" . $class_r[$r[classid]]['tbname'] . "_index where id='{$r['id']}' limit 1"); if (!$index_r['id']) { $empire->query("delete from {$dbtbpre}enewstagsdata where tid='{$r['tid']}'"); $empire->query("update {$dbtbpre}enewstags set num=num-1 where tagid='{$r['tagid']}'"); } else { //返回表 $infotb = ReturnInfoMainTbname($class_r[$r[classid]]['tbname'], $index_r['checked']); //主表 $infor = $empire->fetch1("select stb from " . $infotb . " where id='{$r['id']}' limit 1"); //返回表信息 $infodatatb = ReturnInfoDataTbname($class_r[$r[classid]]['tbname'], $index_r['checked'], $infor['stb']); //副表 $finfor = $empire->fetch1("select infotags from " . $infodatatb . " where id='{$r['id']}' limit 1"); $tagr = $empire->fetch1("select tagname from {$dbtbpre}enewstags where tagid='{$r['tagid']}'"); if (!stristr(',' . $finfor['infotags'] . ',', ',' . $tagr['tagname'] . ',')) { $empire->query("delete from {$dbtbpre}enewstagsdata where tid='{$r['tid']}'"); $empire->query("update {$dbtbpre}enewstags set num=num-1 where tagid='{$r['tagid']}'"); } elseif ($index_r['classid'] != $r[classid]) { $empire->query("update {$dbtbpre}enewstagsdata set classid='{$index_r['classid']}' where tid='{$r['tid']}'"); } } } if (empty($b)) { //操作日志 insert_dolog(""); printerror('ClearTagsSuccess', 'ClearTags.php' . hReturnEcmsHashStrHref2(1)); } echo "<meta http-equiv=\"refresh\" content=\"0;url=ClearTags.php?enews=ClearTags&line={$line}&start={$newstart}" . hReturnEcmsHashStrHref(0) . "\">" . $fun_r[OneClearTagsSuccess] . "(ID:<font color=red><b>" . $newstart . "</b></font>)"; exit; }
function ReturnSpInfoidGetData($add, $userid, $username) { global $empire, $dbtbpre, $class_r, $emod_r; $idr = explode(',', $add['getinfoid']); $classid = (int) $idr[0]; $id = (int) $idr[1]; if (!$classid || !$id || !$class_r[$classid][tbname]) { return ''; } $mid = $class_r[$classid]['modid']; $smalltextf = $emod_r[$mid]['smalltextf']; $sf = ''; if ($smalltextf && $smalltextf != ',') { $smr = explode(',', $smalltextf); $sf = $smr[1]; } $addf = ''; if ($sf && !strstr($emod_r[$mid]['tbdataf'], ',' . $sf . ',')) { $addf = ',' . $sf; } $index_r = $empire->fetch1("select id,checked from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index where id='{$id}' limit 1"); if (!$index_r['id']) { return ''; } //返回表 $infotb = ReturnInfoMainTbname($class_r[$classid][tbname], $index_r['checked']); $infor = $empire->fetch1("select id,classid,isurl,titleurl,isgood,firsttitle,plnum,totaldown,onclick,newstime,titlepic,title,stb" . $addf . " from " . $infotb . " where id='{$id}' limit 1"); if ($sf && !$addf) { //返回表信息 $infodatatb = ReturnInfoDataTbname($class_r[$classid][tbname], $index_r['checked'], $infor['stb']); $finfor = $empire->fetch1("select " . $sf . " from " . $infodatatb . " where id='{$id}' limit 1"); $infor[$sf] = $finfor[$sf]; } $ret_r['title'] = $infor[title]; $ret_r['titleurl'] = sys_ReturnBqTitleLink($infor); $ret_r['titlepic'] = $infor[titlepic]; $ret_r['smalltext'] = $infor[$sf]; $ret_r['newstime'] = $infor[newstime]; return $ret_r; }
function DelPl_all($plid, $id, $bclassid, $classid, $userid, $username) { global $empire, $class_r, $dbtbpre, $public_r; //验证权限 //CheckLevel($userid,$username,$classid,"news"); $restb = (int) $_POST['restb']; $count = count($plid); if (empty($count) || !$restb) { printerror("NotDelPlid", "history.go(-1)"); } if (!strstr($public_r['pldatatbs'], ',' . $restb . ',')) { printerror("NotDelPlid", "history.go(-1)"); } for ($i = 0; $i < $count; $i++) { $add .= "plid='" . intval($plid[$i]) . "' or "; } $add = substr($add, 0, strlen($add) - 4); //更新数据表 $fsql = $empire->query("select id,classid,plid,pubid from {$dbtbpre}enewspl_{$restb} where " . $add); while ($r = $empire->fetch($fsql)) { if ($class_r[$r[classid]][tbname] && $r['pubid'] > 0) { $index_r = $empire->fetch1("select checked from {$dbtbpre}ecms_" . $class_r[$r[classid]][tbname] . "_index where id='{$r['id']}' limit 1"); //返回表 $infotb = ReturnInfoMainTbname($class_r[$r[classid]][tbname], $index_r['checked']); $empire->query("update " . $infotb . " set plnum=plnum-1 where id='{$r['id']}'"); } } $sql = $empire->query("delete from {$dbtbpre}enewspl_{$restb} where " . $add); if ($sql) { //操作日志 insert_dolog("classid=" . $classid . "<br>classname=" . $class_r[$classid][classname]); printerror("DelPlSuccess", $_SERVER['HTTP_REFERER']); } else { printerror("DbError", "history.go(-1)"); } }
printerror("ErrorUrl", "history.go(-1)"); } $infomod_r['enter'] .= '发布者<!--field--->username<!--record-->ID<!--field--->id<!--record-->'; $searchoptions_r = ReturnSearchOptions($infomod_r['enter'], $fieldexp, $recordexp); //审核表 $search = ''; $search .= $ecms_hashur['ehref']; $addecmscheck = ''; $ecmscheck = (int) $_GET['ecmscheck']; $indexchecked = 1; if ($ecmscheck) { $search .= '&ecmscheck=' . $ecmscheck; $addecmscheck = '&ecmscheck=' . $ecmscheck; $indexchecked = 0; } $infotb = ReturnInfoMainTbname($class_r[$classid][tbname], $indexchecked); //导航 $url = AdminReturnClassLink($classid) . ' > 管理归档 (<a href="AddNews.php?enews=AddNews&bclassid=' . $bclassid . '&classid=' . $classid . $addecmscheck . $ecms_hashur['ehref'] . '">增加信息</a>)'; $start = 0; $page = (int) $_GET['page']; $page = RepPIntvar($page); $line = intval($public_r['hlistinfonum']); //每页显示 $page_line = 16; $offset = $page * $line; $search .= "&bclassid={$bclassid}&classid={$classid}"; $add = ''; $ewhere = ''; //搜索 $sear = RepPostStr($_GET['sear'], 1); if ($sear) {
$mid = $class_r[$classid][modid]; $mr = $empire->fetch1("select enter,tbname from {$dbtbpre}enewsmod where mid='{$mid}'"); if (empty($mr['tbname'])) { printerror("ErrorUrl", "history.go(-1)"); } $enter = $mr['enter']; $savetxtf = $emod_r[$mid]['savetxtf']; //导航 $url = AdminReturnClassLink($classid) . ' > 查看信息'; //索引表 $index_r = $empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_" . $tbname . "_index where id='{$id}' limit 1"); if (!$index_r['id'] || $index_r['classid'] != $classid) { printerror("ErrorUrl", "history.go(-1)"); } //返回表 $infotb = ReturnInfoMainTbname($tbname, $index_r['checked']); $r = $empire->fetch1("select * from " . $infotb . " where id='{$id}' limit 1"); $wfinfor = $empire->fetch1("select id,tid,groupid,userclass,username,tstatus,checktno from {$dbtbpre}enewswfinfo where id='{$id}' and classid='{$classid}' limit 1"); if (!$wfinfor['id']) { printerror('ErrorUrl', 'history.go(-1)'); } //工作流 $cwfitemr = $empire->fetch1("select wfid,groupid,userclass,username from {$dbtbpre}enewsworkflowitem where tid='{$wfinfor['tid']}'"); //验证权限 if (strstr(',' . $cwfitemr[groupid] . ',', ',' . $lur[groupid] . ',') || strstr(',' . $cwfitemr[userclass] . ',', ',' . $lur[classid] . ',') || strstr(',' . $cwfitemr[username] . ',', ',' . $lur[username] . ',')) { } else { $doselfinfo = CheckLevel($logininid, $loginin, $classid, "news"); } $r[newstime] = date("Y-m-d H:i:s", $r[newstime]); //返回表信息 $infodatatb = ReturnInfoDataTbname($tbname, $index_r['checked'], $r['stb']);
} elseif ($modtype == 7) { $query = "select fileid,filename,filesize,path,filetime,no,fpath from {$dbtbpre}enewsfile_other where modtype=7 and type='{$type}'"; $totalquery = "select count(*) as total from {$dbtbpre}enewsfile_other where modtype=7 and type='{$type}'"; $tranname = '碎片'; } else { $isinfofile = 1; if (!$classid || !$class_r[$classid]['tbname']) { printerror('ErrorUrl', 'history.go(-1)'); } if ($infoid) { $index_r = $empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . "_index where id='{$infoid}' limit 1"); if (!$index_r['id']) { printerror('ErrorUrl', 'history.go(-1)'); } //主表 $infotb = ReturnInfoMainTbname($class_r[$classid]['tbname'], $index_r['checked']); //返回表 $infor = $empire->fetch1("select fstb from " . $infotb . " where id='{$infoid}' limit 1"); $fstb = $infor['fstb']; } else { $fstb = $public_r['filedeftb']; } $fstb = (int) $fstb; $query = "select fileid,filename,filesize,path,filetime,classid,no,fpath from {$dbtbpre}enewsfile_{$fstb} where type='{$type}'"; $totalquery = "select count(*) as total from {$dbtbpre}enewsfile_{$fstb} where type='{$type}'"; $tranname = '信息'; } //栏目 $searchclassid = 0; $searchvarclassid = ''; if ($isinfofile == 1) {
$line = 25; //每行显示 $page_line = 10; $offset = $page * $line; $add = ''; $search = "&mid={$mid}"; //审核表 $ecmscheck = (int) $_GET['ecmscheck']; $addecmscheck = ''; $indexchecked = 1; if ($ecmscheck) { $search .= '&ecmscheck=' . $ecmscheck; $addecmscheck = '&ecmscheck=' . $ecmscheck; $indexchecked = 0; } $infotb = ReturnInfoMainTbname($mr['tbname'], $indexchecked); //显示方式 if ($public_r['qlistinfomod']) { $modnum = $empire->gettotal("select count(*) as total from {$dbtbpre}enewsmod where tbname='{$mr['tbname']}'"); if ($modnum > 1) { $add .= ' and (' . ReturnClass($mr['sonclass']) . ')'; } } //搜索 $sear = RepPostStr($_GET['sear'], 1); $keyboard = ''; $show = ''; if ($sear) { $keyboard = RepPostVar2($_GET['keyboard']); $show = RepPostStr($_GET['show'], 1); //关键字
function DoRepNewstext($start,$oldword,$newword,$field,$classid,$tid,$tbname,$over,$dozz,$dotxt,$userid,$username){ global $empire,$public_r,$class_r,$fun_r,$dbtbpre,$emod_r; $tbname=RepPostVar($tbname); $field=RepPostVar($field); $tid=(int)$tid; $dotype=(int)$_POST['dotype']; $classid=(int)$classid; if(!$field||empty($tbname)||!$tid) { printerror("FailCX","history.go(-1)"); } if($dotype==0&&strlen($oldword)==0) { printerror("FailCX","history.go(-1)"); } CheckLevel($userid,$username,$classid,"repnewstext");//验证权限 //变量替换 $postoldword=ClearAddsData($oldword); $postnewword=ClearAddsData($newword); //替换条件 if($classid)//按栏目替换 { if(empty($class_r[$classid][islast]))//中级栏目 { $where=ReturnClass($class_r[$classid][sonclass]); } else//终极栏目 { $where="classid='$classid'"; } $add1=" and (".$where.")"; $add2=" where (".$where.")"; } $fr=$empire->fetch1("select tid,savetxt,tbdataf from {$dbtbpre}enewsf where tbname='$tbname' and f='$field' limit 1"); //系统字段 $specialdatafield=',keyid,dokey,newstempid,closepl,haveaddfen,infotags,'; if(!$fr['tid']&&stristr($specialdatafield,','.$field.',')) { $fr['tbdataf']=1; } //覆盖方式 if($dotype==1) { $repoldword=addslashes($oldword); $repnewword=addslashes($newword); if($over==1)//完全替换 { if(empty($add2)) { $and=" where "; } else { $and=" and "; } $add2.=$and.$field."='".$repoldword."'"; } if($fr['tbdataf'])//副表 { //已审核 $tbr=$empire->fetch1("select datatbs from {$dbtbpre}enewstable where tbname='$tbname' limit 1"); if($tbr['datatbs']) { $dtbr=explode(',',$tbr['datatbs']); $count=count($dtbr); for($i=1;$i<$count-1;$i++) { $empire->query("update {$dbtbpre}ecms_".$tbname."_data_".$dtbr[$i]." set ".$field."='$repnewword'".$add2); } } //未审核 $empire->query("update {$dbtbpre}ecms_".$tbname."_check_data set ".$field."='$repnewword'".$add2); } else//主表 { $empire->query("update {$dbtbpre}ecms_".$tbname." set ".$field."='$repnewword'".$add2); //未审核 $empire->query("update {$dbtbpre}ecms_".$tbname."_check set ".$field."='$repnewword'".$add2); } //替换完毕 insert_dolog("tbname=".$tbname."&field=".$field."&dotype=1<br>oldword=".$oldword."<br>newword=".$newword);//操作日志 printerror("DoRepNewstextSuccess","db/RepNewstext.php?tid=$tid".hReturnEcmsHashStrHref2(0)); } //存文本替换 elseif($fr['savetxt']) { $repoldword=addslashes($postoldword); $repnewword=addslashes($postnewword); //字段 $selectf=$fr['tbdataf']?',stb':','.$field; $fieldform="<input type='hidden' name='field' value='".$field."'>"; if(empty($public_r[dorepnum])) { $public_r[dorepnum]=600; } $start=(int)$start; $b=0; $sql=$empire->query("select id,checked from {$dbtbpre}ecms_".$tbname."_index where id>$start".$add1." order by id limit ".$public_r[dorepnum]); while($r=$empire->fetch($sql)) { $b=1; $newstart=$r[id]; //返回表 $infotb=ReturnInfoMainTbname($tbname,$r['checked']); //主表 $infor=$empire->fetch1("select isurl".$selectf." from ".$infotb." where id='$r[id]' limit 1"); if($infor['isurl']) { continue; } //副表 if($fr['tbdataf']) { //返回表信息 $infodatatb=ReturnInfoDataTbname($tbname,$r['checked'],$infor['stb']); $finfor=$empire->fetch1("select ".$field." from ".$infodatatb." where id='$r[id]' limit 1"); $infor[$field]=$finfor[$field]; } $value=GetTxtFieldText($infor[$field]); if(empty($value)) { continue; } if($dozz==1)//正则 { $newvalue=DoRepNewstextZz($repoldword,$repnewword,$value);//正则替换 } else//普通 { if(!stristr($value,$repoldword)) { continue; } $newvalue=str_replace($repoldword,$repnewword,$value); } EditTxtFieldText($infor[$field],$newvalue); } //替换完毕 if(empty($b)) { insert_dolog("tbname=".$tbname."&field=".$field."<br>oldword=".$oldword."<br>newword=".$newword);//操作日志 printerror("DoRepNewstextSuccess","db/RepNewstext.php?tid=$tid".hReturnEcmsHashStrHref2(0)); } EchoRepFieldForm($tid,$tbname,$over,$dozz,$dotxt,$newstart,$fieldform,$classid,$postoldword,$postnewword); } //正则替换 elseif($dozz==1) { //字段 $selectf=$fr['tbdataf']?',stb':','.$field; $fieldform="<input type='hidden' name='field' value='".$field."'>"; if(empty($public_r[dorepnum])) { $public_r[dorepnum]=600; } $start=(int)$start; $b=0; $sql=$empire->query("select id,checked from {$dbtbpre}ecms_".$tbname."_index where id>$start".$add1." order by id limit ".$public_r[dorepnum]); while($r=$empire->fetch($sql)) { $b=1; $newstart=$r[id]; //返回表 $infotb=ReturnInfoMainTbname($tbname,$r['checked']); //主表 $infor=$empire->fetch1("select isurl".$selectf." from ".$infotb." where id='$r[id]' limit 1"); if($infor['isurl']) { continue; } if($fr['tbdataf'])//副表 { //返回表信息 $infodatatb=ReturnInfoDataTbname($tbname,$r['checked'],$infor['stb']); $finfor=$empire->fetch1("select ".$field." from ".$infodatatb." where id='$r[id]' limit 1"); $newvalue=DoRepNewstextZz($oldword,$newword,stripSlashes($finfor[$field]));//正则替换 $empire->query("update ".$infodatatb." set ".$field."='".addslashes($newvalue)."' where id='$r[id]'"); } else//主表 { $newvalue=DoRepNewstextZz($oldword,$newword,stripSlashes($infor[$field]));//正则替换 $empire->query("update ".$infotb." set ".$field."='".addslashes($newvalue)."' where id='$r[id]'"); } } //替换完毕 if(empty($b)) { insert_dolog("tbname=".$tbname."&field=".$field."<br>oldword=".$oldword."<br>newword=".$newword);//操作日志 printerror("DoRepNewstextSuccess","db/RepNewstext.php?tid=$tid".hReturnEcmsHashStrHref2(0)); } EchoRepFieldForm($tid,$tbname,$over,$dozz,$dotxt,$newstart,$fieldform,$classid,$postoldword,$postnewword); } //普通替换 else { $repoldword=eaddslashes2($oldword); $repnewword=eaddslashes2($newword); if($over==1)//完全替换 { if(empty($add2)) { $and=" where "; } else { $and=" and "; } $add2.=$and.$field."='".$repoldword."'"; } if($fr['tbdataf'])//副表 { //已审核 $tbr=$empire->fetch1("select datatbs from {$dbtbpre}enewstable where tbname='$tbname' limit 1"); if($tbr['datatbs']) { $dtbr=explode(',',$tbr['datatbs']); $count=count($dtbr); for($i=1;$i<$count-1;$i++) { $empire->query("update {$dbtbpre}ecms_".$tbname."_data_".$dtbr[$i]." set ".$field."=REPLACE(".$field.",'$repoldword','$repnewword')".$add2); } } //未审核 $empire->query("update {$dbtbpre}ecms_".$tbname."_check_data set ".$field."=REPLACE(".$field.",'$repoldword','$repnewword')".$add2); } else//主表 { $empire->query("update {$dbtbpre}ecms_".$tbname." set ".$field."=REPLACE(".$field.",'$repoldword','$repnewword')".$add2); //未审核 $empire->query("update {$dbtbpre}ecms_".$tbname."_check set ".$field."=REPLACE(".$field.",'$repoldword','$repnewword')".$add2); } //替换完毕 insert_dolog("tbname=".$tbname."&field=".$field."<br>oldword=".$oldword."<br>newword=".$newword);//操作日志 printerror("DoRepNewstextSuccess","db/RepNewstext.php?tid=$tid".hReturnEcmsHashStrHref2(0)); } }
function DelMorePl($add, $logininid, $loginin) { global $empire, $dbtbpre, $public_r, $class_r; CheckLevel($logininid, $loginin, $classid, "pl"); //验证权限 //变量处理 $restb = (int) $add['restb']; $username = RepPostVar($add['username']); $sayip = RepPostVar($add['sayip']); $saytext = RepPostStr($add['saytext']); $startplid = (int) $add['startplid']; $endplid = (int) $add['endplid']; $startsaytime = RepPostVar($add['startsaytime']); $endsaytime = RepPostVar($add['endsaytime']); $checked = (int) $add['checked']; $ismember = (int) $add['ismember']; $classid = (int) $add['classid']; $id = RepPostVar($add['id']); if (!$restb || !strstr($public_r['pldatatbs'], ',' . $restb . ',')) { printerror("EmptyDelMorePl", "history.go(-1)"); } $where = ''; //栏目 if ($classid) { if (empty($class_r[$classid][islast])) { $cwhere = ReturnClass($class_r[$classid][sonclass]); } else { $cwhere = "classid='{$classid}'"; } $where .= " and " . $cwhere; } //信息ID if ($id) { $idr = explode(',', $id); $ids = ''; $dh = ''; $count = count($idr); for ($i = 0; $i < $count; $i++) { $ids .= $dh . intval($idr[$i]); $dh = ','; } $where .= " and id in (" . $ids . ")"; } //是否会员 if ($ismember) { if ($ismember == 1) { $where .= " and userid=0"; } else { $where .= " and userid>0"; } } //发布者 if ($username) { $where .= " and username like '%{$username}%'"; } //发布IP if ($sayip) { $where .= " and sayip like '%{$sayip}%'"; } //发布内容 if ($saytext) { $twhere = ''; $or = ''; $tr = explode('|', $saytext); $count = count($tr); for ($i = 0; $i < $count; $i++) { $twhere .= $or . "saytext like '%" . $tr[$i] . "%'"; $or = ' or '; } $where .= ' and (' . $twhere . ')'; } //评论ID if ($endplid) { $where .= ' and plid BETWEEN ' . $startplid . ' and ' . $endplid; } //发布时间 if ($startsaytime && $endsaytime) { $startsaytime = to_time($startsaytime . ' 00:00:00'); $endsaytime = to_time($endsaytime . ' 23:59:59'); $where .= " and saytime>='{$startsaytime}' and saytime<='{$endsaytime}'"; } //是否审核 if ($checked) { $checkval = $checked == 1 ? 0 : 1; $where .= " and checked='{$checkval}'"; } if (!$where) { printerror("EmptyDelMorePl", "history.go(-1)"); } $where = substr($where, 5); $sql = $empire->query("select plid,id,classid,pubid from {$dbtbpre}enewspl_" . $restb . " where " . $where); $dh = ''; $b = 0; while ($r = $empire->fetch($sql)) { $b = 1; $startid = $r['plid']; if ($class_r[$r[classid]][tbname] && $r['pubid'] > 0) { $index_r = $empire->fetch1("select checked from {$dbtbpre}ecms_" . $class_r[$r[classid]][tbname] . "_index where id='{$r['id']}' limit 1"); //返回表 $infotb = ReturnInfoMainTbname($class_r[$r[classid]][tbname], $index_r['checked']); $empire->query("update " . $infotb . " set plnum=plnum-1 where id='{$r['id']}'"); } } $sql = $empire->query("delete from {$dbtbpre}enewspl_" . $restb . " where " . $where); insert_dolog("restb={$restb}"); //操作日志 printerror("DelPlSuccess", "DelMorePl.php" . hReturnEcmsHashStrHref2(1)); }
function DoWfInfo($add, $userid, $username) { global $empire, $dbtbpre, $class_r, $emod_r, $lur; $id = (int) $add[id]; $classid = (int) $add[classid]; $doing = (int) $add['doing']; if (!$id || !$classid || !$doing) { printerror('EmptyDoWfInfo', ''); } $wfinfor = $empire->fetch1("select id,checknum,wfid,tid,groupid,userclass,username,checktno from {$dbtbpre}enewswfinfo where id='{$id}' and classid='{$classid}' limit 1"); if (!$wfinfor[id]) { printerror('ErrorUrl', ''); } if ($wfinfor[checktno] == '100' || $wfinfor[checktno] == '101' || $wfinfor[checktno] == '102') { printerror('DoWfInfoOver', ''); } $wfitemr = $empire->fetch1("select tid,wfid,tno,groupid,userclass,username,lztype,tbdo,tddo,tstatus from {$dbtbpre}enewsworkflowitem where tid='{$wfinfor['tid']}'"); if (!(strstr(',' . $wfitemr[groupid] . ',', ',' . $lur[groupid] . ',') || strstr(',' . $wfitemr[userclass] . ',', ',' . $lur[classid] . ',') || strstr(',' . $wfitemr[username] . ',', ',' . $lur[username] . ','))) { printerror("NotDoCheckUserLevel", "history.go(-1)"); } if (!(strstr(',' . $wfinfor[groupid] . ',', ',' . $lur[groupid] . ',') || strstr(',' . $wfinfor[userclass] . ',', ',' . $lur[classid] . ',') || strstr(',' . $wfinfor[username] . ',', ',' . $lur[username] . ','))) { printerror("HaveDoWfInfo", "history.go(-1)"); } $pubid = ReturnInfoPubid($classid, $id); //附加链接参数 $addecmscheck = empty($_POST['ecmscheck']) ? '&ecmscheck=1' : ''; $checktext = ehtmlspecialchars($add[checktext]); if ($doing == 1) { if ($wfitemr[lztype] == 0) { if ($wfitemr['tno'] == '100') { $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index set checked=1 where id='{$id}'"); $ar = $empire->fetch1("select * from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check where id='{$id}'"); //未审核表转换 MoveCheckInfoData($class_r[$classid][tbname], 0, $ar['stb'], "id='{$id}'"); //更新栏目信息数 AddClassInfos($classid, '', '+1'); $empire->query("update {$dbtbpre}enewswfinfo set tstatus='',checktno='100' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $wfitemr[wfid], $wfitemr[tid], $username, $checktext, $wfinfor[checknum], 1); //生成 GetHtml($ar['classid'], $ar['id'], $ar, 1); ListHtml($classid, $fr, 0); } else { $newwfitemr = $empire->fetch1("select tid,wfid,tno,groupid,userclass,username,lztype,tbdo,tddo,tstatus from {$dbtbpre}enewsworkflowitem where wfid='{$wfitemr['wfid']}' and tno>{$wfitemr['tno']} order by tno limit 1"); $empire->query("update {$dbtbpre}enewswfinfo set tid='{$newwfitemr['tid']}',groupid='{$newwfitemr['groupid']}',userclass='{$newwfitemr['userclass']}',username='******'username']}',tstatus='{$newwfitemr['tstatus']}',checktno='0' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $newwfitemr[wfid], $newwfitemr[tid], $username, $checktext, $wfinfor[checknum], 1); } } else { $newgroupid = str_replace(',' . $lur[groupid] . ',', ',', $wfinfor[groupid]); $newuserclass = str_replace(',' . $lur[classid] . ',', ',', $wfinfor[userclass]); $newusername = str_replace(',' . $lur[username] . ',', ',', $wfinfor[username]); //下一个节点 if (($newgroupid == '' || $newgroupid == ',') && ($newuserclass == '' || $newuserclass == ',') && ($newusername == '' || $newusername == ',')) { if ($wfitemr['tno'] == '100') { $empire->query("update {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index set checked=1 where id='{$id}'"); $ar = $empire->fetch1("select * from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_check where id='{$id}'"); //未审核表转换 MoveCheckInfoData($class_r[$classid][tbname], 0, $ar['stb'], "id='{$id}'"); //更新栏目信息数 AddClassInfos($classid, '', '+1'); $empire->query("update {$dbtbpre}enewswfinfo set tstatus='',checktno='100' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $wfitemr[wfid], $wfitemr[tid], $username, $checktext, $wfinfor[checknum], 1); //生成 GetHtml($ar['classid'], $ar['id'], $ar, 1); ListHtml($classid, $fr, 0); } else { $newwfitemr = $empire->fetch1("select tid,wfid,tno,groupid,userclass,username,lztype,tbdo,tddo,tstatus from {$dbtbpre}enewsworkflowitem where wfid='{$wfitemr['wfid']}' and tno>{$wfitemr['tno']} order by tno limit 1"); $empire->query("update {$dbtbpre}enewswfinfo set tid='{$newwfitemr['tid']}',groupid='{$newwfitemr['groupid']}',userclass='{$newwfitemr['userclass']}',username='******'username']}',tstatus='{$newwfitemr['tstatus']}',checktno='0' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $newwfitemr[wfid], $newwfitemr[tid], $username, $checktext, $wfinfor[checknum], 1); } } else { $empire->query("update {$dbtbpre}enewswfinfo set groupid='{$newgroupid}',userclass='{$newuserclass}',username='******' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $wfitemr[wfid], $wfitemr[tid], $username, $checktext, $wfinfor[checknum], 1); } } $mess = 'DoWfInfoCkSuccess'; } elseif ($doing == 2) { if (empty($checktext)) { printerror('EmptyChecktext', 'history.go(-1)'); } if ($wfitemr[tbdo] == 0) { $empire->query("update {$dbtbpre}enewswfinfo set tid=0,tstatus='',checktno='101' where id='{$id}' and classid='{$classid}' limit 1"); } else { $newwfitemr = $empire->fetch1("select tid,wfid,tno,groupid,userclass,username,lztype,tbdo,tddo,tstatus from {$dbtbpre}enewsworkflowitem where wfid='{$wfitemr['wfid']}' and tid='{$wfitemr['tbdo']}' limit 1"); $empire->query("update {$dbtbpre}enewswfinfo set tid='{$newwfitemr['tid']}',groupid='{$newwfitemr['groupid']}',userclass='{$newwfitemr['userclass']}',username='******'username']}',tstatus='{$newwfitemr['tstatus']}',checktno='101' where id='{$id}' and classid='{$classid}' limit 1"); } //日志 InsertWfLog($classid, $id, $wfitemr[wfid], $wfitemr[tid], $username, $checktext, $wfinfor[checknum], 2); $mess = 'DoWfInfoTbSuccess'; } else { if (empty($checktext)) { printerror('EmptyChecktext', 'history.go(-1)'); } $empire->query("update {$dbtbpre}enewswfinfo set tid=0,tstatus='',checktno='102' where id='{$id}' and classid='{$classid}' limit 1"); //日志 InsertWfLog($classid, $id, $wfitemr[wfid], $wfitemr[tid], $username, $checktext, $wfinfor[checknum], 3); if ($wfitemr[tddo]) { $index_r = $empire->fetch1("select checked from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index where id='{$id}' limit 1"); //返回表 $infotb = ReturnInfoMainTbname($class_r[$classid][tbname], $index_r['checked']); $r = $empire->fetch1("select * from " . $infotb . " where id='{$id}' limit 1"); $mid = $class_r[$classid][modid]; $tbname = $class_r[$classid][tbname]; $pf = $emod_r[$mid]['pagef']; $stf = $emod_r[$mid]['savetxtf']; //返回表信息 $infotbr = ReturnInfoTbname($class_r[$classid][tbname], $index_r['checked'], $r['stb']); //分页字段 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]); //删除信息文件 $empire->query("delete from {$dbtbpre}ecms_" . $tbname . "_index where id='{$id}'"); $sql = $empire->query("delete from " . $infotbr['tbname'] . " where id='{$id}'"); $fsql = $empire->query("delete from " . $infotbr['datatbname'] . " where id='{$id}'"); //更新栏目信息数 AddClassInfos($r[classid], '-1', '-1', $index_r['checked']); //删除其它表记录与附件 DelSingleInfoOtherData($r['classid'], $id, $r, 0, 0); } $mess = 'DoWfInfoTdSuccess'; $isclose = 1; } //操作日志 insert_dolog("classid={$classid}&id={$id}", $pubid); printerror($mess, "workflow/DoWfInfo.php?classid={$classid}&id={$id}&isclose={$isclose}" . hReturnEcmsHashStrHref2(0)); }
function DoQTranFile($add, $file, $file_name, $file_type, $file_size, $userid, $username, $rnd, $ecms = 0) { global $empire, $dbtbpre, $class_r, $public_r, $ecms_config; if ($public_r['addnews_ok']) { $ecms != 1 ? printerror("NotOpenCQInfo", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotOpenCQInfo', '', ''); } $filepass = (int) $add['filepass']; $classid = (int) $add['classid']; $infoid = (int) $add['infoid']; if (!$file_name || !$filepass || !$classid || !$class_r[$classid][tbname]) { $ecms != 1 ? printerror("EmptyQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'EmptyQTranFile', '', ''); } //信息 if ($infoid) { $index_r = $empire->fetch1("select classid,checked from {$dbtbpre}ecms_" . $class_r[$classid][tbname] . "_index where id='{$infoid}'"); if (!$index_r['classid'] || $classid != $index_r['classid']) { $ecms != 1 ? printerror("EmptyQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'EmptyQTranFile', '', ''); } $infotb = ReturnInfoMainTbname($class_r[$classid][tbname], $index_r['checked']); $infor = $empire->fetch1("select classid,fstb from " . $infotb . " where id='{$infoid}'"); if (!$infor['fstb'] || $classid != $infor['classid']) { $ecms != 1 ? printerror("EmptyQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'EmptyQTranFile', '', ''); } $fstb = $infor['fstb']; } else { $fstb = $public_r['filedeftb']; } //验证权限 $userid = (int) $userid; $username = RepPostVar($username); $rnd = RepPostVar($rnd); DoQCheckAddLevel($classid, $userid, $username, $rnd, 0, 0); $filetype = GetFiletype($file_name); //取得文件类型 if (CheckSaveTranFiletype($filetype)) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } $type = (int) $add['type']; $pr = $empire->fetch1("select qaddtran,qaddtransize,qaddtranimgtype,qaddtranfile,qaddtranfilesize,qaddtranfiletype from {$dbtbpre}enewspublic limit 1"); if ($type == 1) { if (!$pr['qaddtran']) { $ecms != 1 ? printerror("CloseQTranPic", "", 9) : ECMS_QEditorPrintError(1, '', '', 'CloseQTranPic', '', ''); } if (!strstr($pr['qaddtranimgtype'], "|" . $filetype . "|")) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } if ($file_size > $pr['qaddtransize'] * 1024) { $ecms != 1 ? printerror("TooBigQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'TooBigQTranFile', '', ''); } if (!strstr($ecms_config['sets']['tranpicturetype'], ',' . $filetype . ',')) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } } elseif ($type == 2) { if (!$pr['qaddtranfile']) { $ecms != 1 ? printerror("CloseQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'CloseQTranFile', '', ''); } if (!strstr($pr['qaddtranfiletype'], "|" . $filetype . "|")) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } if ($file_size > $pr['qaddtranfilesize'] * 1024) { $ecms != 1 ? printerror("TooBigQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'TooBigQTranFile', '', ''); } if (!strstr($ecms_config['sets']['tranflashtype'], ',' . $filetype . ',')) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } } else { if (!$pr['qaddtranfile']) { $ecms != 1 ? printerror("CloseQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'CloseQTranFile', '', ''); } if (!strstr($pr['qaddtranfiletype'], "|" . $filetype . "|")) { $ecms != 1 ? printerror("NotQTranFiletype", "", 9) : ECMS_QEditorPrintError(1, '', '', 'NotQTranFiletype', '', ''); } if ($file_size > $pr['qaddtranfilesize'] * 1024) { $ecms != 1 ? printerror("TooBigQTranFile", "", 9) : ECMS_QEditorPrintError(1, '', '', 'TooBigQTranFile', '', ''); } } $r = DoTranFile($file, $file_name, $file_type, $file_size, $classid); if (empty($r[tran])) { $ecms != 1 ? printerror("TranFail", "", 9) : ECMS_QEditorPrintError(1, '', '', 'TranFail', '', ''); } //写入数据库 $filetime = time(); $r[filesize] = (int) $r[filesize]; $classid = (int) $classid; eInsertFileTable($r[filename], $r[filesize], $r[filepath], '[Member]' . $username, $classid, $r[filename], $type, $filepass, $filepass, $public_r[fpath], 0, 0, $fstb); //编辑器 if ($ecms == 1) { ECMS_QEditorPrintError(0, $r[url], $r[filename], '', $r[filename], $r[filesize]); } else { echo "<script>opener.document.add." . $add['field'] . ".value='" . $r['url'] . "';window.close();</script>"; } db_close(); $empire = null; exit; }
function GetInfoTranFstb($classid, $id, $fstb) { global $empire, $dbtbpre, $public_r, $class_r; if ($id) { $classid = (int) $classid; $id = (int) $id; if (!$classid || !$class_r[$classid]['tbname']) { return $public_r['filedeftb']; } $index_r = $empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . "_index where id='{$id}' limit 1"); if (!$index_r['id']) { return $public_r['filedeftb']; } //主表 $infotb = ReturnInfoMainTbname($class_r[$classid]['tbname'], $index_r['checked']); //返回表 $infor = $empire->fetch1("select fstb from " . $infotb . " where id='{$id}' limit 1"); $fstb = $infor['fstb']; } elseif ($fstb) { $fstb = eReturnFileStb($fstb); } else { $fstb = $public_r['filedeftb']; } $fstb = (int) $fstb; return $fstb; }
//取得用户组 $gr = $empire->fetch1("select doall,doselfinfo from {$dbtbpre}enewsgroup where groupid='{$user_r['groupid']}'"); //管理员 $where = ''; $and = ''; $ewhere = ''; $search = "&tbname={$tbname}" . $ecms_hashur['ehref']; $ecmscheck = (int) $_GET['ecmscheck']; $addecmscheck = ''; $indexchecked = 1; if ($ecmscheck) { $search .= '&ecmscheck=' . $ecmscheck; $addecmscheck = '&ecmscheck=' . $ecmscheck; $indexchecked = 0; } $infotb = ReturnInfoMainTbname($tbname, $indexchecked); //优化 $modid = $etable_r[$tbname][mid]; $yhadd = ''; $yhvar = 'hlist'; $yhid = $etable_r[$tbname][yhid]; if ($yhid) { $yhadd = ReturnYhSql($yhid, $yhvar); if ($yhadd) { $and = $where ? ' and ' : ' where '; $where .= $and . $yhadd; } } if (empty($yhadd)) { //时间范围 $infolday = (int) $_GET['infolday'];
function UpdateSingleInfoPlnum($classid, $id, $checked = 1) { global $empire, $dbtbpre, $class_r; $tbname = $class_r[$classid]['tbname']; if (empty($tbname)) { return ''; } $infotb = ReturnInfoMainTbname($tbname, $checked); $r = $empire->fetch1("select id,restb,plnum from " . $infotb . " where id='{$id}' limit 1"); if (empty($r['restb'])) { return ''; } $pubid = ReturnInfoPubid($classid, $id); $plnum = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspl_" . $r['restb'] . " where pubid='{$pubid}' limit 1"); if ($plnum == $r['plnum']) { return ''; } $empire->query("update " . $infotb . " set plnum='{$plnum}' where id='{$id}' limit 1"); }
} //替换表情 $saytext = RepPltextFace(stripSlashes($r['saytext'])); //专题 $title = ''; if ($r['pubid'] < 0) { $ztr['ztid'] = $r['classid']; $titleurl = sys_ReturnBqZtname($ztr); $title = "<a href='{$titleurl}' target='_blank'>" . $class_zr[$r['classid']]['ztname'] . "</a>"; $pagefunr = eReturnRewritePlUrl($r['classid'], 0, 'dozt', 0, 0, 1); $plurl = $pagefunr['pageurl']; } else { if ($class_r[$r[classid]][tbname]) { $index_r = $empire->fetch1("select checked from {$dbtbpre}ecms_" . $class_r[$r[classid]][tbname] . "_index where id='{$r['id']}' limit 1"); //返回表 $infotb = ReturnInfoMainTbname($class_r[$r[classid]][tbname], $index_r['checked']); $infor = $empire->fetch1("select isurl,titleurl,classid,id,title from " . $infotb . " where id='{$r['id']}' limit 1"); $titleurl = sys_ReturnBqTitleLink($infor); $title = "<a href='{$titleurl}' target='_blank'>" . stripSlashes($infor[title]) . "</a>"; } $pagefunr = eReturnRewritePlUrl($r['classid'], $r['id'], 'doinfo', 0, 0, 1); $plurl = $pagefunr['pageurl']; } ?> <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'" id=pl<?php echo $r[plid]; ?> > <td height="25" valign="top"> <div align="center"> <input name="plid[]" type="checkbox" id="plid" value="<?php echo $r[plid];
function ChangeDataTableF($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]; //建字段 if (empty($start)) { $field = ReturnTbFtype($fr); //返回字段 if ($fr[tbdataf]) { $empire->query("alter table {$dbtbpre}ecms_" . $tbname . " add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . " ADD INDEX(" . $fr[f] . ")"); } //归档主表 $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc ADD INDEX(" . $fr[f] . ")"); } //审核主表 $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_check add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_check ADD INDEX(" . $fr[f] . ")"); } } else { $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] . " add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_data_" . $dtbr[$i] . " ADD INDEX(" . $fr[f] . ")"); } } } //归档副表 $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_doc_data add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_doc_data ADD INDEX(" . $fr[f] . ")"); } //审核副表 $empire->query("alter table {$dbtbpre}ecms_" . $tbname . "_check_data add " . $field); if ($fr[iskey] == 1) { $empire->query("ALTER TABLE {$dbtbpre}ecms_" . $tbname . "_check_data ADD INDEX(" . $fr[f] . ")"); } } } $selectf = ''; if (empty($fr[tbdataf])) { $selectf = ',' . $fr[f]; } $b = 0; $sql = $empire->query("select id,checked from {$dbtbpre}ecms_" . $tbname . "_index where id>{$start} order by id limit " . $line); while ($r = $empire->fetch($sql)) { $b = 1; $newstart = $r['id']; //表名 $infotb = ReturnInfoMainTbname($tbname, $r['checked']); $infor = $empire->fetch1("select stb" . $selectf . " from " . $infotb . " where id='{$r['id']}'"); $infodatatb = ReturnInfoDataTbname($tbname, $r['checked'], $infor['stb']); if ($fr[tbdataf]) { $finfor = $empire->fetch1("select " . $f . " from " . $infodatatb . " where id='{$r['id']}'"); $value = $finfor[$f]; $empire->query("update " . $infotb . " set " . $f . "='" . StripAddsData($value) . "' where id='{$r['id']}'"); } else { $value = $infor[$f]; $empire->query("update " . $infodatatb . " set " . $f . "='" . StripAddsData($value) . "' where id='{$r['id']}'"); } } if (empty($b)) { 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}" . hReturnEcmsHashStrHref(0) . "\">" . $fun_r[AllChangeDataTableFSuccess]; exit; } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><meta http-equiv=\"refresh\" content=\"" . $public_r['realltime'] . ";url=ecmsmod.php?enews=ChangeDataTableF&tid={$tid}&tbname={$tbname}&fid={$fid}&line={$line}&start={$newstart}" . hReturnEcmsHashStrHref(0) . "\">" . $fun_r[OneChangeDataTableFSuccess] . "(ID:<font color=red><b>" . $newstart . "</b></font>)"; exit; }