<%
Class CatyBlogObj
	PubLic CatyVar,ListTrue,Arr_Smilies
	Private CheckStr,P_len,x,I

	Private Sub Class_Initialize() 
		CatyVar="Powered by： ZuoxingWorkroom Access V1.0 "
		IF Not IsArray(Cahe("_blog_Smilies")) Then
			Dim log_SmiliesList
			SET log_SmiliesList=CONN.EXECUTE("SELECT sm_ID,sm_Image,sm_Text FROM Tb_blog_Smilies ORDER BY sm_ID ASC")
			SqlCount=SqlCount+1
			If Not log_SmiliesList.EOF Then
				AddCahe "_blog_Smilies",log_SmiliesList.GetRows
			End If
			log_SmiliesList.Close:Set log_SmiliesList=Nothing
		End IF
	End Sub 
	
	Private Sub Class_Terminate()
		IF IsObject(Conn) Then Conn.Close:Set Conn=nothing
		IF Not UserTrue Then
			Response.write Replace(CatyVar,"$SqlCount$",SqlCount)
		End If
	End Sub 
	
	Public Sub GetHttp()
		IF IsDom Then
			Dim GetUrl,HttpName,Les,Url,Rs
			GetUrl=Lcase(Request.ServerVariables("HTTP_HOST"))
			HttpName="."&Lcase(WebHost)
			Les=instr(GetUrl,HttpName)
			IF LES=1 Or les=0 then
				Url="main.asp"
			Else
				GetUrl=left(GetUrl,Les-1)
				Set Rs=Conn.Execute("Select ID from Tb_user Where Blog_Url='"&Geturl&"'")
				IF Rs.eof Then
					Url="main.asp"
				Else
					Url=CblogObj.GetDir(Rs(0))
				End if
				Rs.Close:Set Rs=NotHing
			End IF
			Response.Redirect(url)
		Else
			Response.Redirect("main.asp")
		End IF
	End Sub
	
	Public Function Smilies(w)
			Dim log_SmiliesListNums,log_SmiliesListNumI
			log_SmiliesListNums=Ubound(Cahe("_blog_Smilies"),2)
			For log_SmiliesListNumI=0 To log_SmiliesListNums
				Smilies=Smilies & "<img style=""cursor:hand;"" width="""& w &""" onclick=""AddText('"&Cahe("_blog_Smilies")(2,log_SmiliesListNumI)&"');"" src="""&CityBlogDir&"img/smilies/"&Cahe("_blog_Smilies")(1,log_SmiliesListNumI)&""" alt="""" />"
			Next
	End Function
	Rem 得到内容
	Private Function GetUrl(Templateurl)
		Dim Xmlhttp
		Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
		xmlHttp.Open "GET", Templateurl, False
		xmlHttp.Send  
		BodyText=bytesToBSTR(xmlHttp.ResponseBody,"gb2312")
		Set xmlHttp = Nothing
	End Function
	Public Function TagUbb(Str,PageShow)
		IF Str<>"" Then
			Dim TagArr,Tagi
			TagArr=Split(Str,"|")
			For Tagi=0 To Ubound(TagArr)
				TagUbb=TagUbb&" <a href="""& PageShow &"?tag=" & TagArr(Tagi) & "&amp;"">"& TagArr(Tagi) &"</a> "
			Next
		Else
			TagUbb="无"
		End IF
	End Function
	Rem 获得Session参数
	Public Function GetSession(SessionName)
		GetSession=Session(SessionName)
	End Function
	Rem 获得Post参数
	Public Function FormRequest(RequestName)
		FormRequest=Trim(CheckSqlstr(Request.form(RequestName)))
	End Function
	Rem 获得GET参数
	Public Function GetRequest(RequestName)
		GetRequest=Trim(CheckSqlstr(Request.QueryString(RequestName)))
	End Function
	Rem 获得GET参数
	Public Function QUERY_STRING()
		QUERY_STRING=CheckSqlstr(Lcase(Request.ServerVariables("QUERY_STRING")))
	End Function
	Rem 获得用户目录函数
	Public Function GetDir(UserID)
		GetDir=CityBlogDir & "User" & Cint(UserID/800) & "/" &UserID
	End Function
	Public Function GetUpLoadDir(UserID)
		GetUpLoadDir=CityBlogDir & "UserUpLoad/User" & Cint(UserID/800) & "/" &UserID
	End Function
	Public Function IsCInt(AID)
		IF IsNull(Aid) Then
			Response.Write "错误的参数，参数必须为整数！"& AID & " 错误!"
			Response.End
		Else
			IF Not Isnumeric(AID) Then
				Response.Write "错误的参数，参数必须为整数！"& AID & " 错误!"
				Response.End
			Else
				IsCInt=CLng(AID)
			End IF
		End IF
	End Function
	Rem 分页代码开始
	Public Function Page()
		Page=GetRequest("Page")
		IF Page="" Then
			Page=1
		End IF
		IF Not ISnumeric(Page) Then
			Page=1
		End IF
		IF Page<1 Then
			Page=1
		End IF
	End Function
	Public Function QueryPage()
		QueryPage=QueryStringPage("page",True)
		IF QueryPage="" Then
			QueryPage=1
		End IF
		IF Not ISnumeric(QueryPage) Then
			QueryPage=1
		End IF
		IF QueryPage<1 Then
			QueryPage=1
		End IF
		IF Clng(QueryPage)>Clng(MaxP) Then
			QueryPage=Clng(MaxP)
		End IF
	End Function
	Public Function QueryStringPage(RequestStr,Action)
		RequestStr=LCase(RequestStr)&"/"
		Dim QueryStringArr,X,A
		QueryStringPage=Replace(LCase(Query_String),".html","")
		QueryStringArr=Split(QueryStringPage,"/_")
		For Each X In QueryStringArr
			IF Not Action Then
				IF Instr(X,RequestStr)>0 Then
					QueryStringPage=Replace(QueryStringPage,"/_" & X,"")
					Exit For
					Exit Function
				End IF
			Else
				IF Instr(X,RequestStr)>0 Then
					A = Split(X, "/")
					QueryStringPage=A(1)
					Exit For
					Exit Function
				Else
					QueryStringPage=""
				End IF
			End IF
		Next
	End Function
	Public Sub PageList(PageCount,Page,PageSize,PageNum,IsPage)
		IF PageCount>0 then
		Dim PageText,MaxPage,Query,PageRoot,PageFoot,PageNext10
		Dim PagePrevious,PageNext,Action,Pagej,PageTemp
		PagePrevious=Cint(PageNum/2)-1
		PageNext=Cint(PageNum/2)
		PageNext10=10
		Action = Request.ServerVariables("SCRIPT_NAME")
		Query =QueryStringPage("page",False)
		Query=Query&"/_page/"
		IF PageCount MOD PageSize = 0 THEN
			MaxPage = PageCount \ PageSize
		Else
			MaxPage = PageCount \ PageSize+1
		End IF
		'Response.Write PageRoot & "|" & MaxPage
		IF MaxPage>1 Then
			Page=Clng(Page)
			IF Page>MaxPage Then
				Page=MaxPage
			End IF
				PageText="<div class=""page""><h1>"
				IF Page<PageNext then
					PageText=PageText & "<img src="""&CityBlogDir&"img/First.gif"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页"" />  "		
				Else		
					PageText=PageText & "<a href=""" & Action & "?"& Query &"1.html""><img src="""&CityBlogDir&"img/First.gIF"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页,点这里转到第一页"" /></a>  "
				End IF
				IF (MaxPage-Page)<PageNext Then
					PageRoot=(Page-PagePrevious)-(PageNext-(MaxPage-Page))
				Else
					PageRoot=Page-PagePrevious
				End IF
				IF PageRoot<1 Then
					PageRoot=1
				End IF
				IF Page<PageNext or Page="" then
					PageRoot=1
					PageFoot=PageNum
				Else
					PageFoot=Page+PageNext
				End IF
				IF PageFoot>MaxPage Then
					PageFoot=MaxPage
				End IF
				
				IF Page<PageNext then
					PageText=PageText &"<img src="""&CityBlogDir&"img/Previous.gIF"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页"" />  "
				Else
					PageText=PageText &"<a href=""" & Action & "?"& Query & (Page-10)&".html""><img src="""&CityBlogDir&"img/Previous.gIF"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页,点这里转到上十页"" /></a>  "
				End IF
				For Pagej=PageRoot To PageFoot
					IF Page=Pagej then
						PageTemp=Pagej&"  "
					Else
						IF Pagej=1 then
							PageTemp="<a href=""" & Action & "?"& Query & Pagej &".html"">"&Pagej&"</a>  "
						Else
							PageTemp="<a href=""" & Action & "?"& Query & Pagej &".html"">"&Pagej&"</a>  "
						End IF
					End IF
					PageText=PageText & PageTemp
					IF Pagej=MaxPage then 
						Pagej=Pagej+1
						Exit for
					End IF
				Next
				IF MaxPage-Page<PageNum then
					PageNext10=MaxPage-Page
				End IF
				IF Pagej-1=MaxPage then
					PageText=PageText &"<img src="""&CityBlogDir&"img/Next.gIF"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页"" />  " & Chr(13)
				Else
					PageText=PageText &"<a href=""" & Action & "?"& Query & (Page+PageNext10)&".html""><img src="""&CityBlogDir&"img/Next.gIF"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页,点这里转到下十页"" /></a>  " & Chr(13)
				End IF
				IF Page>=MaxPage then
					PageText=PageText & "<img src="""&CityBlogDir&"img/Last.gIF"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页"" />  "  & Chr(13)
				Else
					PageText=PageText & "<a href=""" & Action & "?"& Query & MaxPage&".html""><img src="""&CityBlogDir&"img/Last.gIF"" border=""0"" alt=""总有记录:"& PageCount &"条,共"& MaxPage &"页,点这里转到尾页"" /></a>  " & Chr(13)			
				End IF
				PageText=PageText & " </h1>"
				IF IsPage Then
					PageText=PageText & " <h2>您可以按 <a href=""?"&QueryStringPage("action",false)&"/_action/list.html"">列表</a> | <a href=""?"&QueryStringPage("action",false)&"/_action/show.html"">普通</a> 浏览</h2>" & Chr(13)
				End IF
				Response.Write(PageText&"</div>")
			Else
				IF IsPage Then
					Response.Write "<div class=""page""><h1>无分页记录</h1><h2>您可以按 <a href=""?"&QueryStringPage("action",false)&"/_action/list.html"">列表</a> | <a href=""?"&QueryStringPage("action",false)&"/_action/show.html"">普通</a> 浏览</h2></div>" & Chr(13)
				End IF
			End IF
		End IF		
	End Sub
	'==============================缓存函数开始
	Public Sub AddCahe(CaheName,CaheInfo)
        Application.Lock
        Application(CatyBlogCache_name & "_" & CaheName)=CaheInfo
        Application.unLock
	End Sub
	Public Sub AddCaheDate(CaheName,times)
        Application.Lock
        Application(CatyBlogCache_name & "_" & CaheName & "_time")=times
        Application.unLock
	End Sub
	Public Sub EmptyCahe(CaheName)
        Application.Lock
        Application(CatyBlogCache_name & "_" & CaheName)=Empty
        Application.unLock
	End Sub
    Public Sub DelCahe(CaheName)
		Dim Arr,U
		Arr=Split(CaheName,"|")
        Application.Lock
			For U=0 To UBound(Arr)
				Application.Contents.Remove (CatyBlogCache_name & "_" & Arr(U))
			Next
        Application.unLock
    End Sub
    Public Function Cahe(CaheName)
        Cahe=Application(CatyBlogCache_name & "_" & CaheName)
    End Function
    Public Function IsCaheEmpty(CaheName)
		IsCaheEmpty=True
		IF IsEmpty(Application(CatyBlogCache_name & "_" & CaheName)) Then
			IsCaheEmpty=False
		End IF
    End Function
    Public Function IsCaheArr(CaheName)
		IsCaheArr=False
		IF IsArray(Application(CatyBlogCache_name & "_" & CaheName)) Then
			IsCaheArr=True
		End IF
    End Function
	'==============================字符处理函数
	Rem 过滤SQL注入
	Private Function CheckSqlstr(Str)
		If Isnull(Str) Then
			CheckSqlstr = ""
			Exit Function 
		End If
		Str = Replace(Str,Chr(0),"")
		CheckSqlstr = Replace(Str,"'","''")
		CheckSqlstr = Replace(CheckSqlstr,"&apos;","&apos;&apos;")
	End Function
	Private Function BytesToBstr(body,Cset)
		'On Error resume next
		dim objstream
		set objstream = Server.CreateObject("adodb.stream")
		objstream.Type = 1
		objstream.Mode =3
		objstream.Open
		objstream.Write body
		objstream.Position = 0
		objstream.Type = 2
		objstream.Charset = Cset
		BytesToBstr = objstream.ReadText 
		'If Err.number<>0 Then
		 ' err.Clear
		  'Response.Write "权限错误!!请检查您的IIS默认的匿名用户是否对本系统所在的目录有读,写,修改权限!!"
		  'Response.End
		'End If
		objstream.Close
		set objstream = nothing
	End Function
	Rem 清除所有HTML代码
	Public Function HtmlStr(str)
		Dim re
		Set re=new RegExp
		re.IgnoreCase =True
		re.Global=True
		re.Pattern="<(.[^>]*)>"
		str=re.Replace(str,"")	
		set re=Nothing
		HtmlStr=str
		HtmlStr=Replace(str,chr(10),"")
		HtmlStr=Replace(HtmlStr,chr(13),"")
	End Function
	Public Function CheckLinkStr(Str)
		if trim(Str)<>"" then
			Dim Re
			Str = Replace(Str, CHR(9), "#chr39#")	
			Str = Replace(Str, CHR(32), "#chr39#")
			Str = Replace(Str, "&", "&amp;")
			Str = Replace(Str, "<", "&lt;")
			Str = Replace(Str, ">", "&gt;")
			Str = Replace(Str, "|", "&#124;")
			Set re=new RegExp
			re.IgnoreCase =true
			re.Global=True
			re.Pattern="(iframe>)"
			Str=re.Replace(Str,"iframe&gt;")
			re.Pattern="(javascript)"
			Str=re.Replace(Str,"<i>&#106avascript</i>")
			re.Pattern="(jscript:)"
			Str=re.Replace(Str,"<i>&#106script:</i>")
			re.Pattern="(js:)"
			Str=re.Replace(Str,"<i>&#106s:</i>")
			re.Pattern="(</SCRIPT>)"
			Str=re.Replace(Str,"&lt;/script&gt;")
			re.Pattern="(<SCRIPT)"
			Str=re.Replace(Str,"&lt;script")
			re.Pattern="(\r\n){3,}"
			Str=re.Replace(Str,"$1$1$1")
			Set re=Nothing
			CheckLinkStr = Str
		End if
	End Function
	Rem 截取字数
    Public Function strLength(Str)
        On Error Resume Next
        Dim WINNT_CHINESE
        WINNT_CHINESE = (Len("中国") = 2)
        If WINNT_CHINESE Then
            Dim l, t, c
            Dim i
            l = Len(Str)
            t = l
            For i = 1 To l
                c = Asc(Mid(Str, i, 1))
                If c < 0 Then c = c + 65536
                If c > 255 Then
                    t = t + 1
                End If
            Next
            strLength = t
        Else
        strLength = Len(Str)
        End If
        If Err.Number <> 0 Then Err.Clear
    End Function
	'==============================FSO函数，方法开始
	Rem 得到内容2
	Public Function GetTxt(Path)
		On Error resume next
		Dim Ph,fso,ts
		Set fso = CreateObject("Scripting.FileSystemObject")
		ph=server.mappath(Path)
		Set ts = fso.OpenTextFile(ph, 1)
		GetTxt = ts.ReadAll
		ts.Close
	End Function
	Rem 检测目录是否存在,不存在则建立目录
	Public Function CreateFolder(Folder)
		'On Error resume next
		DIM FSO
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
		if Not fso.FolderExists(Server.MapPath(Folder)) Then 
			fso.CreateFolder(Server.MapPath(Folder))
		End if
		Set Fso = Nothing
		'If Err.number<>0 Then
		 ' err.Clear
		  'Response.Write "权限错误!!请检查您的IIS默认的匿名用户是否对本系统所在的目录有读,写,修改权限!!2"
		  'Response.End
		'End If
	End Function
	Rem 删除文件
	Public Function DelFile(Path)
		DIM ObjFso
		Set ObjFso=CreateObject("Scripting.FileSystemObject")
		IF ObjFso.FileExists(Path) then
			ObjFso.DeleteFile(Path)
		End IF
		Set ObjFso=Nothing
	End Function
	
	Public Function DelFolder(Path)
		DIM ObjFso
		Set ObjFso=CreateObject("Scripting.FileSystemObject")
		IF ObjFso.FolderExists(Path) then
			ObjFso.DeleteFolder(Path)
		End IF
		Set ObjFso=Nothing
	End Function
	Rem 拷贝文件
	Public Sub copyfile(movefiles, copyfiles)
		'On Error resume next
		movefiles = Server.MapPath(movefiles)
		copyfiles = Server.MapPath(copyfiles)
		Dim Fso
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
		fso.CopyFolder movefiles, copyfiles
		'If Err.number<>0 Then
			 'Err.Clear
			 'Response.Write "权限错误!!请检查您的IIS默认的匿名用户是否对本系统所在的目录有读,写,修改权限!!3"
			 'Response.End
		'End If
		Set fso = Nothing
	End Sub
	
	Rem 检测用户上传目录是否已满
	Public Function IsFolder(UserID,Zise)
		IsFolder=0
		Dim IsFolderf,IsFolderfso
		Set IsFolderfso = CreateObject("Scripting.FileSystemObject") 
		Set IsFolderf = IsFolderfso.GetFolder(Server.MapPath(GetUpLoadDir(UserID)))
		IsFolder=IsFolderf.Size 
		Set IsFolderf=Nothing:Set IsFolderfso=Nothing
		IF IsFolder>=(Zise*1024*1024) Then
			IsFolder=False
		Else
			IsFolder=True
		End IF
	End Function


	REM 写入文件
	Public Sub WriteStream(FileName,BodyText) 
		On Error resume next
		DIM WriteAdo
		'Response.write Server.MapPath(FileName)
		Set WriteAdo = Server.CreateObject("ADODB.Stream")
		With WriteAdo
			.Open
			.Charset = "gb2312"
			.WriteText BodyText
			.SaveToFile Server.MapPath(FileName),2
			'If Err.number<>0 Then
			  'err.Clear
			  ''Response.Write "权限错误!!请检查您的IIS默认的匿名用户是否对本系统所在的目录有读,写,修改权限!!4"
			  'Response.End
			'End If
			.Close
		End With
		Set WriteAdo = Nothing
	End Sub

	'=================XML类函数或方法
	Rem 读取XML函数
	Private Function Xml(XmlPath,DivID)
		Dim ObjXML,AllNodesNum,Root,iii
		Set objXML = Server.CreateObject("Microsoft.FreeThreadedXMLDOM")
		objXML.Load (Server.MapPath(XmlPath))
		if objXML.parseError.ErrorCode=0 then
			Set Root = objXML.documentElement.selectSingleNode("index")
			AllNodesNum = Root.childNodes.length - 1
			Xml="<ul id=""" & DivID & """ class=""rightdiv"">"
			For iii = 0 To AllNodesNum
				Xml=Xml& "<li>" &root.childNodes.Item(iii).childNodes.Item(0).Text & "</li>"
			Next
			Xml=Xml&"</ul>"
		end if
		set ObjXML=nothing:set Root=nothing
	End Function
	
	Rem  写入XML文件
	Private Sub SaveXml(XmlString,XmlPhat,UserID)
		Dim XmlDoc
		Set XmlDoc = Server.CreateObject("Msxml2.DOMDocument")
		xmlDoc.loadXML (XmlString)
		xmlDoc.Save (Server.MapPath(GetDir(UserID) & "/" &XmlPhat))
		Set xmlDoc = Nothing
	End Sub
	
	Public Sub SaveUserLinkXml(UserID)
		Dim XmlString
		xmlString=FormRequest("url")
		Dim Re
		Set re=new RegExp
		re.IgnoreCase =true
		re.Global=True
		re.Pattern="(Runatr=Server>)"
		xmlString=re.Replace(xmlString,"")
		re.Pattern="(Runatr="&chr(34)&"Server"&chr(34)&">)"
		xmlString=re.Replace(xmlString,"")
		re.Pattern="Runatr=(.[^>]*)Server"
		xmlString=re.Replace(xmlString,"")
		xmlString=replace(xmlString,chr(60)&chr(37),"&lt;%")
		xmlString=replace(xmlString,chr(37)&chr(62),"%&gt;")
		re.Pattern="(iframe>)"
		xmlString=re.Replace(xmlString,"iframe&gt;")
		re.Pattern="(javascript)"
		xmlString=re.Replace(xmlString,"<i>&#106avascript</i>")
		re.Pattern="(jscript:)"
		xmlString=re.Replace(xmlString,"<i>&#106script:</i>")
		re.Pattern="(js:)"
		xmlString=re.Replace(xmlString,"<i>&#106s:</i>")
		re.Pattern="(</SCRIPT>)"
		xmlString=re.Replace(xmlString,"&lt;/script&gt;")
		re.Pattern="(<SCRIPT)"
		xmlString=re.Replace(xmlString,"&lt;script")
		re.Pattern="(\r\n){3,}"
		xmlString=re.Replace(xmlString,"$1$1$1")
		Set re=Nothing
		WriteStream GetDir(UserID) & "/link.html",xmlString
	End Sub	
	
	Rem 写入分类静态页
	Public Sub SaveUserClassXml(UserID)
		Dim XmlString,XmlRs,iii,Arr
		xmlString = "<ul id=""articlebyclass"" class=""rightdiv"">"
		xmlString = xmlString & "<li><a href=""../../main.asp"" target=""_blank"">首页</a> | <a href=""../../UserManage/"" target=""_blank"">管理</a> | <a href=""../../login.asp?quit"" target=""_blank"">注销</a></li>"
		xmlString = xmlString & "<li><a  href=""default.asp"">全部日志</a></li>"
		Set XmlRs = conn.Execute("SELECT Article_ByClass,count(Article_ID),max(ISphoto) From Article Where User_id="&UserID&" GROUP BY Article_ByClass Order by max(isphoto) Desc,count(Article_ID) Desc")
		If Not XmlRs.EOF Then
			Arr= XmlRs.getrows
			For iii = 0 To UBound(Arr, 2)
				xmlString = xmlString & "<li><a href=""default.asp?/_ClassName/"&left(Arr(0,iii),7)&".html"">"&mid(Arr(0,iii),8)&"</a>(" & Arr(1,iii) & ")</li>"
			Next
		End If
		XmlRs.Close: Set XmlRs = Nothing
		xmlString = xmlString & "</ul>"
		WriteStream GetDir(UserID) & "/byclass.html",xmlString
	End Sub
	
	Rem 生成月份静态页
	Public Sub SaveUserMonthXml(UserID)
		Dim XmlString,XmlRs,iii,Arr,MonthArr
		xmlString = "<ul id=""articlebymonth"" class=""rightdiv"">"
		Set XmlRs = conn.Execute("SELECT Article_ByMonth,count(Article_ID),Max(Article_id) From Article Where User_id="&UserID&" GROUP BY Article_ByMonth Order by Max(Article_id) Desc,count(Article_ID) desc")
		If Not XmlRs.EOF Then
			Arr= XmlRs.getrows
			For iii = 0 To UBound(Arr, 2)
				MonthArr=Split(Arr(0,iii),"||")
				xmlString = xmlString & "<li><a href=""default.asp?/_Month/"&MonthArr(0)&".html"">"&MonthArr(1)&"</a>(" & Arr(1,iii) & ")</li>"
			Next
		Else
			xmlString = xmlString & "<li>没有任何存档</li>"
		End If
		XmlRs.Close: Set XmlRs = Nothing
		xmlString = xmlString & "</ul>"
		WriteStream GetDir(UserID) & "/bymonth.html",xmlString
	End Sub
	
	Rem 写入最新回复
	Public Sub SaveReXml(UserID)
		Dim XmlString,XmlRs,iii,Arr,MonthArr
		xmlString = "<ul id=""newre"" class=""rightdiv"">"
		Set XmlRs = conn.Execute("Select Top 10 Reply_Title,Reply_Blog_ID From Tb_Reply Where Reply_User="&UserID&" Order by Reply_ID DESC")
		If Not XmlRs.EOF Then
			Arr= XmlRs.getrows
			For iii = 0 To UBound(Arr, 2)
				xmlString = xmlString & "<li><a href=""show.asp?/_articleid/"&Arr(1,iii)&".html"">"&Arr(0,iii)&"</a></li>"
			Next
		Else
			xmlString = xmlString & "<li>没有任何回复</li>"
		End If
		XmlRs.Close: Set XmlRs = Nothing
		xmlString = xmlString & "</ul>"
		WriteStream GetDir(UserID) & "/newre.html",xmlString
	End Sub
	
	Public Sub ClassCodeList(Code,Tb,CaheName,ClassName)
		Dim Text,Rs,iii,jjj,Spr
		Text="<select name=""BlogClass""> <option value="""" selected=""selected"">┌选择" & ClassName & "分类!</option>"
		IF Not IsCaheEmpty(CaheName) Then
			Set rs=Conn.Execute ("select * FROM "& Tb &" ORDER BY CLASSCODE")
			SqlCount=SqlCount+1
			If Not rs.eof Then
				AddCahe CaheName,Rs.GetRows
			End If
			IF ISOBJECT(RS) Then Rs.Close:Set Rs=Nothing
		End If
		
		IF IsCaheArr(CaheName) Then
			For iii=0 to UBound(Cahe(CaheName),2)
				Spr=""
				For jjj=6 to len(Cahe(CaheName)(0,iii)) Step 3
					Spr=Spr&"│"
				Next
				IF Cahe(CaheName)(0,iii)=Code Then
					text=text&"<option value="""&Cahe(CaheName)(0,iii)&""" selected=""selected"">"& Spr &"├"&Cahe(CaheName)(1,iii)&"</option>"
				Else
					text=text&"<option value="""&Cahe(CaheName)(0,iii)&""">"& Spr &"├"&Cahe(CaheName)(1,iii)&"</option>"
				End IF
			Next
		End IF
		text=text&"</select>"
		Response.write(text)
	End Sub
	
	Rem 写入日期
	Public Sub WriteDateInc(UserID)
		Dim Arr,Days,Iii,DaysRs
		set DaysRs=conn.execute("SELECT YEAR(Article_Time),MONTH(Article_Time),DAY(Article_Time) FROM Article where User_ID="& UserID &" GROUP BY YEAR(Article_Time), MONTH(Article_Time),DAY(Article_Time)")
		SqlCount=SqlCount+1
		IF NOT DaysRs.EOF THEN
			Arr = DaysRs.GetRows
			dim datedate
			FOR Iii=0 TO UBound(Arr, 2)
				Days=Arr(0,Iii)&"-"&Arr(1,Iii)&"-"&Arr(2,Iii)&","&Days
			Next
			Days="<"&chr(37)&chr(13)&"Function DAYS()"&chr(13)&"DAYS="&chr(34)&DAYS&chr(34)&chr(13)&"End Function"&chr(37)&">"
		ELSE
			Days="<"&chr(37)&chr(13)&"Function DAYS()"&chr(10)&"DAYS="&chr(34)&","&chr(34)&chr(13)&"End Function"&chr(37)&">"
		End IF
		DaysRs.CLOSE:Set DaysRs=NOTHING
		WriteStream GetDir(UserID) & "/Date.inc",Days
	End Sub


	Rem 日历方法
	Public Sub Calendar()
		'Response.Write "<div id=""calendar""></div>"
		'response.write "<script type=""text/javascript"">" & chr(13)
		Response.Write "function showlink(dt,dm)" & chr(13)
		Response.Write "{" & chr(13)
		Response.Write "dc=dt;" & chr(13)
		Response.Write "dt=dt+"","";" & chr(13)
		Response.Write "var strpostdd="""&DAYS()&""";" & chr(13)
		Response.Write "d = new Date();" & chr(13)
		Response.Write "if(strpostdd.indexOf(dt)!=-1)" & chr(13)
		Response.Write "{" & chr(13)
		Response.Write "if(dm!=d.getDate())" & chr(13)
		Response.Write "return ""<a href=default.asp?/_date/""+dc+"".html>""+dm+""</a>"";" & chr(13)
		Response.Write "else{"
		Response.Write "if (dm>d.getDate()){"
		Response.Write "return dm;}"
		Response.Write "else{"
		Response.Write "return ""<a href=default.asp?/_date/""+dc+"".html id=getdate>""+dm+""</a>"";}" & chr(13)
		Response.Write "}"
		Response.Write "}else{" & chr(13)
		Response.Write "if(dm==d.getDate())" & chr(13)
		Response.Write "return ""<span id=getdate>""+dm+""</span>"";" & chr(13)
		Response.Write "else" & chr(13)
		Response.Write "return dm;}}" & chr(13)
		Response.Write "function showcc(yy,mm,dd){mm--;" & chr(13)
		Response.Write "var arrdd=new Array(31,28,31,30,31,30,31,31,30,31,30,31);" & chr(13)
		Response.Write "if(dd==1)" & chr(13)
		Response.Write "dd=arrdd[mm];" & chr(13)
		Response.Write "switch(mm)" & chr(13)
		Response.Write "{" & chr(13)
		Response.Write "case 0:strmm=""1"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 1:strmm=""2"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 2:strmm=""3"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 3:strmm=""4"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 4:strmm=""5"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 5:strmm=""6"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 6:strmm=""7"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 7:strmm=""8"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 8:strmm=""9"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 9:strmm=""10"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 10:strmm=""11"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "case 11:strmm=""12"";" & chr(13)
		Response.Write "break;" & chr(13)
		Response.Write "}" & chr(13)
		Response.Write "var thisyear=yy;" & chr(13)
		Response.Write "var thismonth=mm;" & chr(13)
		Response.Write "var lastday=dd;" & chr(13)
		Response.Write "if(thismonth==1){" & chr(13)
		Response.Write "if (thisyear%4==0 || (thisyear%100==0 && thisyear%400==0)){" & chr(13)
		Response.Write "lastday=29;arrdd[1]=29;}else{lastday=28;arrdd[1]=28;}}tempyy=yy-1;" & chr(13)
		Response.Write "if(mm!=1)" & chr(13)
		Response.Write "{tempmm=mm;}" & chr(13)
		Response.Write "else" & chr(13)
		Response.Write "{tempmm=1;}" & chr(13)
		Response.Write "if(tempmm<1)" & chr(13)
		Response.Write "{tempmm=1;tempdd=arrdd[0];}" & chr(13)
		Response.Write "else{tempdd=arrdd[mm-1];}" & chr(13)
		Response.Write "if(mm!=12){tempmm1=mm+2;}else{tempmm1=12;}" & chr(13)
		Response.Write "if(tempmm1>12){tempmm1=12;tempdd1=arrdd[11];}else{tempdd1=arrdd[mm+1];}" & chr(13)
		Response.Write "tempyy1=yy+1;" & chr(13)
		Response.Write "tempstr=""<table width='100%' border='0' cellpadding='2'><tr><td colspan='7'><div align='center'>"";" & chr(13)
		Response.Write "tempstr+=""<span class='lnyear' title='上一年' onclick=showcc(""+tempyy+"",""+parseInt(mm+1)+"",""+dd+"")><<</span> "";" & chr(13)
		Response.Write "tempstr+=""""+yy+""年 <span class='lnyear' title='下一年' onclick=showcc(""+tempyy1+"",""+parseInt(mm+1)+"",""+dd+"")>&raquo;</span> <span class='lnyear'  title='上一月' onclick=showcc(""+yy+"",""+tempmm+"",""+tempdd+"")><<</span> ""+strmm+"""";" & chr(13)
		Response.Write "tempstr+=""月份<span class='lnyear' title='下一月' onclick=showcc(""+yy+"",""+tempmm1+"",""+tempdd1+"")>&raquo;</span></div></td></tr>"";" & chr(13)
		Response.Write "tempstr+=""<tr id='weekday'><td>日</td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td></tr><tr class='eachdaybg'>"";" & chr(13)
		Response.Write "thisdd = new Date();" & chr(13)
		Response.Write "thisdd.setFullYear(thisyear,thismonth,1);" & chr(13)
		Response.Write "firstday=thisdd.getDay();" & chr(13)
		Response.Write "cmi=42;" & chr(13)
		Response.Write "if (lastday<31 || firstday==0)" & chr(13)
		Response.Write "cmi=36;" & chr(13)
		Response.Write "for(i=0;i<cmi;i++)" & chr(13)
		Response.Write "{tempstr+=""<td>"";" & chr(13)
		Response.Write "if (firstday<=i && i<firstday+lastday)" & chr(13)
		Response.Write "{cs=i-firstday+1;" & chr(13)
		Response.Write "cd=(yy+""-""+parseInt(mm+1)+""-""+cs).toString();" & chr(13)
		Response.Write "tempstr+=showlink(cd,cs);}" & chr(13)
		Response.Write "tempstr+=""</td>"";" & chr(13)
		Response.Write "if ((i+1) % 7 ==0)" & chr(13)
		Response.Write "tempstr+=""</tr><tr class='eachdaybg'>"";}" & chr(13)
		Response.Write "tempstr+=""</tr></table>"";" & chr(13)
		Response.Write "document.getElementById(""calendar"").innerHTML=tempstr;}" & chr(13)
		Response.Write "showcc("&Year(date())&","&Month(date())&",1);" & chr(13)
		'Response.Write "<//script>"
	End Sub
	

				
				
	Rem 显示分类/相片分类/等方法方法
	Public Sub WriteXml(XmlPath,DivID)
		Response.Write Xml(XmlPath,DivID)
	End Sub

	Rem 验证码
    Public Function Vcode()
        Vcode = "<img src=""" & CityBlogDir & "Inc/GetCode.asp"" onclick=""this.src='"&CityBlogDir&"Inc/GetCode.asp';"" alt=""看不清或没看到请点这里！"" />"
    	Response.write Vcode
	End Function
	
    Public Function Vcode2()
        Vcode2 = "<img src=""" & CityBlogDir & "Inc/GetCode.asp"" onclick=""this.src='"&CityBlogDir&"Inc/GetCode.asp';"" alt=""看不清或没看到请点这里！"" />"
	End Function
	
    Rem 检查验证码是否正确
	Public Function CodeIsTrue()
		Dim CodeStr
		CodeStr=Lcase(Trim(Request("CodeStr")))
		If CStr(Lcase(Session("GetCode")))=CStr(CodeStr) And CodeStr<>""  Then
			CodeIsTrue=True
			Session("GetCode")=empty
		Else
			CodeIsTrue=False
			Session("GetCode")=empty
		End If	
	End Function
	
	Private Function IsLoginCheck()
		IsLoginCheck=True
		IF GetSession("UserID")="" Or Isempty(GetSession("UserID")) Then
			Dim UserID,UserName,UserPass
			UserID=CheckSqlstr(request.Cookies("cixiblog")("User_ID"))
			UserName=CheckSqlstr(request.Cookies("cixiblog")("User_Name"))
			UserPASS=CheckSqlstr(request.Cookies("cixiblog")("User_PASS"))
			IF UserID="" OR ISEMPTY(UserID) Then
				IsLoginCheck=False
				Exit Function
			Else
				IF NOT ISNUMERIC(UserID) Then
					IsLoginCheck=False
					Exit Function
				End IF
				SET RS=CONN.EXECUTE("select ID,User_Name,User_Pass,Blog_class,blog_name,UpFileSize,IsCheck FROM TB_USER WHERE ID="& UserID &"")
				IF Rs.Eof Then
					IsLoginCheck=False
					Rs.Close:Set Rs=Nothing:Exit Function
				Else
				IF RS(6)=False Then
					IsLoginCheck=False
					Exit Function
				End IF
					IF UserPASS<>Rs(2) Then
						IsLoginCheck=False
						Rs.Close:Set Rs=Nothing:Exit Function
					Else
						Session("UserID")=Rs(0):Session("UserName")=Rs(1):SESSION("User_Class")=rs(3):Session("Blog_Name")=rs(4):Session("UpFileSize")=rs(5)
						Rs.Close:Set Rs=Nothing:Exit Function
						IsLoginCheck=True
					End IF
				End if
			End IF
		End IF
	End Function
	
	Public Sub IsUserLogin()
		IF Not IsLoginCheck  Then
			Response.Redirect(CityBlogDir&"Login.asp?您还没有登陆或登入超时!")
			Response.End
		End IF
	End Sub
	
	Public Sub GetHttpUrl(Url)
		IF Url="" Then
			Url=Request.ServerVariables("HTTP_REFERER")
		End IF
		Response.Write "<script language=JavaScript1.1>alert('操作成功!');" 
		Response.Write " document.location='"& Url &"';</script>" 
		Response.End
	End Sub
	
	Public Property Get Var
		Var=CatyVar
	End Property 

