<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock
set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
myname=cschat.myname
set cschat=nothing
application.unlock

if my_level-application( ConstStr & "_superlevel")<>0 then response.end
%>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'><META content="text/html; charset=gb2312" http-equiv=content-type>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>p{color:#000000;text-align:left;margin-left:10px;margin-right:20px;margin-top:10px;margin-bottom:0px}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=3 >
  <table cellspacing=0 cellpadding=0 align=center width=100% height=100%>
  <tr><td valign=center>
  <table width=80% cellspacing=0 cellpadding=0 style="border:'1px solid navy'">
  <tr><td class=navy2>在线HTML编辑</td></tr>
<%
Set fs=CreateObject("Scripting.FileSystemObject")
datapath=Server.Mappath("data")
if request("cmdYes")="提交" then%><tr><td><p><center>
  <%htmlfile=request.form("htmlfile")
  if lcase(right(fn,4))=".htm" then
     response.write "您只能保存为*.htm格式的文件名！</center>"
  else
   filebody=Split(request.form("filebody"),chr(13)&chr(10))
   Set f = fs.CreateTextFile(datapath & "\" & htmlfile,true)
   for i=0 to ubound(filebody)
     filebody(i)=Trim(filebody(i))
     if not filebody(i)="" then f.WriteLine(filebody(i))
   next
   f.close
   Set f=nothing
   response.write "您成功的将修改保存至"&htmlfile&"！</center>"
 end if
elseif request("cmdYes")="选择" then%>
  <form action=edithtml.asp method=post onsubmit="return confirm('如果文件'+this.htmlfile.value+'存在，您将会覆盖它！请确认！');"><tr><td><p>
  <%htmlfile=request.form("htmlfile")
   if lcase(right(fn,4))=".htm" then
     response.write "在线HTML编辑只提供对data目录下的*.htm文件进行编辑！"
   elseif fs.FileExists(datapath & "\" & htmlfile) =false then
     response.write "您选择的文件"&htmlfile&"并不存在！"
   else%>
     您正在修改的文件是:<%=htmlfile%>。</p><p><font color=red>预览</font>如果使用相对路径指明样式表(.css)，预览效果和实际有差异！</p>
     <p>保存文件名：<input type=text name="htmlfile" value='<%=htmlfile%>' ></p>
      <p><center><textarea name="filebody" cols="60" rows="15" wrap="OFF"><%Set f = fs.OpenTextFile(datapath & "\" & htmlfile)
  if not f.AtEndOfStream then
    response.write Replace(Replace(Replace(f.readall, "&", "&amp;"), "<", "&lt;"), ">", "&gt;")
  end if
  f.close
  Set f=nothing
%></textarea></center></p>
 <p><center><input class=navy1 type=submit name=cmdYes value='提交' onclick="document.forms[0].action='edithtml.asp';document.forms[0].target='_self';">
 <input class=navy1 type=button name=preview value='预览' onclick="document.forms[0].action='preview.asp';document.forms[0].target='_blank';document.forms[0].submit();" >
  <input class=navy1 type=reset name=cmdcancel value=重置 ></center></p>
   <%end if
else%><form action=edithtml.asp method=post ><tr><td>
  <p><font color=red>在线HTML编辑器</font>让您可以对data目录下的*.htm进行简单的文本编辑。用于更新您上传到data下的简单html页面。请选择您要编辑的文件：</p>
  <p><center>
  <select name="htmlfile" size=10>
<%Set f=fs.GetFolder(datapath)
Set fc=f.Files
For Each f1 in fc
fn=f1.name
if lcase(right(fn,4))=".htm" then
 response.write "<option value='"&fn &"'>" & fn & "</option>"
end if
next
Set fc=nothing%></select>
  </center></p>
  <p><center><input class=navy1 type=submit name=cmdYes value='选择' >
  <input class=navy1 type=reset name=cmdcancel value=重置 ></center></p>
  </td></tr></form>
<%end if
Set fs=nothing%>
</table><br>[<a href='javascript:history.go(-1)'>后退</a>]</table></body></html>
























