<!--#include file="../conn.asp"-->
<!--#include file="inc/admin_config.asp"-->
<!--#include file="inc/top.asp"-->
<%
If Cint(AdminGroup(3))=1   or Cint(Request.Cookies("IsSuper"))=1 then
else
Response.Redirect("Default.asp")
Response.End()
End If




wt_keywords=""
response.Write("<table border=0 align=center cellpadding=3 cellspacing=1 class=tablecolor>")
response.Write("<tr><td height=25 align=center class=banner>关于我们 添加/修改</td></tr></table>")
select case request("action")
case "saveabout"
call saveabout()
case else
call normal()
end select
sub normal()
dim id,title,images,wt_content,listid,hits,about,wt_grade,wt_description,wt_filename
id=request.QueryString("id")
if id<>"" then
dim rs
set rs=conn.execute("select * from wd_about  where wt_id="&clng(id))
if rs.bof and rs.eof then
response.Write("<script>alert('没有此信息');history.back(-1)</script>")
response.End()
end if
title=rs("wt_title")
wt_content=rs("wt_Content")
wt_grade=rs("wt_grade")
wt_description=rs("wt_description")
wt_filename=rs("wt_filename")
wt_keywords=rs("wt_keywords")
rs.close
set rs=nothing
end if
response.Write("<table border='0' align='center' cellpadding='3' cellspacing='1' class='tablecolor'>")
response.Write("<form action='?action=saveabout' method=POST name=frmAnnounce>")
response.Write("<tr><td  class='tablebody'><strong>标题：</strong></td><td class='tablebody'><input name=title class=FormClass value='"&title&"' size=60 maxlength=60></td></tr>")
response.Write("<tr><td  class='tablebody'><strong>关键字：</strong></td><td class='tablebody'><input name=""wt_keywords"" class=""FormClass"" value="""&wt_keywords&""" size=60 maxlength=60> 每个关键字用“,”号格开</td></tr> ")
'response.Write("<tr><td class='tablebody' style='font-weight: bold'>文件名：</td><td class='tablebody'><input name='wt_filename' type='text' id=wt_filename'' value='"&wt_filename&"' size='30' maxlength='255' onkeydown='onlyNumA();' style='ime-mode:Disabled'> 允许输入字母和数字，用于网站优化</td></tr>")
response.Write("<tr><td  class='tablebody'><strong>排序：</strong></td><td class='tablebody'>")&vbCrLf
response.Write("<input onkeydown=""onlyNum();"" style=""ime-mode:Disabled; width:60px"" value="""&wt_grade&""" name=""wt_grade"">&nbsp;只允许输入数字，数字越小排列越靠前.")&vbCrLf
response.Write("</td></tr>")&vbCrLf
response.Write("<tr><td valign='top' class='tablebody'><Strong> 简介：</Strong></td>")&vbCrLf
response.Write("<td valign='top' class='tablebody'>")&vbCrLf
response.Write("<textarea name=""wt_description"" id=""wt_description"" cols=""80""  rows=""3"">"&  wt_description  &"</textarea><br />内容不超过200字符，超过部分将自动裁减掉！")&vbCrLf
response.Write("</td></tr>")&vbCrLf
response.Write("<tr><td valign='top' class='tablebody'  colspan=2><Strong>正文</Strong><br />")
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Value	= ""&wt_content &""
oFCKeditor.Create "wt_content"
response.Write (" </td></tr> ")&vbCrLf
'记录地址，方便返回
response.Write (" <input name=comeUrl  value='"&comeUrl&"' type=""hidden"" ><input name=thisUrl  value='"&thisUrl&"' type=""hidden"" >")&vbCrLf
response.Write (" <input type='hidden' name='id' value='"&id&"'>")
response.Write (" <tr><td align='center' class='tablebody'>&nbsp;</td><td class='tablebody'> <input type=Submit value='提交' name=Submit>&nbsp;<input type=reset name=Submit2 value='重置'></td></tr>")&vbCrLf
end sub
sub saveabout()
dim title,titlecolor,images,wt_content,id,userid,listid,hits,about,wt_grade,wt_description,wt_filename,wt_keywords
dim wt_fileUrl
id=request.Form("id")
title=checkStr(request.Form("title"))
wt_content=checkStr(request.Form("wt_content"))
wt_description=checkStr(request.Form("wt_description"))
wt_grade=checkStr(request.Form("wt_grade"))
wt_filename=checkStr(request.Form("wt_filename"))
wt_keywords=checkStr(request.Form("wt_keywords"))
if title="" then
response.Write("<script>alert('标题不能为空！');history.back(-1)</script>")
response.End()
end if
if wt_content="" then
response.Write("<script>alert('正文不能为空！');history.back(-1)</script>")
response.End()
end if 
if wt_keywords="" then
wt_keywords = replace(checkStr(request.Form("wt_title")),"，",",")
end if
wt_keywords=replace(wt_keywords," ",",")
wt_keywords=replace(wt_keywords,"，",",")
wt_keywords = replace(wt_keywords,"、",",")
wt_keywords = replace(wt_keywords," ",",")
wt_keywords = replace(wt_keywords,"：",",")
if wt_description="" then
wt_description=ScriptHtmlAll(checkStr(request.Form("wt_content")))
end if 
wt_description=left(wt_description,200)
if wt_grade="" then
wt_grade=99
end if
	'组合文件地址
dim ip
ip=Request.ServerVariables("HTTP_REFERER")
if id<>"" then
conn.execute("update wd_about set wt_title='"&title&"',wt_content='"&wt_content&"',wt_grade="&wt_grade&",wt_description='"&wt_description&"'  ,wt_keywords='"&wt_keywords&"'  where wt_id="&clng(id)&"")
response.Write "<li>更新成功！</li>"
response.Write "<li><strong><a href="""&request("comeUrl")&""" ><font color=red>返回</font></a></strong></li>"
response.End()
else
conn.execute("insert into wd_about(wt_title,wt_content,wt_grade,wt_description,wt_keywords) values('"&title&"','"&wt_content&"',"&wt_grade&",'"&wt_description&"','"&wt_keywords&"' )")
response.Write "<li>添加成功！</li>"
response.Write "<li><strong><a href="""&request("comeUrl")&""" ><font color=red>返回</font></a></strong></li>"
response.End()
end if
end sub
%>
<%CloseConn%><!--#include file="inc/end.asp"-->
