<!--#include file="Admin.asp" -->
<!--#include file="cf.asp" -->
<!--#include file="adminconn.asp" -->
<!--#include file="../include/safe.asp"-->
<%
 
function txttourl(tekst)
tekst_temp = tekst
tekst_temp = replace(tekst_temp,"<","&lt;")
tekst_temp = replace(tekst_temp,">","&gt;")
tekst_temp = replace(tekst_temp,"chr(13)","<br>")
tekst_temp = replace(tekst_temp,"#","<br>")

tekst_temp = replace(tekst_temp,chr(13),"<br>")
tekst_temp = replace(tekst_temp,"[","<b>")
tekst_temp = replace(tekst_temp,"]","</b>")
txttourl = tekst_temp
end function
%>
<%
if request.form("subsave")="subok" then
title=request.form("title")
bigclassid=request.Form("bigclassid")
bigclassname=request.form("bigclassname")
smallclassname=request.form("smallclassname")
firstimagename=request.form("pic_url")
for i = 1 to request.form("demo").count
	scontent = scontent & request.form("demo")(i)
next
demo=scontent
if len(demo)=0 then 
	response.write"<center><font color=#ff0000 size=2>内容不能为空</font></center>"
	response.write"<center><font size=2><a href=# onclick=history.go(-1)>按这里返回</a></font></center>"
	response.end
end if
user=request.form("user")
if user="" then
	user="admin"
end if
come=request.form("come")
if come="" then
	come="admin"
end if
ok=request.form("ok")

set rs=server.createobject("adodb.recordset")
sql="select * from news where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("oStyle")=request.form("oStyle")
rs("oColor")=request.form("oColor")
rs("content")=demo
rs("come")=come
rs("user")=user
rs("bigclassname")=bigclassname
rs("smallclassname")=smallclassname
rs("picurl")=request.form("uppic")
rs("top")=request.form("top")
if ok<>"" then rs("ok") = ok
if firstimagename<>"" then rs("firstimagename") = firstimagename
rs("tuijian")=request("tuijian")
if session("userkey")>8 then
rs("ifshow")=1
end if
rs.update
rs.close
set rs=nothing
conn.close  
set conn=nothing
response.write "<script language='javascript'>" & chr(13)
		response.write "alert('新闻提交成功！');" & chr(13)
		response.write "window.document.location.href='admin_info.asp';"&chr(13)
		response.write "</script>" & chr(13)
response.end
else
response.write"<script language=javascript>alert('对不起，操作错误！');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
%>