This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/admin/debug/mod_tmpl.php
T
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

78 lines
2.4 KiB
PHP

<?php
//-------------------------------------------------------模板编辑
require "../config.php";
include "../../tmpl/config.php";
require THIS_FILE_ROOT."/include/function.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$msg="";
$is_submit=$_POST["is_submit"];
$col_name=$_POST["col_name"];
$_f=$_REQUEST["_f"];
$_file=get_last_path(THIS_FILE_ROOT)."/tmpl/".$_f.".php";
if(is_file($_file)){
$content=read_file($_file);
$content=dhtmlspecialchars($content);
}else{
$msg.="<span class=\"wrong\">文件不存在(".$_file.")!</span><br>";
}
if($is_submit=="y"){
//
$content=$_POST["content"];
write_file(get_last_path(THIS_FILE_ROOT)."/tmpl",$_f.".php",stripslashes(str_replace("\x0d\x0a", "\x0a", $content)));
$content=read_file($_file);
$content=dhtmlspecialchars($content);
$msg="保存成功(".date("Y-m-d H:i:s").")!";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>模板编辑</title>
<style>
BODY{
font-family:宋体;FONT-SIZE:12px;margin:0px;padding:0px;
}
a,a:link,a:visited,a:active {
text-decoration:none;COLOR: #0000ff;FONT-SIZE:12px;
}
a:hover {
TEXT-DECORATION: underline;COLOR: #aaaa9f;FONT-SIZE:12px;
}
body,input,td,select,div,li,ul,textarea,form {
font-family:宋体;
FONT-SIZE:12px;
}
.wrong{
color:#ff0000;font-weight:bold;
}
</style>
</head>
<body onload="this.focus();">
<br />
<table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#cccccc">
<form name="form1" action="" method="post">
<input type="hidden" name="is_submit" value="y">
<input type="hidden" name="_f" value="<?php echo $_f; ?>">
<tr>
<td align="left" bgcolor="#f0f0f0"><b>模板编辑-><?php echo get_main_value($arr_tmpl,$_f); ?></b></td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" style="line-height:25px;"></td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" style="line-height:25px;"><textarea name="content" style="width:100%;" rows="30"><?php echo $content; ?></textarea></td>
</tr>
<tr>
<td align="center" bgcolor="#f0f0f0"><input type="submit" value=" 保 存 "></td>
</tr>
<?php
if($msg){
echo "<tr><td align=\"left\" bgcolor=\"#ffffff\" valign=\"top\" style=\"line-height:150%;\">".$msg."</td></tr>";
}
?>
</form>
</table>
</body>
</html>