www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/html_add_save.asp

    <%Admin="InfoAdd"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_info.asp"-->
<!--#include file="config.asp"-->
<!--#include file="char.inc"-->
<%
tid=request("id")
savetime=Now()+webtime/24
set rs=server.CreateObject("ADODB.RecordSet")             
if request.form("tid")="" then errmsg=errmsg & ""文章类别"必选! \n"
if request.form("sid")="" then errmsg=errmsg & ""文章专题请确定" \n"
if request.form("se")="" then errmsg=errmsg & ""文章关键字"必填,因为留空无法产生相关文章! \n"                 
if request.form("title")="" then errmsg=errmsg & ""文章名称"不能为空! \n"
if request("title")<>"" then
rs.open "select * from info where title='"&request("title")&"' and tid="&request("id"),conn,1,1
if not rs.eof then errmsg=errmsg & "本类别内已经有相同的文章了! \n"
rs.close
end if

if errmsg<>"" then
   set rs=nothing
   conn.close
   set conn=nothing
   response.write("<script>alert('" & errmsg & "');history.go(-1)</script>") 
else
		sql="select * from info where (id is null)"
		rs.open sql,conn,1,3
		rs.addnew
		rs("tid")=request("id")
		rs("sid")=request("sid")
		rs("dj")=request("xoYuNewsDJ")
		rs("commend")=request("commend")
		rs("se")=request("se")
		rs("title")=request("title")
		rs("form_user")=request("form_user")
		rs("mbname")=request("mbname")
		rs("form_url")=request("form_url")
		rs("pic")=request("pic")
		rs("user")=request("user")
		rs("SpecialName")=Request.Form("SpecialName")
        if request("html")="yes" then
			rs("info")=request("body")
		  end if
		  if request("ubb")="yes" then
			rs("info")=UBBCode(request("body"))
		  end if
        if request("html")="" and request("ubb")="" then
			rs("info")=htmlencode(request("body"))
			end if
		rs("date")=savetime
		rs.update
		if request("makehtml")="yes" then
		temp = rs.bookmark
		rs.bookmark = temp
		newid=rs.Fields("ID")
		end if
		rs.close
		
  rs.open "select * from infotype where id="&tid,conn,1,1
  if not rs.eof then
      ts=rs("ts")
 TI=split(rs("ts"), ",")
           for i = 0 to ubound(TI)-1
                     next
   end if
   tx=TI(0)&","
  rs.close				
set rs=nothing
conn.close
set conn=nothing
if request("makehtml")="yes" then
response.write("<script>window.open(""makehtml.asp?type=page&id="&newid&""","""",""width=200,height=100,resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no"")</script>")
end if
if flash="1" or flashjs="1" then
response.write("<script>alert('成功:添加文章完成,即将刷新相关分类页!');location.href='makeall.asp?tid="&request("id")&"'</script>") 
response.end
else
response.write("<script>alert('成功:添加文章完成,请继续添加文章!');location.href='html_add.asp?id="&request("id")&"'</script>") 
response.end
end if
end if
%>