原帖由 flnsll 于 2020-02-14 08:55:39 发表 我最后还需要生成js文件(网站需要js文件),用自定义页面能行?
想问哪个文件控制js的输出格式? |
js格式的输出控制: 文件 e/class/functions.php
函数: //生成自定义js function ReUserjs($jsr,$addpath){ global $empire,$public_r; $jsfilepath=eReturnTrueEcmsPath().'e/data/'.$jsr['jsfilename'];//maddpath DoFileMkDir($jsfilepath);//建目录 eAutodo_AddDo('ReUserjs',$jsr['jsid'],0,0,0,0);//moreportdo //取得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=$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($jsfilepath,$allnew); }
|