<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%'============================================================

'============================================================
%>
<%
Response.Write"<card title='添加日记'><p>"
%>

<%
dim classid,test,title,id
        classid=LCase(Request("classid"))

if classid="" or IsNumeric(classid) = False then
  Response.write "日记分类不能为空，请<a href='tjbloglist.asp?ids="&myid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>新建分类</a>"
  Response.write "<br/><anchor><prev/>返回</anchor>"
  Response.write "</p></card></wml>"
  Response.end
end if
        test=LCase(Request("test"))
        title=LCase(Request("title"))
if test="" or title=""  then
  Response.write "各项都不可以为空！"
  Response.write "<br/><anchor><prev/>返回</anchor>"
  Response.write "</p></card></wml>"
  Response.end
end if
        set rs=server.createobject("adodb.recordset")
	sql="select * from blog_view"
	rs.open sql,conn,1,3
        rs.addnew
        rs("classid")=classid
        rs("test")=test
        rs("YD_date")=now()
        rs("title")=title
        rs("usid")=myid
        rs.update
	rs.close
	set rs=nothing
'取日记ID
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 ID from [blog_view] order by id desc",conn,1,1
id=rs("ID")
rs.close
set rs=nothing

  set rs1=Server.CreateObject("ADODB.Recordset")
  ssql1="select name from [users] where [id]="&myid
  rs1.open ssql1,conn,1,1
dim dongzuo
dongzuo="<a href='/bbs/blog.asp?ids="&myid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>" & myni & "</a>写了日记<a href='/bbs/blog_view.asp?classid="&classid&"&amp;id="&id&"&amp;ids="&myid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&title&"</a>"
dongzuo=ubb5(dongzuo)
rs1.close
                      set rs1=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from dongzuo where id order by times desc",conn,1,2
rs.addnew
rs("dongzuo")=dongzuo
rs("times")=now()
rs.update
rs.close
set rs=nothing


	conn.close
	set conn=nothing
response.write "记录添加成功!"
%>
<br/>----------<br/>
<a href="blog_add.asp?sid=<%=sid%>&amp;classid=<%=classid%>">[继续增加]</a>
<%Response.write "<br/><a href='/bbs/Blog.asp?ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>返回博客主页</a>"
Response.write "<br/><a href='/bbs/Blog.asp?sid="&sid&"&amp;saytk="&saytk&"'>博客</a>&lt;<a href='/bbs/photo.asp?sid="&sid&"&amp;saytk="&saytk&"'>相册</a>&lt;<a href='/bbs/myread.asp?sid="&sid&"&amp;saytk="&saytk&"'>留言</a>"
%>
<!--#include file="fanhui.asp"-->
</p></card>
</wml>