function ReSingleJs($classid, $doing = 0) { global $empire, $dbtbpre; $classid = (int) $classid; //刷新栏目 if ($doing == 0) { $r = $empire->fetch1("select classid,newline,hotline,goodline,hotplline,firstline,jstempid from {$dbtbpre}enewsclass where classid='{$classid}'"); $jstemptext = GetTheJstemp($r[jstempid]); //js模板 GetNewsJs($r[classid], $r[newline], $r[newstrlen], $r[newshowdate], 0, $jstemptext); GetNewsJs($r[classid], $r[hotline], $r[hotstrlen], $r[hotshowdate], 1, $jstemptext); GetNewsJs($r[classid], $r[goodline], $r[goodstrlen], $r[goodshowdate], 2, $jstemptext); GetNewsJs($r[classid], $r[hotplline], $r[hotplstrlen], $r[hotplshowdate], 9, $jstemptext); GetNewsJs($r[classid], $r[firstline], $r[firststrlen], $r[firstshowdate], 12, $jstemptext); } elseif ($doing == 1) { $r = $empire->fetch1("select typeid,newline,hotline,goodline,hotplline,firstline,jstempid from {$dbtbpre}enewsinfotype where typeid='{$classid}'"); $jstemptext = GetTheJstemp($r[jstempid]); //js模板 GetNewsJs($r[typeid], $r[newline], $r[newstrlen], $r[newshowdate], 25, $jstemptext); GetNewsJs($r[typeid], $r[hotline], $r[hotstrlen], $r[hotshowdate], 26, $jstemptext); GetNewsJs($r[typeid], $r[goodline], $r[goodstrlen], $r[goodshowdate], 27, $jstemptext); GetNewsJs($r[typeid], $r[hotplline], $r[hotplstrlen], $r[hotplshowdate], 28, $jstemptext); GetNewsJs($r[typeid], $r[firstline], $r[firststrlen], $r[firstshowdate], 29, $jstemptext); } else { } insert_dolog(""); //操作日志 printerror("ReJsSuccess", "history.go(-1)"); }
function ReUserjs($jsr, $addpath) { global $empire, $public_r; DoFileMkDir($addpath . $jsr['jsfilename']); //建目录 //取得js模板 $jstemptext = GetTheJstemp($jsr[jstempid]); $ret_r = ReturnReplaceListF($jstemptext[modid]); //字段 $jstemptext[temptext] = str_replace('[!--news.url--]', $public_r[newsurl], $jstemptext[temptext]); $temp_r = explode("[!--empirenews.listtemp--]", $jstemptext[temptext]); $query = stripSlashes($jsr[jssql]); $query = RepSqlTbpre($query); $sql = $empire->query($query); $no = 1; while ($r = $empire->fetch($sql)) { $r[oldtitle] = $r[title]; //替换列表变量 $repvar = ReplaceListVars($no, $temp_r[1], $jstemptext[subnews], $jstemptext[subtitle], $jstemptext[showdate], $url, 0, $r, $ret_r); $allnew .= $repvar; $no++; } $allnew = "document.write(\"" . addslashes(stripSlashes(str_replace("\r\n", "", $temp_r[0] . $allnew . $temp_r[2]))) . "\");"; WriteFiletext_n($addpath . $jsr['jsfilename'], $allnew); }