function PushInfoToZt($add,$userid,$username){ global $empire,$dbtbpre,$class_r; $classid=(int)$add['classid']; $tid=(int)$add['tid']; $ztid=$add['ztid']; $cid=$add['cid']; $id=$add['id']; $count=count($ztid); if(!$count||!$id) { echo"<script>window.close();</script>"; exit(); } //表名 $tbname=''; if($classid) { $tbname=$class_r[$classid]['tbname']; } elseif($tid) { $tbr=$empire->fetch1("select tbname from {$dbtbpre}enewstable where tid='$tid'"); $tbname=$tbr['tbname']; } if(!$tbname) { printerror('ErrorUrl',''); } //ID $id=eReturnInids($id); $where='id in ('.$id.')'; $ztids=''; $zcids=''; for($i=0;$i<$count;$i++) { $true_ztid=(int)$ztid[$i]; if(!$true_ztid) { continue; } $true_cid=(int)$cid[$true_ztid]; if($true_cid<0) { $true_cid=0; } $ztids.=$dh.$true_ztid; $dh=','; AddMoreInfoToZt($true_ztid,$true_cid,$tbname,$where,1); } //操作日志 insert_dolog("classid=$classid&tid=$tid<br>ztid=".$ztids."<br>id=".$id); echo"<script>alert('推送成功');window.close();</script>"; exit(); }
function ReListTtHtmlMore($start, $classid, $from) { global $empire, $public_r, $fun_r, $class_r, $dbtbpre; $start = (int) $start; $classid = eReturnInids($classid); if (empty($classid)) { printerror("ErrorUrl", $from); } $b = 0; //刷新标题分类 $tsql = $empire->query("select typeid from {$dbtbpre}enewsinfotype where typeid>{$start} and typeid in (" . $classid . ") order by typeid limit " . $public_r[relistnum]); while ($t_r = $empire->fetch($tsql)) { $b = 1; ListHtml($t_r[typeid], $ret_r, 5); $end_classid = $t_r[typeid]; } if (empty($b)) { //操作日志 insert_dolog(""); printerror("ReTtidAllSuccess", $from); } echo $fun_r[OneReTtListNewsSuccess] . "(ZtID:<font color=red><b>" . $end_classid . "</b></font>)<script>self.location.href='ecmschtml.php?enews=ReListTtHtmlMore&start={$end_classid}&classid={$classid}&from=" . urlencode($from) . hReturnEcmsHashStrHref(0) . "';</script>"; exit; }
function TogZt($add, $userid, $username) { global $empire, $class_r, $dbtbpre; $ztid = (int) $add['ztid']; if (empty($ztid)) { printerror("ErrorUrl", "history.go(-1)"); } $r = $empire->fetch1("select ztid,ztname from {$dbtbpre}enewszt where ztid='{$ztid}'"); if (empty($r['ztid'])) { printerror("ErrorUrl", "history.go(-1)"); } $zcid = (int) $add['zcid']; $tbname = RepPostVar($add['tbname']); if (!$tbname) { printerror('EmptyTogZt', 'history.go(-1)'); } $tbr = $empire->fetch1("select tid from {$dbtbpre}enewstable where tbname='{$tbname}' limit 1"); if (!$tbr['tid']) { printerror('EmptyTogZt', 'history.go(-1)'); } $wheresql = ""; $formvar = ""; //关键字 $keyboard = RepPostVar2($add['keyboard']); if ($keyboard) { $formvar .= ReturnFormHidden('keyboard', $add['keyboard']); $searchfsql = ''; if ($add['stitle']) { $searchfsql .= "title like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('stitle', $add['stitle']); } if ($add['susername']) { if ($searchfsql) { $or = " or "; } $searchfsql .= $or . "username like '%{$keyboard}%'"; $formvar .= ReturnFormHidden('susername', $add['susername']); } if ($searchfsql) { $wheresql = " and (" . $searchfsql . ")"; } } //是否推荐 if ($add['isgood']) { $wheresql .= " and isgood>0"; $formvar .= ReturnFormHidden('isgood', $add['isgood']); } //头条 if ($add['firsttitle']) { $wheresql .= " and firsttitle>0"; $formvar .= ReturnFormHidden('firsttitle', $add['firsttitle']); } //有标题图片 if ($add['titlepic']) { $wheresql .= " and ispic=1"; $formvar .= ReturnFormHidden('titlepic', $add['titlepic']); } //按栏目刷新 $classid = (int) $add['classid']; if ($classid) { $formvar .= ReturnFormHidden('classid', $classid); if (empty($class_r[$classid][islast])) { $where = ReturnClass($class_r[$classid][sonclass]); } else { $where = "classid='{$classid}'"; } $wheresql .= " and (" . $where . ")"; } $startid = (int) $add[startid]; $endid = (int) $add[endid]; $startday = RepPostVar($add[startday]); $endday = RepPostVar($add[endday]); $formvar .= ReturnFormHidden('retype', $add['retype']); //按ID if ($add['retype']) { if ($endid) { $wheresql .= " and id>={$startid} and id<={$endid}"; $formvar .= ReturnFormHidden('startid', $add[startid]) . ReturnFormHidden('endid', $add[endid]); } } else { if ($startday && $endday) { $wheresql .= " and truetime>=" . to_time($startday . " 00:00:00") . " and truetime<=" . to_time($endday . " 23:59:59"); $formvar .= ReturnFormHidden('startday', $add[startday]) . ReturnFormHidden('endday', $add[endday]); } } //附件sql条件 $query = $add['query']; if ($query) { $query = ClearAddsData($query); //去除adds $wheresql .= " and (" . $query . ")"; $formvar .= ReturnFormHidden('query', $add['query']); } if (empty($wheresql)) { printerror('EmptyTogZt', 'history.go(-1)'); } $wheresql = substr($wheresql, 5); if ($add['doecmszt']) { $togtype = (int) $add['togtype']; if ($togtype == 1) { $add['inid'] = eReturnInids($add['inid']); $wheresql = "id in (" . $add['inid'] . ")"; } else { if ($add['inid']) { $add['inid'] = eReturnInids($add['inid']); $wheresql .= " and id not in (" . $add['inid'] . ")"; } } AddMoreInfoToZt($ztid, $zcid, $tbname, $wheresql); //操作日志 insert_dolog("ztid={$ztid}&ztname={$r['ztname']}"); printerror("TogZtSuccess", "TogZt.php?ztid={$ztid}" . hReturnEcmsHashStrHref2(0)); } $re[0] = $wheresql; $re[1] = $formvar . ReturnFormHidden('ztid', $ztid) . ReturnFormHidden('zcid', $zcid) . ReturnFormHidden('tbname', $tbname) . ReturnFormHidden('pline', $add[pline]) . ReturnFormHidden('doecmszt', $add[doecmszt]) . ReturnFormHidden('enews', $add[enews]) . ReturnFormHidden('inid', $add[inid]); $re[2] = $tbname; $re[3] = $r['ztname']; return $re; }