'以下为用户博客处的过程或函数
	Public Sub Statistics(UserID)
		Dim SqlStr
		SqlStr="Select User_Count,User_Date,(Select Count(Article_ID) From Article Where Article.User_ID="& UserID &"),"&_
		"(Select Count(Article_ID) From Article Where Article.User_ID="& UserID &" And Article.IsPhoto=1),(select count(Reply_ID)"&_
		" from Tb_Reply where Reply_User="& UserId &"),(Select Sum(See_Count) From Article Where Article.User_ID="& UserID &") From Tb_User Where ID="& UserID &""
		Set Rs=Conn.Execute(SqlStr)
		SqlCount=SqlCount+1
		Response.Write "<ul id=""statistics"" class=""rightdiv"">" & Chr(13)
		Response.Write "<li>访问人数:"& Rs(0) &" 人</li>" & Chr(13)
		Response.Write "<li>创建时间:"& Rs(1) &"</li>" & Chr(13)
		Response.Write "<li>发表文章:"& Rs(2) &" 篇</li>" & Chr(13)
		Response.Write "<li>上传相片:"& Rs(3) &" 张</li>" & Chr(13)
		Response.Write "<li>回复总数:"& Rs(4) &" 篇</li>" & Chr(13)
		Response.Write "<li>阅读总数:"& Rs(5) &" 次</li>" & Chr(13)
		
		Response.Write "</ul>" & Chr(13)
		Rs.Close:Set Rs=Nothing
	End Sub
	
	Public Sub UserTb_BuoLuo(UserID)
		Set Rs=Conn.execute("Select id,ClassName,Bid,UID From [Tb_BuoLuo] Where UserID="& UserID &"")
		SqlCount=SqlCount+1
		Response.Write "<ul id=""buoluo"" class=""rightdiv"">" & Chr(13)
		IF NOT RS.EOF THEN
			DO WHILE NOT RS.EOF
				IF RS(2)=0 Then
					Response.Write "<li><a href="""& GetDir(Rs(3)) &"/BuLuo.asp"">"& Rs(1) & "</a> [我是酋长] </li>" & Chr(13)
				Else
					Response.Write "<li><a href="""& GetDir(Rs(3)) &"/BuLuo.asp"">"& Rs(1) & "</a></li>" & Chr(13)
				End IF
			Rs.MoveNext
			Loop
		Else
			Response.Write "<li>没有加入任何部落!</li>"
		End IF
		Rs.Close:Set Rs=Nothing
		Response.Write "</ul>" & Chr(13)
	End Sub
	
	Public Function BuoLuoName(UserID)
		Set Rs=Conn.Execute("Select Top 1 ClassName From Tb_BuoLuo Where UID="& UserID &" ")
		IF RS.EOF Then
			Rs.Close:SET Rs=Nothing
			Response.Write "对不起,此用户没有创建部落!"
			Response.End
		Else
			BuoLuoName=Rs(0)
			Rs.Close:SET Rs=Nothing
		End IF
	End Function
	
	Public Sub BuoUserList(UserID)
		Set Rs=Conn.Execute("select Tb_BuoLuo.UserID,Tb_User.User_Name from tb_buoluo,tb_user where UID=" & UserID & " and tb_buoluo.bid<>0 and tb_buoluo.userid=tb_user.id order by tb_user.id desc")
		Response.Write "<ul id=""buoluo"" class=""rightdiv"">"
		SqlCount=SqlCount+1
		IF NOT RS.EOF THEN
			DO WHILE NOT RS.EOF
				Response.Write "<li><a href="""& GetDir(Rs(0)) &"/"">"& Rs(1) & "</a></li>"
			Rs.MoveNext
			Loop
		Else
			Response.Write "<li>没有部落成员</li>"
		End IF
		Response.Write "</ul>"
		Rs.Close:SET Rs=Nothing
	End Sub

	Public Sub ArticleShow()
		Dim ArticleID,ArticleArr,ArticleTitle,Qer
		Dim RsCount,SqlStr,iii,ArticleArr2,UserName
		ArticleID=IsCInt(QueryStringPage("articleid",True))
		IF FormRequest("commentsact")="comments" Then
			SET RS=CONN.EXECUTE("select User_Pass,id FROM TB_USER WHERE USER_NAME='"& FormRequest("UserName") &"'")
			IF RS.EOF AND RS.BOF THEN
				UserName="匿名网友"
			ELSE
				IF RS(0)<>FormRequest("PassWord") THEN
					UserName="匿名网友"
				Else
					UserName="<a href="""& Getdir(Rs(1)) &""" target=""_blank"">" & FormRequest("UserName") & "</a>"
				END IF
			END IF
			Rs.Close:Set Rs=Nothing
			IF UserName="匿名网友" Then
				IF Not CommentsName Then
					Response.Write "<script>alert('对不起,您还没有登陆,不允许匿名发布评论!');" 
					Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
					Response.End
				End IF
			End IF
			IF NOT CodeIsTrue() Then
					Response.Write "<script>alert('对不起验证码错误!');" 
					Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
					Response.End
			End IF
			Conn.Execute("Update Article Set Re_Count=Re_Count+1 where Article_ID="&ArticleID&"")
			Dim ReTitle,Message
			ReTitle=HtmlStr(FormRequest("title"))
			Message=Left(FormRequest("message"),3500)
			IF ReTitle="" Or Message="" Then
					Response.Write "<script>alert('对不起请写入内容和标题!');" 
					Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
					Response.End
			End IF
			Dim IP
			IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
			IF IP="" Then
				IP=Request.ServerVariables("REMOTE_ADDR")
			End IF
			
			
			Conn.Execute ("INSERT INTO [Tb_Reply] ([Reply_User],[Reply_Blog_ID],[Reply_Name],[Reply_Title],[Reply_Info],[Reply_Time],[IP]) VALUES ("& UserID &","& ArticleID &",'"& UserName &"','"& ReTitle &"','"& Message &"','"& Now() &"','"& IP &"')")
			SaveReXml(UserID)
			DelCahe ("Hot_Articles")
			Response.Write "<script>alert('发表评论成功!');" 
			Response.Write "document.location='"&Request.ServerVariables("HTTP_REFERER")&"';</script>" 
			Response.End
		End IF
		Conn.Execute("Update Tb_User Set User_Count=User_Count+1 Where ID="&UserID&"")
		SqlCount=SqlCount+1
		Response.Write "<script language=""JavaScript"" src=""../../inc/common.js"" type=""text/javascript""></script>" & Chr(13)
		Response.Write "<script language=""JavaScript"" src=""../../inc/ubbcode.js"" type=""text/javascript""></script>" & Chr(13)
		Conn.Execute("Update Article Set See_Count=See_Count+1 Where User_ID="&UserID&" And Article_ID="&ArticleID&"")
		SqlCount=SqlCount+1
		Set Rs=Conn.Execute("Select Article_ID,User_Name,Article_Title,Article_Hid,Blog_Info,Whather,Article_Time,Article_ByClass,Article_Bl,Article_Form,Article_Tag,See_Count,Re_Count,(select Top 1 Article_ID FROM Article Where User_ID="&UserID&" And Article_Hid<>1 AND Article_ID>"&ArticleID&" ORDER BY Article_ID),(select Top 1 Article_ID FROM Article Where User_ID="&UserID&" And Article_Hid<>1 AND Article_ID<"&ArticleID&" ORDER BY Article_ID Desc),Article_Update,Blog_Quote From Article Where User_ID="& UserID &" And Article_Hid<>1 And Article_ID="&ArticleID&"")
		SqlCount=SqlCount+1
		IF Not Rs.Eof Then
			ArticleArr = Rs.GetRows
			Rs.Close:Set Rs=Nothing
		Else
			Rs.Close:Set Rs=Nothing
			Response.Write "<div class=""articleslist""><h1>对不起,此日志或相册可能被隐藏或者被作者删除!</h1></div>"
			Response.End
		End IF
		ArticleTitle=ArticleArr(2,0)
		IF ArticleArr(14,0)<>"" Then
			ArticleTitle=ArticleTitle & " [<a href=""Show.asp?/_articleid/"&ArticleArr(14,0)&".html"">上一篇</a>]" & Chr(13)
		End IF
		IF ArticleArr(13,0)<>"" Then
			ArticleTitle=ArticleTitle & " [<a href=""Show.asp?/_articleid/"&ArticleArr(13,0)&".html"">下一篇</a>]" & Chr(13)
		End IF
		IF ArticleArr(16,0)<>"" Then
			Qer="本文引用URL:" & UBBCode(ArticleArr(16,0)) & "<br/>"
		Else
			Qer=""
		End IF
		Response.Write "<div class=""articleslist"">" & Chr(13)
		Response.Write "<h1>" & ArticleTitle & "</h1>" & Chr(13)
		Response.Write "<h2>[ " & ArticleArr(6,0) & " | 作者:" & ArticleArr(1,0) & " | 出处:" & ArticleArr(9,0) & " | 天气:" & ArticleArr(5,0) & " ] 字体：<a href=""javascript:setFontSize(13)"">大</a> <a href=""javascript:setFontSize(11)"">中</a> <a href=""javascript:setFontSize(9)"">小</a></h2>" & Chr(13)
		Response.Write "<div class=""articleshow"" id=""show"">" & UBBCode(ArticleArr(4,0)) & "<h6 style=""float: left;width: 100%;font-size: 12px;font-weight: normal;"">"&Qer&""& ArticleArr(15,0) &"</h6></div>" & Chr(13)
		Response.Write "<h3>分类:<a href=""default.asp?/_classname/"& Left(ArticleArr(7,0),7) &".html"">" & Mid(ArticleArr(7,0),8) & "</a> | 部落:<a href=""../../ToBuoluo.asp?classname="& ArticleArr(8,0) &""">" & ArticleArr(8,0) & "</a> | 评论:" & ArticleArr(12,0) & " | <a href=""../../TrackBack.asp?ID="&ArticleID&""" target=""_blank"">引用通告</a> | 阅读次数(" & ArticleArr(11,0) & ")</h3>" & Chr(13)
		Response.Write "<h2>Tags:"& TagUbb(ArticleArr(10,0),"default.asp") &"</h2>" & Chr(13)
		Response.Write "</div>"
		'==================以下为评论列表============
		SqlStr="Select Reply_Name,Reply_Title,Reply_Info,Reply_Time From Tb_Reply Where Reply_User=" & UserID & " And Reply_Blog_ID=" & ArticleID & " Order By Reply_ID "& ReplyOrder
		Set Rs = Server.CreateObject("Adodb.RecordSet")
		Rs.open SqlStr,Conn, 1, 1
		SqlCount=SqlCount+1
		If Not Rs.Eof Then
			Rs.PageSize = UserPageSize
			MaxP=rs.PageCount
			Rs.AbsolutePage=QueryPage
			RsCount=Rs.RecordCount
			ArticleArr2 = Rs.GetRows(UserPageSize)
			Rs.Close:Set Rs=nothing
			for iii=0 to Ubound(ArticleArr2,2)
				Response.Write "<div class=""commentslist"">" & Chr(13)
				Response.Write "<h1> "&ArticleArr2(1,iii)&" " & Chr(13)
				CheckStr=Replace(ArticleArr2(2,iii),Chr(13),"")
				CheckStr=Replace(CheckStr,Chr(10),"")
				CheckStr=Replace(CheckStr,"'","’")
				CheckStr=Replace(CheckStr,"<","&lt;")
				CheckStr=Replace(CheckStr,">","&gt;")
				CheckStr=Replace(CheckStr,Chr(34),"&quot;")
				Response.Write ArticleArr2(0,iii)&" 于 "& ArticleArr2(3,iii) &" 发表评论  [<a href=""#re"" onclick=""quotes('"&CheckStr&"','"&HtmlStr(ArticleArr2(0,iii))&"','"&ArticleArr2(3,iii)&"')"">引用</a>]</h1>" & Chr(13)
				Response.Write "<div class=""articleshow"">"&UBBCode(ArticleArr2(2,iii))&"</div>" & Chr(13)
				Response.Write "</div>" & Chr(13)
			Next
			ArticleArr2=Empty
			PageList RsCount,QueryPage,UserPageSize,12,False
		Else
			Rs.Close:Set Rs=nothing
			Response.Write "<div class=""commentslist"">" & Chr(13)
			Response.Write "<h1>没有发表任何评论</h1>" & Chr(13)
			Response.Write "</div>" & Chr(13)
		End IF
		
		'==================以上为评论列表============
		Response.Write "<div id=""comments""><form name=""input"" method=""post"" action=""""><a name=""re""></a><input name=""commentsact"" type=""hidden"" value=""comments"" />" & Chr(13)
		Response.Write "<p>用 户: <input name=""username"" type=""text"" value="""&request.Cookies("cixiblog")("User_Name")&""" class=""commentinput"" /> " & Chr(13)
		Response.Write "密 码: <input name=""password"" type=""password"" value="""&request.Cookies("cixiblog")("User_PASS")&""" class=""commentinput"" /><br/>" & Chr(13)
		Response.Write "验 证: <input name=""CodeStr"" type=""text"" size=""18"" maxlength=""50"" class=""commentinput"" />"& Vcode2 &"<br/>" & Chr(13)
		Response.Write "标 题: <input name=""title"" type=""text"" value=""回复:"& ArticleArr(2,0) &""" style=""width:80%"" maxlength=""50"" /></p>" & Chr(13)
		Response.Write "<p id=""smilies"" style=""display:none;"">" & Smilies(45) & "</p>" & Chr(13)		
		Response.Write "<p>内 容: <textarea name=""message"" cols=""0"" style=""width:90%"" rows=""5""></textarea></p>" & Chr(13)
		Response.Write "<p align=""center""><input type=""submit"" name=""Submit"" value=""提交"" /></p> " & Chr(13)
		Response.Write "<p id=""ubb""><a href=""javascript:bold()"">[加粗]</a> " & Chr(13)
		Response.Write "<a href=""javascript:underline()"">[下划线]</a> " & Chr(13)
		Response.Write "<a href=""javascript:center()"">[居中] </a>" & Chr(13)
		Response.Write "<a href=""javascript:hyperlink()"">[网址] </a>" & Chr(13)
		Response.Write "<a href=""javascript:image()"">[图片] </a>" & Chr(13)
		Response.Write "<a href=""javascript:code()"">[代码] </a>" & Chr(13)
		Response.Write "<a href=""javascript:showIntro('smilies')"">[UBB表情]</a></p></form></div>" & Chr(13)
		ArticleArr=Empty
	End Sub
	
	
	Public Sub ArticleList()
		Conn.Execute("Update Tb_User Set User_Count=User_Count+1 Where ID="&UserID&"")
		SqlCount=SqlCount+1
		Response.Write "<script language=""JavaScript"" src=""../../inc/common.js"" type=""text/javascript""></script>" & Chr(13)
		Dim ArticleArr,RsCount,SqlStr,WhereStr,iii,ClassName
		WhereStr="Where User_ID="& UserID &" And Article_Hid<>1"
		ClassName=QueryStringPage("classname",True)
		IF ClassName<>"" Then
			WhereStr=WhereStr & " And Left(Article_ByClass,7)='" & ClassName & "'"
			'WhereStr=WhereStr & " And SUBSTRING(Article_ByClass,1,7)='" & ClassName & "'"
		ElseIF QueryStringPage("Month",True)<>"" Then
			WhereStr=WhereStr & " And Article_ByMonth Like '" & QueryStringPage("Month",True) & "%'"
		End IF
		IF GetRequest("Tag")<>"" Then
			WhereStr=WhereStr & " And Article_Tag Like '%" & GetRequest("Tag") & "%'"
		End IF
		IF QueryStringPage("date",True)<>"" Then
			WhereStr=WhereStr & " And Article_Time Like '%" & QueryStringPage("date",True) & "%'"
		End IF
		SqlStr="Select Article_ID,User_Name,Article_Title,Article_Hid,Article_Zy,Whather,Article_Time,Article_ByClass,Article_Bl,Article_Form,See_Count,Re_Count From Article "& WhereStr &" Order By Article_Hid Desc,Article_ID Desc"
		IF QueryStringPage("action",True)="list" Then
			UserPageSize=UserPageSize*5
		End IF
		Set Rs = Server.CreateObject("Adodb.RecordSet")
		Rs.open SqlStr,Conn, 1, 1
		SqlCount=SqlCount+1
		If Not Rs.Eof Then
			Rs.PageSize = UserPageSize
			MaxP=rs.PageCount
			Rs.AbsolutePage=QueryPage
			RsCount=Rs.RecordCount
			ArticleArr = Rs.GetRows(UserPageSize)
			Rs.Close:Set Rs=nothing
			PageList RsCount,QueryPage,UserPageSize,12,True
			for iii=0 to Ubound(ArticleArr,2)
				IF QueryStringPage("action",True)="list" Then
					ArticleTitle="<a href=""Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">" & ArticleArr(2,iii) & "</a> 分类:<a href=""default.asp?/_classname/" & Left(ArticleArr(7,iii),7) & ".html"">" & Mid(ArticleArr(7,iii),8) & "</a> 时间: " & YEAR(ArticleArr(6,iii)) & "-" & MONTH(ArticleArr(6,iii)) & "-" & Day(ArticleArr(6,iii)) & Chr(13)
					Response.Write "<h6 class=""list"">" & ArticleTitle & "</h6>" & Chr(13)
				Else
					ArticleTitle="<a href=""Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">"&ArticleArr(2,iii)&"</a>" & Chr(13)
					ArticleWhather="[ " & ArticleArr(6,iii) & " | 作者:" & UserName & " | 出处:" & ArticleArr(9,iii) & " | 天气:" & ArticleArr(5,iii) & " ]" & Chr(13)
					ArticleZy=UBBCode(ArticleArr(4,iii)) & Chr(13)
					ArticleFoot="分类:<a href=""default.asp?/_classname/"& Left(ArticleArr(7,iii),7) &".html"">" & Mid(ArticleArr(7,iii),8) & "</a> | 部落:<a href=""../../ToBuoluo.asp?classname="& ArticleArr(8,iii) &""">" & ArticleArr(8,iii) & "</a> | 评论:" & ArticleArr(11,iii) & " | <a href=""Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">阅读全文</a>(" & ArticleArr(10,iii) & ")" & Chr(13)
					Response.Write "<div class=""articleslist"">" & Chr(13)
					IF ArticleArr(3,iii)=2 Then
						Response.Write "<h5>" & ArticleTitle & "</h5>" & Chr(13)
					Else
						Response.Write "<h1>" & ArticleTitle & "</h1>" & Chr(13)
					End IF
					Response.Write Chr(13)
					Response.Write "<h2>" & ArticleWhather & "</h2>"
					Response.Write Chr(13)
					Response.Write "<div class=""articleshow"">" & ArticleZy & "</div>"
					Response.Write Chr(13)
					Response.Write "<h3>" & ArticleFoot & "</h3>"
					Response.Write Chr(13)
					Response.Write "</div>"
				End IF
				Response.Write Chr(13)
			Next
			ArticleArr=Empty
			PageList RsCount,QueryPage,UserPageSize,12,True
		Else
			Rs.Close:Set Rs=nothing
			Response.Write "<div class=""articleslist"">"
			Response.Write "<h1>没有发表任何日志</h1>"
			Response.Write "</div>"
		End IF
	End Sub
	
	Public Sub BuLuoArticleList()
		Response.Write "<script language=""JavaScript"" src=""../../inc/common.js"" type=""text/javascript""></script>" & Chr(13)
		Dim ArticleArr,RsCount,SqlStr,WhereStr,iii,ClassName
		WhereStr="Where Article_Hid<>1 And Article_Bl='"&BULUONAMES&"'"
		SqlStr="Select Article_ID,User_ID,User_Name,Article_Title,Article_Zy,Article_Time,Article_Form,See_Count,Re_Count From Article "& WhereStr &" Order By Article_ID Desc"
		'Response.Write SqlStr
		IF QueryStringPage("action",True)="list" Then
			UserPageSize=UserPageSize*5
		End IF
		Set Rs = Server.CreateObject("Adodb.RecordSet")
		Rs.open SqlStr,Conn, 1, 1
		SqlCount=SqlCount+1
		If Not Rs.Eof Then
			Rs.PageSize = UserPageSize
			MaxP=rs.PageCount
			Rs.AbsolutePage=QueryPage
			RsCount=Rs.RecordCount
			ArticleArr = Rs.GetRows(UserPageSize)
			Rs.Close:Set Rs=nothing
			PageList RsCount,QueryPage,UserPageSize,12,True
			for iii=0 to Ubound(ArticleArr,2)
				IF QueryStringPage("action",True)="list" Then
					ArticleTitle="<a href="""&GetDir(ArticleArr(1,iii))&"/Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">"&ArticleArr(3,iii)&"</a> 阅:("&ArticleArr(7,iii)&") 评:("& ArticleArr(8,iii) &")"
					Response.Write "<h6 class=""list"">" & ArticleTitle & "</h6>"
				Else
					ArticleTitle="<a href="""&GetDir(ArticleArr(1,iii))&"/Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">"&ArticleArr(3,iii)&"</a> 作者:<a href="""&GetDir(ArticleArr(1,iii))&""">"& ArticleArr(2,iii) &"</a>"
					ArticleZy=UBBCode(ArticleArr(4,iii))
					ArticleFoot="评论:" & ArticleArr(8,iii) & " | <a href="""&GetDir(ArticleArr(1,iii))&"/Show.asp?/_articleid/"&ArticleArr(0,iii)&".html"">阅读全文</a>(" & ArticleArr(7,iii) & ")"
					Response.Write "<div class=""articleslist"">"
					Response.Write "<h1>" & ArticleTitle & "</h1>"
					Response.Write Chr(13)
					Response.Write "<div class=""articleshow"">" & ArticleZy & "</div>"
					Response.Write Chr(13)
					Response.Write "<h3>" & ArticleFoot & "</h3>"
					Response.Write Chr(13)
					Response.Write "</div>"
				End IF
				Response.Write Chr(13)
			Next
			ArticleArr=Empty
			PageList RsCount,QueryPage,UserPageSize,12,true
		Else
			Rs.Close:Set Rs=nothing
			Response.Write "<div class=""articleslist"">"
			Response.Write "<h1>此部落没有任何文章</h1>"
			Response.Write "</div>"
		End IF
	End Sub
	

End Class
'response.write request.ServerVariables("SERVER_NAME")
%>