function ChangeClassForm() { global $empire, $dbtbpre; $file = '../data/html/classaddform.php'; $mtemp = ''; $sql = $empire->query("select fname,f,fhtml from {$dbtbpre}enewsclassf order by myorder,fid"); while ($r = $empire->fetch($sql)) { $mtemp .= "<tr bgcolor='#FFFFFF' height=25><td>" . $r['fname'] . "</td><td>" . $r['fhtml'] . "</td></tr>"; } $mtemp = "<?php\r\nif(!defined('InEmpireCMS'))\r\n{exit();}\r\n?>" . $mtemp; WriteFiletext($file, $mtemp); }
<td bgcolor="#FFFFFF"> <div align="left"> <input name="textfield5" type="text" value="<?php echo $public_r[newsurl]; ?> search"> [<a href="../../search" target="_blank">预览</a>]</div></td> </tr> <tr> <td height="24" bgcolor="#FFFFFF"> <div align="center">控制面板地址</div></td> <td height="24" bgcolor="#FFFFFF"> <input name="textfield52" type="text" value="<?php echo $public_r[newsurl]; ?> e/member/cp"> [<a href="../member/cp" target="_blank">预览</a>]</td> <td bgcolor="#FFFFFF"><div align="center"></div></td> <td bgcolor="#FFFFFF"><div align="center"></div></td> </tr> <tr class="header"> <td height="25" colspan="4">js调用方式:<script src=js地址></script></td> </tr> </table> </body> </html> <?php db_close(); $empire = null; $string = @ob_get_contents(); WriteFiletext($fcfile, AddCheckViewTempCode() . $string);
function ChangeMemberForm($fid, $mtemp) { global $empire, $dbtbpre; $file = "../data/html/memberform" . $fid . ".php"; $sql = $empire->query("select f,fhtml from {$dbtbpre}enewsmemberf"); while ($r = $empire->fetch($sql)) { $mtemp = str_replace("[!--" . $r[f] . "--]", $r[fhtml], $mtemp); } $mtemp = "<?php\nif(!defined('InEmpireCMS'))\n{exit();}\n?>" . $mtemp; WriteFiletext($file, $mtemp); }
function ReSchAlltemp() { global $empire, $public_r, $fun_r, $dbtbpre; $tfile = "../data/template/schalltemp.txt"; $file = "../sch/index.php"; $temp = ReadFiletext($tfile); //取得页面模板 $pr = $empire->fetch1("select schalltemp,schallsubnum,schalldate from " . GetTemptb("enewspubtemp") . " limit 1"); $url = "<?=\$url?>"; $pagetitle = $fun_r['SearchAllNav']; $pr['schalltemp'] = ReplaceSvars($pr['schalltemp'], $url, 0, $pagetitle, $pagetitle, $pagetitle, $add, 1); $temp = str_replace("<!--empire.listtemp.subnum-->", $pr['schallsubnum'], $temp); $temp = str_replace("<!--empire.listtemp.formatdate-->", $pr['schalldate'], $temp); $pr['schalltemp'] = str_replace("[!--keyboard--]", "<?=\$keyboard?>", $pr['schalltemp']); $pr['schalltemp'] = str_replace("[!--num--]", "<?=\$num?>", $pr['schalltemp']); $pr['schalltemp'] = str_replace("[!--listpage--]", "<?=\$listpage?>", $pr['schalltemp']); $listtemp_r = explode("[!--empirenews.listtemp--]", $pr['schalltemp']); $temp = str_replace("<!--empire.listtemp.top-->", $listtemp_r[0], $temp); $temp = str_replace("<!--empire.listtemp.footer-->", $listtemp_r[2], $temp); //---列表中间 $listtemp_center = str_replace("[!--no.num--]", "<?=\$no?>", $listtemp_r[1]); $listtemp_center = str_replace("[!--titleurl--]", "<?=\$titleurl?>", $listtemp_center); $listtemp_center = str_replace("[!--id--]", "<?=\$r[id]?>", $listtemp_center); $listtemp_center = str_replace("[!--classid--]", "<?=\$r[classid]?>", $listtemp_center); $listtemp_center = str_replace("[!--titlepic--]", "<?=\$titlepic?>", $listtemp_center); $listtemp_center = str_replace("[!--newstime--]", "<?=\$newstime?>", $listtemp_center); $listtemp_center = str_replace("[!--title--]", "<?=\$title?>", $listtemp_center); $listtemp_center = str_replace("[!--smalltext--]", "<?=\$smalltext?>", $listtemp_center); $temp = str_replace("<!--empire.listtemp.center-->", $listtemp_center, $temp); WriteFiletext($file, $temp); }
//登陆状态模板 ReSchAlltemp(); //全站搜索模板 //生成首页 $indextemp = GetIndextemp(); NewsBq(0, $indextemp, 1, 0); //--- 更新反馈表单 --- $sql = $empire->query("select bid,btemp from {$dbtbpre}enewsfeedbackclass order by bid"); while ($r = $empire->fetch($sql)) { //替换公共变量 $btemp = ReplaceTempvar($r['btemp']); $btemp = str_replace("[!--cp.header--]", "<? include(\"../../data/template/cp_1.php\");?>", $btemp); $btemp = str_replace("[!--cp.footer--]", "<? include(\"../../data/template/cp_2.php\");?>", $btemp); $file = "../tool/feedback/temp/feedback" . $r[bid] . ".php"; $btemp = "<?\r\nif(!defined('InEmpireCMS'))\r\n{exit();}\r\n?>" . $btemp; WriteFiletext($file, $btemp); } //--- 评论表情文件 --- InstallGetPlfaceJs(); echo "更新文件完毕.<script>self.location.href='index.php?enews=success&f=6&defaultdata={$defaultdata}';</script>"; exit; } else { GetConfig(1); //更新参数设置 GetClass(); //更新栏目 GetMemberLevel(); //更新会员组 GetSearchAllTb(); //更新全站搜索数据表 echo "更新数据库缓存完毕.<script>self.location.href='changedata.php?ecms=ChangeInstallOtherData&defaultdata={$defaultdata}';</script>";
function ChangeMCj($mid, $tid, $cj) { global $empire, $dbtbpre; $record = "<!--record-->"; $field = "<!--field--->"; //读取修改采集表单 $data = "<tr><td bgcolor=ffffff>[!--enews.name--]</td><td bgcolor=ffffff>[!--enews.var--]</td></tr>"; $file1 = "../data/html/editcj" . $mid . ".php"; $file = "../data/html/cj" . $mid . ".php"; $r = explode($record, $cj); for ($i = 0; $i < count($r) - 1; $i++) { $r1 = explode($field, $r[$i]); $fr = $empire->fetch1("select cjhtml,fhtml from {$dbtbpre}enewsf where f='{$r1['1']}' and tid='{$tid}' limit 1"); $cjtemp = str_replace("[!--enews.name--]", $r1[0], $fr[cjhtml]); $str .= $cjtemp; $editcjtemp = str_replace("[!--enews.name--]", $r1[0], $data); $editcjtemp = str_replace("[!--enews.var--]", $fr[fhtml], $editcjtemp); $editcj .= $editcjtemp; } WriteFiletext($file, AddCheckViewTempCode() . $str); WriteFiletext($file1, AddCheckViewTempCode() . $editcj); }
function PreviewIndexpage($tempid, $userid, $username) { global $empire, $dbtbpre, $public_r, $emod_r, $class_r, $class_zr, $fun_r, $navclassid, $navinfor, $class_tr, $level_r, $etable_r; //验证权限 CheckLevel($userid, $username, $classid, "template"); $tempid = (int) $tempid; if (!$tempid) { printerror('ErrorUrl', ''); } $tempr = $empire->fetch1("select tempid,temptext from {$dbtbpre}enewsindexpage where tempid='{$tempid}'"); if (!$tempr['tempid']) { printerror('ErrorUrl', ''); } $indextext = stripSlashes($tempr['temptext']); $indextext = ReplaceTempvar($indextext); //替换全局模板变量 $pr = $empire->fetch1("select sitekey,siteintro from {$dbtbpre}enewspublic limit 1"); //页面 $pagetitle = ehtmlspecialchars($public_r['sitename']); $pagekey = ehtmlspecialchars($pr['sitekey']); $pagedes = ehtmlspecialchars($pr['siteintro']); $url = "<a href=\"" . ReturnSiteIndexUrl() . "\">" . $fun_r['index'] . "</a>"; //栏目导航 $onclick = ''; $file = ECMS_PATH . DASHBOARD . '/data/tmp/indexpage' . $tempid . '.php'; $indextext = ReplaceSvars($indextext, $url, 0, $pagetitle, $pagekey, $pagedes, $add, 0); $indextext = str_replace("[!--page.stats--]", $onclick, $indextext); //替换标签 $indextext = DoRepEcmsLoopBq($indextext); $indextext = RepBq($indextext); //写文件 WriteFiletext($file, AddCheckViewTempCode() . $indextext); //读取文件内容 ob_start(); include $file; $string = ob_get_contents(); ob_end_clean(); $string = RepExeCode($string); //解析代码 echo stripSlashes($string); exit; }
function ReFeedbackClassFile($bid) { global $empire, $dbtbpre; $r = $empire->fetch1("select btemp from {$dbtbpre}enewsfeedbackclass where bid='{$bid}'"); //替换公共变量 $url = "<?=\$url?>"; $pagetitle = "<?=\$bname?>"; $btemp = ReplaceSvars($r['btemp'], $url, 0, $pagetitle, $pagetitle, $pagetitle, $add, 1); $btemp = str_replace("[!--cp.header--]", "<? include(\"../../data/template/cp_1.php\");?>", $btemp); $btemp = str_replace("[!--cp.footer--]", "<? include(\"../../data/template/cp_2.php\");?>", $btemp); $file = "../../tool/feedback/temp/feedback" . $bid . ".php"; $btemp = "<?\r\nif(!defined('InEmpireCMS'))\r\n{exit();}\r\n?>" . $btemp; WriteFiletext($file, $btemp); }
if (stristr($enews, ',doinfo,')) { if (!HaveNavClassCache("navtype='listenews'")) { if (empty($cacher['listenews'])) { $cacher['listenews'] = $notrecordword; } $infofcfile = '../data/fc/ListEnews.php'; WriteFiletext($infofcfile, AddCheckViewTempCode() . $cacher['listenews']); InsertNavClassCache('listenews', 0, 0); } } //用户信息缓存 if (stristr($enews, ',douserinfo,')) { if ($userid) { if (!HaveNavClassCache("navtype='userenews' and userid='{$userid}'")) { $userinfofcfile = '../data/fc/ListEnews' . $userid . '.php'; WriteFiletext($userinfofcfile, AddCheckViewTempCode() . $cacher['userenews']); $userinfojsfile = '../data/fc/userclass' . $userid . '.js'; WriteFiletext_n($userinfojsfile, "document.write(\"" . addslashes($cacher['userjs']) . "\");"); InsertNavClassCache('userenews', $userid, 0); } } } //------ JS ------ if (stristr($enews, ',doinfo,')) { if (!HaveNavClassCache("navtype='jsclass'")) { $jsfile = "../data/fc/cmsclass.js"; $search_jsfile = "../data/fc/searchclass.js"; $search_jsstr = str_replace(" style='background:" . $public_r['chclasscolor'] . "'", "", $cacher['jsstr']); WriteFiletext_n($jsfile, "document.write(\"" . addslashes($cacher['jsstr']) . "\");"); WriteFiletext_n($search_jsfile, "document.write(\"" . addslashes($search_jsstr) . "\");"); InsertNavClassCache('jsclass', 0, 0);