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

<%
dim ids,YD_name
ids=request.QueryString("ids")
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [Users] where [id]="&ids,conn,1,1
YD_name=rs("name")
  rs.close
  set rs=Nothing

call card("日志","left")


dim add,sql,class1,classname
class1=request.QueryString("classid")
if class1="" or IsNumeric(class1)=False then
  Call Error("ID无效！")
  end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * from blog_list where classid="&class1
rs.open sql,conn,1,1 
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("ID无效！")
  end if
classname=rs("class")
  rs.close
  set rs=Nothing
'-------A登录信息
if myid=0 then
Response.write "欢迎您:<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>登陆/注册</a><br/>----------<br/>"& chr(13)
else

'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
if newguest > 0 then
Response.write "<a href='/bbs/msgview.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
end if
'---------------------------
Response.write "<a href='/bbs/blog_fl.asp?ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>分类</a>&gt;&gt;"&classname&"<br/>"
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * from blog_view where classid="&class1&" order by num,id desc"
rs.open sql,conn,1,1 
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=listnums
	Dim Count,page,pagecount,gopage			
	gopage="blog_view.asp?classid="&class1&"&amp;ids="&usid&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))				
	For i=1 To PageSize					
	If rs.eof Then Exit For	
dim Counts
Counts=rs("blogpin")
    if rs("num")=1 then 
response.write"<a href='blog_view.asp?id="&rs("ID")&"&amp;classid="&class1&"&amp;ids="&ids&"&amp;p="&page&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>[顶]"&i+(page-1)*PageSize&"."&UBB(rs("title"))&"</a><br/>"
else
response.write"<a href='blog_view.asp?id="&rs("ID")&"&amp;classid="&class1&"&amp;ids="&ids&"&amp;p="&page&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&i+(page-1)*PageSize&"."&UBB(rs("title"))&"</a><br/>"
end if
	rs.moveNext
  								
	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">[GO]</a><br/>"
Else
response.write"暂时没有文章！<br/>"
end if
rs.close
set rs=nothing
if myid=clng(ids) then
Response.write "<br/><a href='/bbs/blog_add.asp?classid="&classid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>发表新日记</a>"
end if

conn.close
set conn=nothing
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"-->

<%
call headsay()
%>                        