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 UpdateAllInfoPlnum($add, $userid, $username) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre; //验证权限 CheckLevel($userid, $username, $classid, "changedata"); $start = (int) $add['start']; $tbname = RepPostVar($add['tbname']); $from = $add['from']; if (empty($tbname) || !eCheckTbname($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } //按栏目刷新 $classid = (int) $add['classid']; if ($classid) { if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $add1 = " and (" . $where . ")"; } //按ID刷新 $retype = (int) $add['retype']; if ($retype) { $startid = (int) $add['startid']; $endid = (int) $add['endid']; if ($endid) { $add1 .= " and id>={$startid} and id<={$endid}"; } } else { $startday = RepPostVar($add['startday']); $endday = RepPostVar($add['endday']); if ($startday && $endday) { $add1 .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); } } //指定ID $doids = trim($add['doids']); $whereid = ''; if ($doids) { $doidr = explode(',', $doids); $doidcount = count($doidr); $wheredh = ''; for ($doi = 0; $doi < $doidcount; $doi++) { $whereid .= $wheredh . intval($doidr[$doi]); $wheredh = ','; } $add1 .= ' and id in (' . $whereid . ')'; } $b = 0; $sql = $empire->query("select id,classid,checked from {$dbtbpre}ecms_" . $tbname . "_index where id>{$start}" . $add1 . " order by id limit " . $public_r[infolinknum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r['id']; //更信息评论数 UpdateSingleInfoPlnum($r['classid'], $r['id'], $r['checked']); } if (empty($b)) { insert_dolog(""); //操作日志 printerror("UpdateInfoPlnumSuccess", $from); } echo $fun_r[OneUpdateInfoPlnumSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)<script>self.location.href='ecmspl.php?enews=UpdateAllInfoPlnum&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}&doids={$whereid}" . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
function ReNewsHtml($start, $classid, $from, $retype, $startday, $endday, $startid, $endid, $tbname, $havehtml) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre, $etable_r; $tbname = RepPostVar($tbname); if (empty($tbname) || !eCheckTbname($tbname)) { printerror("ErrorUrl", "history.go(-1)"); } $start = (int) $start; //按ID if ($retype) { $startid = (int) $startid; $endid = (int) $endid; $add1 = $endid ? ' and id>=' . $startid . ' and id<=' . $endid : ''; } else { $startday = RepPostVar($startday); $endday = RepPostVar($endday); $add1 = $startday && $endday ? ' and truetime>=' . to_time($startday . ' 00:00:00') . ' and truetime<=' . to_time($endday . ' 23:59:59') : ''; } //按栏目 $classid = (int) $classid; if ($classid) { $where = empty($class_r[$classid][islast]) ? ReturnClass($class_r[$classid][sonclass]) : "classid='{$classid}'"; $add1 .= ' and ' . $where; } //不生成 $add1 .= ReturnNreInfoWhere(); //是否重复生成 $updatehavehtml = 'havehtml=0'; if ($havehtml != 1) { $add1 .= ' and havehtml=0'; $updatehavehtml = ''; } //优化 $yhadd = ''; $yhid = $etable_r[$tbname][yhid]; $yhvar = 'rehtml'; if ($yhid) { $yhadd = ReturnYhSql($yhid, $yhvar, 1); } $b = 0; $sql = $empire->query("select id,classid from {$dbtbpre}ecms_" . $tbname . "_index where " . $yhadd . "id>{$start}" . $add1 . " and checked=1 order by id limit " . $public_r[renewsnum]); while ($r = $empire->fetch($sql)) { $b = 1; $new_start = $r[id]; if ($class_r[$r[classid]][showdt] == 2) { continue; } GetHtml($r['classid'], $r['id'], '', 0, 1); //生成信息文件 } if (empty($b)) { //更新状态 if ($yhadd . $add1 == '') { $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set havehtml=1 where havehtml=0 and checked=1"); $empire->query("update {$dbtbpre}ecms_" . $tbname . " set havehtml=1 where havehtml=0"); } else { if ($updatehavehtml) { $updatehavehtml = ' and ' . $updatehavehtml; } if ($yhadd && $add1) { $truewhereindex = $yhadd . substr($add1, 5) . ' and checked=1'; $truewhere = $yhadd . substr($add1, 5); } elseif ($yhadd && !$add1) { $truewhereindex = $yhadd . 'checked=1'; $truewhere = substr($yhadd, 0, -5); } else { $truewhereindex = substr($add1, 5) . ' and checked=1'; $truewhere = substr($add1, 5); } $empire->query("update {$dbtbpre}ecms_" . $tbname . "_index set havehtml=1 where " . $truewhereindex . $updatehavehtml); $empire->query("update {$dbtbpre}ecms_" . $tbname . " set havehtml=1 where " . $truewhere . $updatehavehtml); } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><center><b>" . $tbname . $fun_r[ReTableIsOK] . "!</b></center>"; db_close(); $empire = null; exit; } echo "<link rel=\"stylesheet\" href=\"../data/images/css.css\" type=\"text/css\"><meta http-equiv=\"refresh\" content=\"" . $public_r['realltime'] . ";url=ecmschtml.php?enews=ReNewsHtml&tbname={$tbname}&classid={$classid}&start={$new_start}&from=" . urlencode($from) . "&retype={$retype}&startday={$startday}&endday={$endday}&startid={$startid}&endid={$endid}&havehtml={$havehtml}&reallinfotime=" . ehtmlspecialchars($_GET['reallinfotime']) . hReturnEcmsHashStrHref(0) . "\">" . $fun_r[OneReNewsHtmlSuccess] . "(ID:<font color=red><b>" . $new_start . "</b></font>)"; exit; }
function ChangeInfoOtherLink($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)"); } //按栏目刷新 $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[infolinknum]); while($r=$empire->fetch($sql)) { $b=1; $new_start=$r[id]; //手动相关链接 $pubid=ReturnInfoPubid($r['classid'],$r['id']); $infopr=$empire->fetch1("select diyotherlink from {$dbtbpre}enewsinfovote where pubid='$pubid' limit 1"); if($infopr['diyotherlink']) { continue; } //返回表 $infotb=ReturnInfoMainTbname($tbname,$r['checked']); $infor=$empire->fetch1("select stb,keyboard from ".$infotb." where id='$r[id]' limit 1"); //返回表信息 $infodatatb=ReturnInfoDataTbname($tbname,$r['checked'],$infor['stb']); $newkeyid=GetKeyid($infor[keyboard],$r[classid],$r[id],$class_r[$r[classid]][link_num]); $usql=$empire->query("update ".$infodatatb." set keyid='$newkeyid' where id='$r[id]' limit 1"); } if(empty($b)) { insert_dolog("");//操作日志 printerror("ChangeInfoLinkSuccess",$from); } echo $fun_r[OneChangeInfoLinkSuccess]."(ID:<font color=red><b>".$new_start."</b></font>)<script>self.location.href='ecmscom.php?enews=ChangeInfoOtherLink&tbname=$tbname&classid=$classid&start=$new_start&from=".urlencode($from)."&retype=$retype&startday=$startday&endday=$endday&startid=$startid&endid=$endid".hReturnEcmsHashStrHref(0)."';</script>"; exit(); }