📄 tem_edit.php
字号:
<?
require "inc/check.php";
require "inc/error.php";
//check_login();
?>
<html>
<head>
<script language="JavaScript">
function loadframes()
{
parent.leftFrame.location.href="tem_menu.php"
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px; scrollbar-face-color: ffffff; scrollbar-shadow-color: C1C1BB; scrollbar-highlight-color: C1C1BB; scrollbar-3dlight-color: EBEBE4; scrollbar-darkshadow-color: EBEBE4; scrollbar-track-color: F4F4F0; scrollbar-arrow-color: CACAB7
}
P {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
INPUT {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
FONT {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
SELECT {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
OPTION {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
TEXTAREA {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
FORM {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px
}
TD {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px; TABLE-LAYOUT: fixed; WORD-BREAK: break-all
}
A:link {
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline
}
A:active {
FONT-SIZE: 12px; TEXT-DECORATION: none
}
.border {
BACKGROUND-COLOR: #efefef; BORDER-BOTTOM: 1px dotted; BORDER-COLLAPSE: collapse; BORDER-LEFT: 1px dotted; BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; COLOR: #000000
}
.shadow1 {
COLOR: #ffffff; FILTER: dropshadow(color=#000000,offx=1,offy=1); FONT-SIZE: 12px
}
.shadow2 {
COLOR: #000000; FILTER: dropshadow(color=#d5d5d5,offx=1,offy=1); FONT-SIZE: 12px
}
.p1 {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
.p2 {
COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none
}
.p3 {
COLOR: #004080; FONT-SIZE: 14px; TEXT-DECORATION: none
}
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="loadframes()">
<?
if($sub){
if($fp = fopen("template/$old_temname.php", "w")){
$cont=stripslashes($cont);
fputs($fp, $cont);
fclose($fp);
// echo "$old_temname.php";
rename("template/$old_temname.php","template/$temname.php");
//写入list.txt
$url=file("list.txt");
$total=count($url);
$str="";
for($i=0;$i<$total;$i++)
{
$temp1=$old_temname."\n";
$temp2=$old_temname.EOF;
if(($url[$i]==$temp1)or($url[$i]==temp2)){
$str=$str.$temname."\n";
}
else{
$str=$str.$url[$i];
}
}
$fp=fopen("list.txt","w");
if(fputs($fp, $str)){
fclose($fp);
show_msg("修改成功!");
}
}
else{
show_msg("此摸板不存在!");
}
}
if($sub2)
{
show_msg("返回前页吗?");
}
?>
<?
if($temname=="")
{
show_msg("请先选择要编辑的模板!");
}
?>
<?
$name="template/$temname.php";
$fp=fopen($name,"r");
$cont = fread($fp, filesize($name));
fclose( $fp );
$cont=stripslashes($cont);
?>
<table width="80%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolor="#c0c0c0">
<tr bgcolor="">
<td class="head-2" height="27" bgcolor="#FFFFFF"><b><font size="2" color="#cae4ff"> </font></b>
<div align="center"><font color="#FFFFFF"><img src="images/edit.gif" width="18" height="13" border="0"><a href="tem_add.php">增加摸板</a>
<img src="images/edit.gif" width="18" height="13" border="0"><a href="tem_edit.php?temname=<?echo $temname;?>">编辑摸板</a>
<img src="images/edit.gif" width="18" height="13" border="0"><a href="tem_del.php?temname=<?echo $temname;?>">删除摸板</a>
<img src="images/edit.gif" width="18" height="13" border="0"><a href="template/<?echo rawurlencode($temname).".php";?>" target=_blank>模板预览</a></font></div>
</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td width="3%"> </td>
<td width="95%">
<div align="center">
<form name="form1" method="post" action="">
<p> </p>
<p>摸板名称:
<input type="text" name="temname" class=border value= <? echo $temname;?>>
<br>
<textarea name="cont" cols="100" rows="20" class=border><?echo $cont;?></textarea>
<br>
<br>
<input type="hidden" name="old_temname" value=<? echo $temname;?>>
<input type="submit" name="sub" value="提交模板" class=border>
</form>
<p align="left"> </p>
<table width="75%" border="0">
<tr>
<td width="35%"> </td>
<td width="61%"> </td>
<td width="4%"> </td>
</tr>
<tr>
<td><p>说明 :模板生成替换格式为:</p>
<p>栏目:%栏目%<br>
标题:%标题%<br>
作者:%作者% <br>
来源:%来源%<br>
提交人:%提交人%<br>
正文内容:%内容% <br>
加入时间:%时间% <br>
相关链接:%链接% </p></td>
<td valign="top">模板制作过程:<br>
<br>
在dreamweaver或者frontpage下编辑好页面, 用左边的替换词代替要显示的内容。<br>
然后将页面的源代码拷贝到上面即可。<br>
<br>
注意:图片要使用绝对路径。<br></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p align="left"><br>
</p>
</div>
<td width="2%"> </td>
</tr>
<tr>
<td width="3%"> </td>
<td width="95%"> </td>
<td width="2%"> </td>
</tr>
</table>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -