<!--#include file="Ex_CommonCls.asp"-->
<!--#include file="Ex_FsoCls.asp"-->
<%
'*********************************************************
'文件名称: Ex_SkinCls.asp
'功能描述: 易心博客模板类
'程序制作：易心
'官方网站: http://www.ex123.net
'论坛支持：http://bbs.ex123.net
'程序演示：http://exblog.ex123.net
'Copyright (C) 2007 ex123.net All rights reserved.
'LastUpdate:    2008-1-29
'*********************************************************
Class Ex_SkinCls
Private ExFso,Template,TemplateRoute,ExComm,Re
Private Sub Class_Initialize
	Set ExFso=new Ex_FsoCls
	Set ExComm=new Ex_CommonCls
	Set Re=new regexp
End Sub 
Private Sub Class_Terminate
	Set ExFso=Nothing 
	Set ExComm=Nothing 
	Set Re=Nothing
End Sub 
'********************
'更新模板缓存
'参数：无
'*******************
Public Sub RefreshSkinCache()
	ExComm.ClearCaches(Sn)
	ExComm.GetConfigCache("*")
	If ExComm.IsOblogSkin Then 
		GetOblogSkin
	Else 
		GetOtherSkin
	End If 
	ReplaceLabel
	CreateTxtCache
End Sub 
'********************
'功能：获取模板代码
'参数：文本模板文件名 default.html--主模板 show_log.html--辅模板 show_logcmt.html 评论模板
'*******************
Public Function GetTxtSkin(ByVal Fn)
	Dim Path
	Path="Cache\"&Fn
	If ExFso.CheckExist(Path,"file") Then 
		GetTxtSkin=ExFso.ReadFile(Path)
	Else
		RefreshSkinCache
		GetTxtSkin=ExFso.ReadFile(Path)
	End If 
End Function 
'********************
'功能：获取oblog模板
'参数：无
'*******************
Private Sub GetOblogSkin()
	Dim Rs
	Set Rs=Conn.Execute("select skin1,skin2 from Ex_Skin where id="&Application(sn&"DefaultSkin"))
	If Not Rs.eof And Not Rs.bof Then
		Template=Rs("skin1")&ExComm.BottomInfo
		Application.Lock
		Application(sn&"skin2")=Rs("skin2")
		Application.UnLock
	End If
	rs.close
End Sub

'*************
'功能：获得其他模板
'参数：无
'*************
Private Sub GetOtherSkin()
	Dim Temp
	Temp=Application(sn&"DefaultSkin")
	Temp=Split(Temp,"/")
	TemplateRoute="Template"&"\"&Temp(0)
	Template=ExFso.ReadFile(TemplateRoute&"\default.html")
	Application.Lock
	Application(sn&"skin2")=ExFso.ReadFile(TemplateRoute&"\Show_log.html")
	Application(sn&"skin3")=ExFso.ReadFile(TemplateRoute&"\Show_logcmt.html")
	Application.UnLock
End Sub 

'*************
'功能：替换标签
'参数：无
'*************
Private Sub ReplaceLabel()
	If ExComm.IsCache("skin1")=False Then 

		Template=replace(Template,"$show_bottom$",ExComm.BottomInfo)
		Template=Replace(Template,"$show_folder$",Application(sn&"DefaultSkin"))
		Template=Replace(Template,"$show_sidepanel$",show_sidepanel)
		Template=Replace(Template,"$show_head$",show_head)
		Template=Replace(Template,"$show_sitedescription$",Application(sn&"blogdescription"))

		Template=Replace(Template,"$show_placard$",show_placard)'替换博客公告
		Template=replace(Template,"$show_newblog$",show_newblog)'替换最新日志
		Template=replace(Template,"$show_comment$",show_comment)'替换最新评论
		Template=replace(Template,"$show_subject$",show_subject)'替换日志分类【竖向】
		Template=replace(Template,"$show_subject_l$",show_subject_l)'替换博客栏目【横向】
		Template=replace(Template,"$show_newmessage$",show_newmessage)'替换最新留言
		Template=replace(Template,"$show_info$",show_info)'替换博客信息【访问人数，日志数量等】
		Template=replace(Template,"$show_login$",show_login)'替换博客登录框
		Template=replace(Template,"$show_links$",show_links)'替换友情连接
		Template=replace(Template,"$show_blogname$",show_blogname)
		Template=replace(Template,"$show_search$",show_search)
		Template=replace(Template,"$show_photo$",show_photo)
		Template=replace(Template,"$show_xml$",show_xml)
		Template=replace(Template,"$show_blogurl$",Application(sn&"blogurl"))
		Template=replace(Template,"$show_version$",Application(sn&"version"))
		Template=replace(Template,"$show_calendar$",show_calendar())'替换博客日历
		Template=replace(Template,"$show_hottag$",show_hottag(Request.QueryString("classid")))'替换博客热门tags
		ReplaceULabel Template
		Application.Lock
		Application(sn&"skin1")=Template
		Application.UnLock
	End If 
End Sub 
'**************************************************
'生成模板文本缓存
'参数：无
'**************************************************
Private Sub CreateTxtCache
	Dim Skin1,Skin2,Rs
	Skin1=Application(sn&"skin1")
	Skin2=Application(sn&"skin2")
	ExFso.CreateFile "Cache/Show_Log.html",Skin2
	Set Rs=Conn.Execute("Select * from Ex_Pannel where eid='$show_adshead$'")
	If Not Rs.eof And Not Rs.bof Then 
		Skin1=Replace(Skin1,"$show_log$",Rs("Content")&"$show_log$")
	End If 
	Set Rs=Conn.Execute("select * from Ex_Pannel where eid='$show_adsbottom$'")
	If Not Rs.eof And Not Rs.bof Then 
		Skin1=Replace(Skin1,"$show_log$","$show_log$<br>"&Rs("Content"))
	End If  
	Set Rs=Conn.Execute("select * from Ex_Pannel where eid='$show_adscnthead$'")
	If Not Rs.eof And Not Rs.bof Then 
		Skin2=Replace(Skin2,"$show_adscnthead$",Rs("Content"))
	Else
		Skin2=Replace(Skin2,"$show_adscnthead$","")
	End If 
	Set Rs=Conn.Execute("select * from Ex_Pannel where eid='$show_adscntbottom$'")
	If Not Rs.eof And Not Rs.bof Then 
		Skin2=Replace(Skin2,"$show_adscntbottom$",Rs("Content"))
	Else
		Skin2=Replace(Skin2,"$show_adscntbottom$","")
	End If 
	ExFso.CreateFile "Cache/Default.html",Skin1
	ExFso.CreateFile "Cache/Show_LogMore.html",Skin2
	If ExComm.IsCache("skin3")=True Then 
		ExFso.CreateFile "Cache/Show_LogCmt.html",Application(sn&"skin3")
	End If 
	ExComm.ClearCaches(Sn)
End Sub 
'**************************************************
'替换用户自定义模块标签
'参数：Template--主模板代码
'**************************************************
Private Sub ReplaceULabel(Template)
		Dim Math,Maths,Rs,Label,SlidStr,Temp
		SlidStr=ExFso.ReadFile(TemplateRoute&"\Show_Pannel.html")
		Temp=SlidStr
		Re.pattern="\$u_((.|\s)*?)\$"
		Re.Multiline=True 
		Re.Global=True 
		Set Maths=Re.Execute(Template)
		For Each Math In Maths
			SlidStr=Temp
			Label=Math.value
			Set Rs=Conn.Execute("select title,content,pposition from ex_pannel where eid='"&Label&"'")
			If Rs(2)="侧栏" Then 
				SlidStr=Replace(SlidStr,"$show_title$",Rs(0))
				SlidStr=Replace(SlidStr,"$loop_data$",Rs(1))
			Else 
				SlidStr=Rs(1)
			End If 
			Template=Replace(Template,Label,SlidStr)
		Next 
End Sub 
'**************************************************
'获取标记循环部分
'参数：str--要处理的内容
'**************************************************
Public Function SplitLoopLabel(ByVal Str)
  Dim TempLabel,Math,Maths
  Re.pattern="\[loop\]((.|\s)*?)\[/loop\]"
  Re.Ignorecase=True 
  Re.Multiline=True
  Set Maths=Re.Execute(Str)
  For Each Math In Maths
	TempLabel=Replace(Math.value,"[loop]","")
	TempLabel=Replace(TempLabel,"[/loop]","")
  Next 
  SplitLoopLabel=TempLabel
End Function
'**************************************************
'替换标记循环部分
'参数：str--要处理的内容 content--要替换的内容
'**************************************************
Public Function ReplaceLoopLabel(ByVal Str,content)
  Re.pattern="\[loop\]((.|\s)*?)\[/loop\]"
  Re.Ignorecase=True 
  Re.Multiline=True
  ReplaceLoopLabel=Re.Replace(str,content)
End Function
'*****************************博客标记替换部分开始**************************

'*******************
'公告标记 $show_sidepanel$ 
'参数:无
'*******************
Private Function show_sidepanel
	Dim Rs,TempStr
	Set Rs=Conn.Execute("select * from Ex_pannel where pposition='侧栏' and isshow='显示' order by orderx asc")
	Do While Not Rs.eof 
		TempStr=TempStr&Rs("eid")
		Rs.Movenext
	Loop 
	show_sidepanel=TempStr
End Function 

'*******************
'公告标记 $show_head$ 
'参数:无
'*******************
Private Function show_head
	Dim Rs,TempStr
	Set Rs=Conn.Execute("select * from Ex_pannel where pposition='头部' and isshow='显示'  order by orderx asc")
	Do While Not Rs.eof 
		TempStr=TempStr&Rs("eid")
		Rs.Movenext
	Loop 
	show_head=TempStr
	Set Rs=Nothing 
End Function 
'*******************
'公告标记 $show_placard$ 
'参数:无
'*******************
Private Function show_placard()
	Dim TempStr,LoopStr,DataStr,LabelStr
	If ExComm.IsOblogSkin Then 
		TempStr=Application(sn&"placard")
	Else 
		TempStr=ExFso.ReadFile(TemplateRoute&"/show_Placard.html")
		LoopStr=SplitLoopLabel(TempStr)
		DataStr=Application(sn&"placard")
		LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
		TempStr=ReplaceLoopLabel(TempStr,LabelStr)
	End If 
	show_placard=TempStr
End Function 
'*******************
'日历标记 $show_calendar$
'参数：年 月 日
'Update:2007-8-31 
'*******************
Public Function show_calendar()
  Dim TempStr
  If Application(Sn&"RunMode")="静态" Then 
		Dim LoopStr,DataStr,LabelStr
		If ExComm.IsOblogSkin Then 
			TempStr="<div id=""Ex_html_calendar""></div>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_calendar.html")
			LoopStr=SplitLoopLabel(TempStr)
			DataStr="<div id=""Ex_html_calendar""></div>"
			LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If
	Else 
		If ExComm.IsOblogSkin Then 
			TempStr="$show_calendar$"
		Else
						TempStr=ExFso.ReadFile(TemplateRoute&"/show_calendar.html")
			LoopStr=SplitLoopLabel(TempStr)
			DataStr="$show_calendar$"
			LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
	End If 
 Show_Calendar=TempStr	
End Function
'********************************************
'显示最新日志 $show_newblog$
'参数：无
'********************************************
 Private Function show_newblog()
	If ExComm.IsCache("newblog")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,Content,LinkUrl,LinkFullText,LinkCutText,LabelTempStr
		Dim LogUrl
		Sql="select top "&Application(Sn&"newlog")&" id,title,classid,ishide,logpass from Ex_log where textnum<>0 and datediff('d','"&now&"',submittime)<=0 order by submittime desc"
		Set Rs=Conn.execute(sql)
		If ExComm.IsOblogSkin Then 
			Tempstr=Tempstr&"<ul id=""ex_newblog"">"
			Do While Not Rs.eof
				If Application(sn&"runmode")<>"动态" And Rs("ishide")="游客" And (Rs("logpass")="" Or IsNull(Rs("logpass")))Then 
					LogUrl=ExComm.CreateUrl(ExComm.GetClassFolder(Rs("classid")),ExComm.GetLogName(Rs("id")),"")
				Else
					LogUrl="blogview.asp?id="&Rs("id")
				End If 
				Content=Rs("title")
				TempStr=TempStr&"<li><a href="""&LogUrl&""" title="""&Replace(Trim(Content),"$","")&""">"&ExComm.CutStr(Trim(Content),30)&"</a></li>"
				Rs.movenext
			Loop
			Tempstr=Tempstr&"</ul>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_newblog.html")
			LoopStr=SplitLoopLabel(TempStr)
			Do While Not Rs.eof
				If Application(sn&"runmode")<>"动态" And Rs("ishide")="游客" And (Rs("logpass")="" Or IsNull(Rs("logpass"))) Then 
					LogUrl=ExComm.CreateUrl(ExComm.GetClassFolder(Rs("classid")),ExComm.GetLogName(Rs("id")),"")
				Else
					LogUrl="blogview.asp?id="&Rs("id")
				End If 
				Content=Rs("title")
				DataStr="<a href="""&LogUrl&""" title="""&Replace(Trim(Content),"$","")&""">"&ExComm.CutStr(Trim(Content),30)&"</a><br>"
				LinkUrl=LogUrl
				LinkFullText=Replace(Trim(Content),"$","")
				LinkCutText=ExComm.CutStr(Trim(Content),30)
				LabelTempStr=Replace(LoopStr,"$loop_linkurl$",LinkUrl)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)
				LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
				Rs.movenext
			Loop 
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
		Rs.close
		Set Rs=Nothing 
		Application.Lock
		Application(sn&"newblog")=TempStr
		Application.UnLock
		Show_NewBlog=TempStr
	Else 
		Show_NewBlog=Application(sn&"newblog")
	End If 
End Function
'********************************************
'显示最新评论 $show_comment$
'********************************************
Public Function show_comment()
	If ExComm.IsCache(sn&"comment")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,LinkUrl,LinkFullText,LinkCutText,LabelTempStr,content,CmtUrl
		Dim PRs
		Sql="select top "&Application(sn&"newCmt")&" id,cmtcomment,parentid,cmttitle,addtime from Ex_comment where isshow='是' order by addtime desc"
		Set Rs=Conn.Execute(sql)
		If ExComm.IsOblogSkin Then
			tempstr="<ul id=""ex_comment"">"
			Do While Not Rs.eof
				Set pRs=Conn.Execute("select id,ishide,logpass,classid from ex_log where id="&Rs("parentid"))
				If Application(sn&"runmode")<>"动态" And pRs("ishide")="游客" And (pRs("logpass")="" Or IsNull(pRs("logpass")))Then 
					CmtUrl=ExComm.CreateUrl(ExComm.GetClassFolder(pRs("classid")),ExComm.GetLogName(pRs("id")),"")&"#"&Rs("id")
				Else
					CmtUrl="blogview.asp?id="&Rs("parentid")&"&cmtid="&Rs("id")
				End If 
				Content=Rs("cmtcomment")
				tempstr=tempstr&"<li><a href="""&CmtUrl&""" title="""&Rs("cmttitle")&"&#10;"&Rs("addtime")&""">"&ExComm.CutStr(ExComm.clearHtml(Content),22)&"...</a></li>"
				Rs.movenext
			Loop
			tempstr=tempstr&"</ul>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_Comment.html")
			LoopStr=SplitLoopLabel(TempStr)
			Do While Not Rs.eof
				Set pRs=Conn.Execute("select id,ishide,logpass,classid from ex_log where id="&Rs("parentid"))
				If Not pRs.eof And Not pRs.bof Then 
					If Application(sn&"runmode")<>"动态" And pRs("ishide")="游客" And (pRs("logpass")="" Or IsNull(pRs("logpass")))Then 
						CmtUrl=ExComm.CreateUrl(ExComm.GetClassFolder(pRs("classid")),ExComm.GetLogName(pRs("id")),"")&"#"&Rs("id")
					Else
						CmtUrl="blogview.asp?id="&Rs("parentid")&"&cmtid="&Rs("id")
					End If 
					Content=Rs("cmtcomment")
					DataStr="<a href=""blogview.asp?id="&Rs("parentid")&"&cmtid="&Rs("id")&""" title="""&Rs("cmttitle")&"&#10;"&Rs("addtime")&""">...</a><br>"

					LinkUrl=CmtUrl
					LinkFullText=Rs("cmttitle")&"&#10;"&Rs("addtime")
					LinkCutText=ExComm.CutStr(ExComm.clearHtml(content),22)
					LabelTempStr=Replace(LoopStr,"$loop_linkurl$",LinkUrl)
					LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
					LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)
					LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
				End If 
				Rs.movenext
			Loop 
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
		Rs.Close
		Set Rs=Nothing 
		Application.Lock
		Application(sn&"comment")=TempStr
		Application.UnLock
		show_comment=tempstr
	Else 
		show_comment=Application(sn&"comment")
	End If 
End Function
'*********************************
'竖向显示分类$show_subject$ 
'*********************************
Public function show_subject
	If ExComm.IsCache(sn&"subject")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,Content,LinkUrl,LinkFullText,LinkCutText,LinkRss,LabelTempStr
		Dim ClassUrl
		Set Rs=Conn.execute("select * from Ex_class order by orderx asc")
		If ExComm.IsOblogSkin Then 
			TempStr="<ul id=""ex_subject"">"
			Do while not Rs.eof
				ClassUrl="index.asp?classid="&rs("id")
				If rs("openmode")=false Then
					If rs("default")=true Then
						TempStr=TempStr&"<li><a href="""&ClassUrl&""">"&Rs("classx")&"<span class=""ex_subjectnum"">("&ExComm.GetClassNum(Rs("id"))&")<span></a>&nbsp;&nbsp;<a href=""Rss2.asp?classid="&Rs("id")&"""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a></li>"
					Else
						TempStr=TempStr&"<li><a href="&rs("classurl")&">"&rs("classx")&"</a></li>"
					End If
				Else
					If rs("default")=true Then
						TempStr=TempStr&"<li><a href="""&ClassUrl&""" target=_blank>"&rs("classx")&"<span class=""ex_subjectnum"">("&ExComm.GetClassNum(Rs("id"))&")</span></a>&nbsp;&nbsp;<a href=""Rss2.asp?classid="&Rs("id")&"""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a></li>"
					Else
						TempStr=TempStr&"<li><a href="&rs("classurl")&" target=_blank>"&rs("classx")&"</a></li>"
					End if
				End if
				rs.movenext
			Loop
			TempStr=TempStr&"</ul>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_subject.html")
			LoopStr=SplitLoopLabel(TempStr)
			Do While Not Rs.eof
				ClassUrl="index.asp?classid="&rs("id")
				If rs("openmode")=false Then
					If rs("default")=true Then
						DataStr="<a href="""&ClassUrl&""">"&Rs("classx")&"<span class=""ex_subjectnum"">("&ExComm.GetClassNum(Rs("id"))&")<span></a>&nbsp;&nbsp;<a href=""Rss2.asp?classid="&Rs("id")&"""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a><br>"
						LinkCutText=rs("classx")&"("&ExComm.GetClassNum(Rs("id"))&")"
						LinkRss="<a href=""Rss2.asp?classid="&Rs("id")&"""><span class=""ex_subjectrss""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a>"
						LinkUrl=ClassUrl
					Else
						DataStr="<a href="&rs("classurl")&">"&rs("classx")&"</a><br>"
						LinkCutText=rs("classx")
						LinkRss=""
						LinkUrl=rs("classurl")
					End If
				Else
					If rs("default")=true Then
						DataStr="<a href="""&ClassUrl&""" target=_blank>"&rs("classx")&"<span class=""ex_subjectnum"">("&ExComm.GetClassNum(Rs("id"))&")</span></a>&nbsp;&nbsp;<a href=""Rss2.asp?classid="&Rs("id")&"""><span class=""ex_subjectrss""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a><br>"
						LinkCutText=rs("classx")&"("&ExComm.GetClassNum(Rs("id"))&")"
						LinkRss="<a href=""Rss2.asp?classid="&Rs("id")&"""><span class=""ex_subjectrss""><img src=""images/logo/rss.png"" border=""0"" alt=""订阅本栏目"" class=""ex_subjectrss""></a>"
						LinkUrl=ClassUrl
					Else
						DataStr="<a href="&rs("classurl")&" target=_blank>"&rs("classx")&"</a><br>"
						LinkCutText=rs("classx")
						LinkRss=""
						LinkUrl=rs("classurl")
					End if
				End If
				LinkFullText=rs("classx")
				LabelTempStr=Replace(LoopStr,"$loop_linkurl$",LinkUrl)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkrss$",LinkRss)
				LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
				Rs.movenext
			Loop 
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
		Rs.Close
		Set Rs=Nothing 
		Application.Lock
		Application(Sn&"subject")=TempStr
		Application.Unlock
		show_subject=TempStr
	Else
		Show_Subject=Application(Sn&"subject")
	End If 
	
End function
'*********************************
'横向显示栏目 $show_subject_l$
'*********************************
Public function show_subject_l
	If ExComm.IsCache("subject_l")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,Content,LinkUrl,LinkFullText,LinkCutText,labelTempStr
		Dim ClassUrl
		Set Rs=Conn.execute("select * from Ex_Channel order by ChannelOrder asc")
		If ExComm.IsOblogSkin Then 
			TempStr="<ul id=""ex_subject_l"">"
			Do while not Rs.eof
				TempStr=TempStr&"<li><a href="&rs("ChannelUrl")&">"&rs("ChannelName")&"</a></li>"
				rs.movenext
			Loop
			TempStr=TempStr&"</ul>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_subject_l.html")
			LoopStr=SplitLoopLabel(TempStr)
			Do While Not Rs.eof
				Content=rs("ChannelName")
				DataStr="<a href="&rs("ChannelUrl")&" target=_blank>"&Content&"</a>"
				LinkUrl=rs("ChannelUrl")
				LinkFullText=Replace(Trim(Content),"$","")
				LinkCutText=ExComm.CutStr(Trim(Content),30)
				LabelTempStr=Replace(LoopStr,"$loop_linkurl$",LinkUrl)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)
				LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
				Rs.movenext
			Loop 
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
		Rs.close
		Set Rs=Nothing 
		Application.Lock
		Application(sn&"subject_l")=TempStr
		Application.UnLock
		show_subject_l=TempStr
	Else
		show_subject_l=Application(sn&"subject_l")
	End If 
End Function
'***********************************************
'最新留言$show_newmessage$
'***********************************************
Public Function show_newmessage()
	If ExComm.IsCache("newmessage")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,Content,LinkUrl,LinkFullText,LinkCutText,LabelTempStr
		Set Rs=Conn.execute("select top "&Application(sn&"newmsg")&" title,id from Ex_message where parentid=0 and isshow='是' order by submittime desc")
		If ExComm.IsOblogSkin Then 
			TempStr="<ul id=""ex_newmessage"">"
			Do While Not rs.eof
				tempstr=tempstr&"<li><a href=""msgpost.asp?id="&rs("id")&""">"&Replace(ExComm.CutStr(rs("title"),30),"$","")&"</a></li>"
				rs.movenext
			Loop
			TempStr=TempStr&"</ul>"
		Else
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_newmessage.html")
			LoopStr=SplitLoopLabel(TempStr)
			Do While Not Rs.eof
				Content=Rs("title")
				DataStr="<a href=""msgpost.asp?id="&rs("id")&""">"&Replace(ExComm.CutStr(content,30),"$","")&"</a><br>"
				LinkUrl="msgpost.asp?id="&rs("id")
				LinkFullText=Replace(Trim(Content),"$","")
				LinkCutText=ExComm.CutStr(Trim(Content),30)
				LabelTempStr=Replace(LoopStr,"$loop_linkurl$",LinkUrl)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
				LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)
				LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
				Rs.movenext
			Loop 
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
		Rs.close
		Set Rs=Nothing 
		Application.Lock
		Application(Sn&"newmessage")=TempStr
		Application.Unlock
		show_newmessage=TempStr
	Else
		Show_newMessage=Application(Sn&"newmessage")
	End If 
End Function
'**************************************************
'显示日志信息$show_info$
'**************************************************
Private Function show_info()
	Dim tempstr
	If Application(Sn&"RunMode")="静态" Then 
		Dim LoopStr,DataStr,LabelStr
		If ExComm.IsOblogSkin  Then 
			TempStr="<div id=""Ex_html_info""></div>"
		Else 
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_info.html")
			LoopStr=SplitLoopLabel(TempStr)
			DataStr="<div id=""Ex_html_info""></div>"
			LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
	Else 
		If ExComm.IsOblogSkin Then 
			TempStr="$show_info$"
		Else
			TempStr=ExFso.ReadFile(TemplateRoute&"/show_info.html")
			LoopStr=SplitLoopLabel(TempStr)
			DataStr="$show_info$"
			LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
			TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		End If 
	End If 
	show_info=tempstr
End Function
'***************************************************
'作用:显示登陆窗口$show_login$
'***************************************************
Public Function show_login()
  Dim TempStr
  If Application(Sn&"Runmode")="静态" Then 
	Dim LoopStr,DataStr,LabelStr
	If ExComm.IsOblogSkin Then 
		TempStr="<div id=""Ex_html_login""></div>"
	Else 
		TempStr=ExFso.ReadFile(TemplateRoute&"/show_login.html")
		LoopStr=SplitLoopLabel(TempStr)
		DataStr="<div id=""Ex_html_login""></div>"
		LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
		TempStr=ReplaceLoopLabel(TempStr,LabelStr)
	End If
 Else 
	If ExComm.IsOblogSkin Then 
		TempStr="$show_login$"
	Else
		TempStr=ExFso.ReadFile(TemplateRoute&"/show_login.html")
		LoopStr=SplitLoopLabel(TempStr)
		DataStr="$show_login$"
		LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
		TempStr=ReplaceLoopLabel(TempStr,LabelStr)
	End If 
 End If 
 Show_login=TempStr
End Function
'************************************************
'显示友情连接$show_links$
'************************************************
 Public Function show_links()
	If ExComm.IsCache(sn&"links")=False Then 
		Dim Rs,Sql,Tempstr,LoopStr,LabelStr,DataStr,Content,P,LinkUrl,LinkFullText,LinkCutText,LabelTempStr,I
		Set p=Conn.Execute("select * from Ex_LinksCls order by orderx asc")
		If ExComm.IsOblogSkin Then 
			TempStr=TempStr&"<ul id=""ex_links"">"
			Do While Not p.eof
				Select Case CInt(Application(sn&"linkmode"))
				Case 0'图文混合现实模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by id desc"
				Case 1'先图片连接模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by logoexist desc"
				Case 2'先文字连接模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by logoexist asc"
				End Select
				TempStr=TempStr&"<li><div class=""ex_linkscls"">"&p("clsname")&"</div></li>"
				Set Rs=Conn.execute(sql)
				Do While Not Rs.eof
					If rs("linklogo")="无" then
						tempstr=tempstr&"<li><a href="""&rs("linkurl")&""" target=""_blank"">"&Left(rs("linkname"),15)&"</a></li>"
					Else
						tempstr=tempstr&"<li><a href="""&rs("linkurl")&""" title="""&rs("linkname")&""" target=""_blank""><img src="""&rs("linklogo")&""" border=0></a></li>"
					End if
					rs.movenext
				Loop
				Rs.close
				p.movenext
			Loop 
			TempStr=tempstr&"<li><a href=linkreg.asp><span id=""ex_links_add"">友情连接申请</span></a></li>"
			TempStr=TempStr&"</ul>"
		Else
			Do While Not p.eof
				Select Case CInt(Application(sn&"linkmode"))
				Case 0'图文混合现实模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by id desc"
				Case 1'先图片连接模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by logoexist desc"
				Case 2'先文字连接模式
					sql="select * from Ex_links where isshow=true and parentid="&p("id")&" order by logoexist asc"
				End Select
				Set Rs=Conn.execute(sql)
				TempStr=ExFso.ReadFile(TemplateRoute&"/show_links.html")
				LoopStr=SplitLoopLabel(TempStr)
				I=0
				Do While Not Rs.eof
					If I=0 Then 
						LabelTempStr=Replace(LoopStr,"$show_linkclsname$","<b>"&p("clsname")&"</b><br>")
					Else
						LabelTempStr=Replace(LoopStr,"$show_linkclsname$","")
					End If 
					Content=Rs("LinkName")
					If rs("linklogo")="无" then
						DataStr="<a href="""&rs("linkurl")&""" target=""_blank"">"&Left(Content,15)&"</a><br>"
						LinkCutText=ExComm.CutStr(Trim(Content),30)
					Else
						DataStr="<a href="""&rs("linkurl")&""" title="""&Content&""" target=""_blank""><img src="""&rs("linklogo")&""" border=0></a>"
						LinkCutText="<img src="""&rs("linklogo")&""" border=0>"
					End If
					LinkUrl=rs("linkurl")
					LinkFullText=rs("linkname")
					LabelTempStr=Replace(LabelTempStr,"$loop_linkurl$",LinkUrl)
					LabelTempStr=Replace(LabelTempStr,"$loop_linkfulltext$",LinkFullText)
					LabelTempStr=Replace(LabelTempStr,"$loop_linkcuttext$",LinkCutText)					
					LabelStr=LabelStr&Replace(LabelTempStr,"$loop_data$",DataStr)
					Rs.movenext
					I=I+1
				Loop 
				Rs.close
				Set Rs=Nothing 
				P.MoveNext
			Loop 	
		End If
		TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		show_links=TempStr
		Application.Lock
		Application(sn&"links")=TempStr
		Application.UnLock
	Else 
		show_links=Application(Sn&"links")
	End If 
 End Function
'*********************
'显示博客名称$show_blogname$
'参数 无
'*********************
Public Function show_blogname
	If ExComm.IsCache("blogname")=False Then
		ExComm.GetConfigCache("blogname")
	End If
	show_blogname=Application(sn&"blogname")
End Function
'*********************************
'显示搜索表单$show_search$
'*********************************
Public function show_search()
	Dim Str,TempStr,LoopStr,DataStr,LabelStr
	'修改成
	Str=Str&"<form name='search' method='get' action='"&Application(sn&"blogurl")&"index.asp' id=""ex_search"">"
	Str=Str&"<input type='hidden' name='action' id='action' value='search'>"
	Str=Str&"<select name='selecttype' id='selecttype'>"
	Str=Str&"<option value='title'>日志标题</option>"
	Str=Str&"<option value='tags'>日志标签</option>"
	Str=Str&"<option value='content'>日志内容</option></select><br>"
	Str=Str&"<input name='keyword' type='text' id='keyword' size='16' maxlength='40'>"
	Str=Str&" <input type='submit' name='Submit' value='搜索'></form>"
	If ExComm.IsOblogSkin=False Then 
		TempStr=ExFso.ReadFile(TemplateRoute&"/show_search.html")
		LoopStr=SplitLoopLabel(TempStr)
		DataStr=Str
		LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
		Str=ReplaceLoopLabel(TempStr,LabelStr)
	End If 
	show_search=Str
End Function
'*********************************
'显示像册$show_photo$
'*********************************
Public Function Show_photo()
	Dim Rs
	If ExComm.IsCache("photo")=False Then 
		Dim pics,links,texts,photo,p
		Show_photo=Show_Photo&"<center><script>"&vbcrlf
		Show_photo=Show_Photo&"var interval_time=5;"&vbcrlf
		Show_photo=Show_Photo&"var focus_width=160;"&vbcrlf
		Show_photo=Show_Photo&"var focus_height=160;"&vbcrlf
		Show_photo=Show_Photo&"var text_height=20;"&vbcrlf
		Show_photo=Show_Photo&"var text_align= 'center';"&vbcrlf
		Show_photo=Show_Photo&"var swf_height = focus_height+text_height;"&vbcrlf
		Show_photo=Show_Photo&"var swf_width = 160;"&vbcrlf
		Show_photo=Show_Photo&"var pics;"&vbcrlf
		Show_photo=Show_Photo&"var links;"&vbcrlf
		Show_photo=Show_Photo&"var texts;"&vbcrlf
		Show_photo=Show_Photo&"var p;"&vbcrlf
		Set Rs=Conn.Execute("select top 6 * from Ex_photos order by id desc")
		If Not Rs.eof And Not Rs.bof Then
			Do While Not Rs.eof 
					If Trim(Rs("sphotourl"))="" Or IsEmpty(Rs("sphotourl")) Or IsNull(Rs("sphotourl")) Then 
						If InStr(Rs("photourl"),"http://")=0 Then 
							links=links&Application(sn&"blogurl")&Replace(Rs("photourl"),"\","/")&"|"
							pics=pics&Application(sn&"blogurl")&Replace(Rs("photourl"),"\","/")&"|"
						Else
							links=links&Rs("photourl")&"|"
							pics=pics&Replace(Rs("photourl"),"\","/")&"|"
						End If 
						texts=texts&Rs("photoname")&"|"
					Else 
						pics=pics&Application(sn&"blogurl")&Replace(Rs("sphotourl"),"\","/")&"|"
						If InStr(Rs("photourl"),"http://")=0 Then 
							links=links&Application(sn&"blogurl")&Replace(Rs("photourl"),"\","/")&"|"
						Else
							links=links&Rs("photourl")&"|"
						End If 						
						texts=texts&Rs("photoname")&"|"
					End If 
					p=Application(sn&"blogurl")
				Rs.movenext
			Loop 
		End If 
		If Trim(pics)<>"" Then 
			pics=Mid(pics,1,Len(pics)-1)
		End If 
		If Trim(links)<>"" Then 
			links=Mid(links,1,Len(links)-1)
		End If 
		If Trim(texts)<>"" Then 
			texts=Mid(texts,1,Len(texts)-1)
		End If 
		Rs.close
		Show_photo=Show_Photo&"p='"&p&"';"&vbcrlf
		Show_photo=Show_Photo&"pics='"&pics&"';"&vbcrlf
		Show_photo=Show_Photo&"links='"&links&"';"&vbcrlf
		Show_photo=Show_Photo&"texts='"&texts&"';"&vbcrlf
		Show_photo=Show_Photo&"</script>"&vbcrlf
		Show_photo=Show_Photo&"<script src=""PhotoView.Js""></script>"&vbcrlf
		Show_photo=Show_Photo&"</center>"&vbcrlf
		application.lock
		application(sn&"photo")=show_photo
		application.unlock
	Else
		show_photo=application(sn&"photo")
	End If
	If ExComm.IsOblogSkin=False Then 
		Dim TempStr,LoopStr,DataStr,LabelStr
		TempStr=ExFso.ReadFile(TemplateRoute&"/show_Photo.html")
		LoopStr=SplitLoopLabel(TempStr)
		DataStr="<center><script src=""js/photo.js""></script></center>"
		LabelStr=LabelStr&Replace(LoopStr,"$loop_data$",DataStr)
		TempStr=ReplaceLoopLabel(TempStr,LabelStr)
		Show_Photo=TempStr
	End If 
End Function 
'**************************************************
'显示Tags连接 $show_hottag$ 
'参数: classids--要显示的是那个分类的
'**************************************************
Public Function show_hottag(classids)
	if Application(sn&"HotTags")="True" Then
		Dim show,hottags
		show="<div id=""ex_hottag""><span >热门tags:</span>&nbsp;"
		If classids<>"" And  classids<>"0" then
			Set hottags=Conn.execute("select top 5 * from Ex_Tags where classid="&classids&" order by times desc,id desc")
				Do While Not hottags.eof 
					show=show&"<a href=""index.asp?action=search&selecttype=tags&keyword="&server.urlencode(Trim(hottags("tagname")))&"&classid="&hottags("classid")&""" title="&hottags("times")&"次>"&Trim(hottags("tagname"))&"</a>&nbsp;"
					hottags.movenext
				Loop
				show=show&"<a href=tags.asp?classid="&classids&"&classname="&Trim(ExComm.GetClassName(classids))&">更多</a></div>"
			Else
				Set hottags=Conn.execute("select top 5 * from Ex_tags order by times desc,id desc")
				Do While Not hottags.eof 
					show=show&"<a href=""index.asp?action=search&selecttype=tags&keyword="&server.urlencode(Trim(hottags("tagname")))&"&classid="&hottags("classid")&""" title="&hottags("times")&"次>"&Trim(hottags("tagname"))&"</a>&nbsp;"
					hottags.movenext
				Loop
				show=show&"<a href=tags.asp>更多</a>"
			End If
		show_hottag=show&"</div>"
	end If
End Function 
 '****************************************************
 '显示rss标志$show_xml$
 '****************************************************
 Public Function show_xml()
 If ExComm.IsCache("show_xml")=False  then
	show_xml="<a href=""rss2.asp""><img src=images/admin/xml.gif border=0></a>"
	application.lock
	application(sn&"show_xml")=show_xml
	application.unlock
 Else
	show_xml=application(sn&"show_xml")
 End if
 End Function

 '以下是经常变动的标签 在动态模式下
'日历
Public Function Calendar(c_year,c_month,c_day)
	dim monthrs,monthsql,theday,ExNow
	ExNow=ExComm.ExNow()
	If IsNumeric(c_year)=False Then 
		c_year=0
	End If 
	If IsNumeric(c_month)=False And c_month<>"$show_month$" Then 
		c_month=0
	End If 
	If IsNumeric(c_day)=False Then 
		c_day=0
	End If 
	theday=0 '作为发表日志日期数组的下标
	redim linkdays(0)'发表日志数组
	If c_year=0 Or IsEmpty(c_year)Then'如果参数为空或者为0
		c_year=Year(now)'取当前年
	End If
	If request.querystring("c_month")="" Or request.querystring("c_month")="$show_month$" Or c_month="0" Then 
		If request.querystring("c_month")="" Or request.querystring("c_month")="$show_month$" then
			c_month=Month(now)
		Else
			c_month=12
			c_year=c_year-1
		End If
	End If 
	If c_day=0 Or IsEmpty(C_day)Then
		c_day=Day(now)
	End If
	If c_month>12 Then
		c_month=1
		c_year=c_year+1
	End If
	monthsql="select distinct(log_postday) from Ex_log where log_postyear="&c_year&" and log_postmonth="&c_month&" and textnum<>0 and datediff('d','"&ExNow&"',submittime)<=0 order by log_postday asc"
	Set monthrs=Conn.execute(monthsql)
	times=times+1
	Do While Not monthrs.eof
		ReDim preserve linkdays(theday)
		linkdays(theday)=monthrs("log_postday")
		theday=theday+1
		monthrs.movenext
	Loop
	Dim Month_Days(12) '每月天数 控制单元格输出 
	Month_Days(0)=""
	Month_Days(1)=31
	Month_Days(2)=28
	Month_Days(3)=31
	Month_Days(4)=30
	Month_Days(5)=31
	Month_Days(6)=30
	Month_Days(7)=31
	Month_Days(8)=31
	Month_Days(9)=30
	Month_Days(10)=31
	Month_Days(11)=30
	Month_Days(12)=31
	If IsDate("2/29/"&c_year) Then '判断是闰年还是平年
		month_days(2)=29
	End if
	Dim startday
	startday=Weekday(c_month&"/1/"&c_year) '判断日期开始单元格
	Dim calendarstr 
	'以下是在页面上输出的内容
	calendarstr=calendarstr&"<center><table width=""81%""  border=""0"" align=""center"" id=""ex_calendar"" style=""font-size:12px;"" cellpadding=""0"" cellspacing=""0"">"
	calendarstr=calendarstr&"  <tr>"
	calendarstr=calendarstr&"    <th colspan=""7""><a href="""&Application(sn&"blogurl")&"index.asp?c_year="&c_year-1&""" title=上一年><</a><a href="""&Application(sn&"blogurl")&"index.asp?c_month="&c_month-1&"&c_year="&c_year&""" title=上一月><</a>"&c_year&"年"&c_month&"月<a href="""&Application(sn&"blogurl")&"index.asp?c_month="&c_month+1&"&c_year="&c_year&""" title=下一月>></a><a href="""&Application(sn&"blogurl")&"index.asp?c_month="&c_month&"&c_year="&c_year+1&""" title=下一年>></a></th>"
	calendarstr=calendarstr&"  </tr>"
	calendarstr=calendarstr&"  <tr align=""center"">"
	calendarstr=calendarstr&"    <td width=""13%"">日</td>"
	calendarstr=calendarstr&"    <td width=""13%"">一</td>"
	calendarstr=calendarstr&"    <td width=""13%"">二</td>"
	calendarstr=calendarstr&"    <td width=""13%"">三</td>"
	calendarstr=calendarstr&"    <td width=""13%"">四</td>"
	calendarstr=calendarstr&"    <td width=""13%"">五</td>"
	calendarstr=calendarstr&"    <td width=""13%"">六</td>"
	calendarstr=calendarstr&"  </tr>"
	Dim i,m,flag
	For i=1 To 42
		flag=0'如果发表日志的日期数组中包含当前要输出的日期则flag变为1
		If i Mod 7=1 Then 
			calendarstr=calendarstr&"<tr align=center>"
		End If
		If i<startday Or (i-startday+1)>month_days(c_month) Then   '如果i小于开始日期或大于本月天数
			calendarstr=calendarstr&"<td>&nbsp;</td>" '输出空内容的单元格
		Else
			For m=0 To theday-1 'for循环用于判断现在输出的日期是不是发表日志日期
				If CInt((i-startday+1))=CInt(linkdays(m)) Then'如果是且日期小于天数
					If (i-startday+1)=CInt(day(date)) And CInt(c_month)=CInt(Month(now)) And CInt(c_year)=CInt(year(now)) Then'如果输出的是今天 
						calendarstr=calendarstr&"<td class=ex_calendar_today><a href="""&Application(sn&"blogurl")&"index.asp?c_year="&c_year&"&c_month="&c_month&"&c_day="&i-startday+1&"""><b>"&i-startday+1&"</b></a></td>"'输出连接 添加可修饰日历输出的CSS标签 Modify by Hotlion at 08-04-05
					Else
						calendarstr=calendarstr&"<td class=ex_calendar><a href="""&Application(sn&"blogurl")&"index.asp?c_year="&c_year&"&c_month="&c_month&"&c_day="&i-startday+1&"""><b>"&i-startday+1&"</b></a></td>"'输出连接 添加可修饰日历输出的CSS标签 Modify by Hotlion at 08-04-05
					End if
					flag=1
					Exit for '终止循环
				End If 
			Next         
			If flag=0 then'如果没有输出代有连接的日期
				If (i-startday+1)=CInt(day(date)) And CInt(c_month)=CInt(Month(now)) And CInt(c_year)=CInt(year(now)) Then
					calendarstr=calendarstr&"<td class=ex_calendar_today>"&i-startday+1&"</td>"'只是输出日期但没有连接 添加可修饰日历输出的CSS标签 Modify by Hotlion at 08-04-05
				else
					calendarstr=calendarstr&"<td class=ex_calendar>"&i-startday+1&"</td>"'只是输出日期但没有连接 添加可修饰日历输出的CSS标签 Modify by Hotlion at 08-04-05
				End if
			End If
		End If
		If i Mod 7=0 Then
			calendarstr=calendarstr&"</tr>"
		End if
  Next
  calendarstr=calendarstr&"</table></center>"
  Calendar=calendarstr
End Function
'站点信息
Public Function Info()
	Dim tempstr
	If ExComm.IsOblogSkin  Then 
		TempStr="<ul id=""ex_info"">"
		tempstr=TempStr&"<li>日志数量:"&ExComm.GetLogTotalCache&"</li>"
		tempstr=tempstr&"<li>评论数量:"&ExComm.GetCmtTotalCache&"</li>"
		tempstr=tempstr&"<li>留言数量:"&ExComm.GetMsgTotalCache&"</li>"
		tempstr=tempstr&"<li>注册用户:"&ExComm.GetUserTotalCache&"</li>"
		tempstr=tempstr&"<li>访问数量:"&ExComm.GetVisiteTotalCache&"</li>"
		TempStr=TempStr&"</ul>"
	Else 
		tempstr="日志数量:"&ExComm.GetLogTotalCache&"<br>"
		tempstr=tempstr&"评论数量:"&ExComm.GetCmtTotalCache&"<br>"
		tempstr=tempstr&"留言数量:"&ExComm.GetMsgTotalCache&"<br>"
		tempstr=tempstr&"注册用户:"&ExComm.GetUserTotalCache&"<br>"
		tempstr=tempstr&"访问数量:"&ExComm.GetVisiteTotalCache&"<br>"
	End If 
	Info=tempstr
End Function

'***************************************************
'作用:显示登陆窗口$show_login$
'***************************************************
Public Function Login()
Dim str,TempStr,DataStr,LoopStr,LabelStr
if CBool(ExComm.IsLogin("user"))=False  then
	str=""
	str=str& "<form id=""form1"" name=""form1"" method=""post"" action="""&Application(sn&"blogurl")&"UserLogin.asp?action=login"" id=""ex_loginform"">"
	str=str& "<table width=""98%"" border=""0"" id=""ex_login"">"
	str=str& "  <tr>"
	str=str& "    <td>用户名：</td>"
	str=str& "    <td><label>"
	str=str& "      <input name=""username"" type=""text"" id=""username"" size=""10""/>"
	str=str& "    </label></td>"
	str=str& "  </tr>"
	str=str& "  <tr>"
	str=str& "    <td>密 &nbsp;码：</td>"
	str=str& "    <td><label>"
	str=str& "      <input name=""userpwd"" type=""password"" id=""userpwd"" size=""10""/>"
	str=str& "    </label></td>"
	str=str& "  </tr>"
	str=str& "  <tr>"
	str=str& "    <td colspan=""2""><label>"
	str=str& "      <div align=""center"">"
	str=str& "        <input name=""remember"" type=""checkbox"" id=""remember"" value=""1"" />"
	str=str& "        记住密码"
	str=str& "      </div>"
	str=str& "    </label></td>"
	str=str& "  </tr>"
	str=str& "  <tr>"
	str=str& "    <td colspan=""2""><label>"
	str=str& "      <input type=""submit"" name=""Submit"" value=""登陆"" />"
	str=str& "      <a href="""&Application(sn&"blogurl")&"UserReg.asp"">用户注册</a>&nbsp;<a href="""&Application(sn&"blogurl")&"UserEditINFO.asp?action=FIndPwd"">忘记密码"
	str=str& "</a></label></td>"
	str=str& "  </tr>"
	str=str& "</table>"
	str=str& "	</form>"
Else 
	str=str&"<form id=""form1"" name=""form1"" method=""post"" action="""&Application(sn&"blogurl")&"UserLogin.asp?action=login"" id=""ex_loginform"">"
	str=str& "<table width=""98%"" border=""0"" cellpadding=""1"" cellspacing=""1"">"
	str=str& "  <tr>"
	str=str& "    <td colspan=""2""><div align=""center""><strong>登陆管理</strong></div></td>"
	str=str& "  </tr>"
	str=str& "  <tr>"
	str=str& "    <td>&nbsp;</td>"
	str=str& "    <td>&nbsp;</td>"
	str=str& "  </tr>"
	str=str& "  <tr>"
	str=str& "    <td> <div align=""center""><a href="""&Application(sn&"blogurl")&"UserEditInfo.asp"">资料修改</a></div></td>"
	str=str& "    <td><div align=""center""><a href="""&Application(sn&"blogurl")&"UserEditINFO.asp?action=loginout"">注销登陆</a></div></td>"
	str=str& "  </tr>"		
	str=str& "  <tr>"
	str=str& "    <td>&nbsp;</td>"
	str=str& "    <td>&nbsp;</td>"
	str=str& "  </tr>"
	str=str& "</table>"
	str=str&"</form>"
end If
Login=str
End Function
'显示阅读全文 回复 引用 编辑 删除连接
Public Function More(Id)
	Dim ComURL,Rs,show_more
	Id=Trim(Id)
	'If Request.Cookies(Md5(Sn))(Id)<>"www.ex123.net" Then 
		If InStr(LCase(request.servervariables("http_referer")),".html")<>0 And Application(Sn&"Runmode")="静态" Then 
			Conn.execute "update Ex_log set bits=bits+1 where id="&CLng(id)
		End If 
		If InStr(LCase(request.servervariables("script_name")),"blogview")<>0 And Application(Sn&"Runmode")="动态" Then 
			Conn.execute "update Ex_log set bits=bits+1 where id="&CLng(id)
		End If
	'End If 
	'Response.Cookies(Md5(Sn))(Id)<>"www.ex123.net"
	Rs=conn.execute("select id,classid,bits,iscmt,cmt,tb,ishide,textnum,logpass from Ex_log where id="&CLng(id))
	If Application(sn&"runmode")="静态" And Rs("ishide")="游客" And Rs("textnum")<>0  And (Trim(Rs("logpass"))="" Or IsNull(Rs("logpass"))) Then 
		show_more="<a href="&ExComm.CreateUrl(ExComm.GetClassFolder(Rs("classid")),ExComm.GetLogName(Rs("id")),"")&">阅读全文("&rs("bits")&")</a>"
		show_more=show_more&" | "&"<a href="&ExComm.CreateUrl(ExComm.GetClassFolder(Rs("classid")),ExComm.GetLogName(Rs("id")),"")&"#cmttop>回复("&rs("cmt")&")</a>"
	Else
		show_more="<a href="&Application(sn&"blogurl")&"blogview.asp?id="&rs("id")&">阅读全文("&rs("bits")&")</a>"
		show_more=show_more&" | "&"<a href="&Application(sn&"blogurl")&"blogview.asp?id="&rs("id")&"&iscomment="&rs("iscmt")&"#cmttop>回复("&rs("cmt")&")</a>"
	End if
	show_more=show_more&" | "&"<a href="&Application(sn&"blogurl")&"showtb.asp?id="&rs("id")&" target=_blank>引用("&rs("tb")&")</a>"
	If ExComm.IsLogin("admin")=True   Then 
		show_more=show_more&" | "&"<a href="&Application(sn&"blogurl")&"admin_log.asp?action=changeform&id="&rs("id")&" target=_blank>编辑</a>"
		show_more=show_more&" | "&"<a href="&Application(sn&"blogurl")&"admin_log.asp?action=del&id="&rs("id")&" onclick=""return confirm('是否要删除?与日志相关的评论也将被删除.')"">删除</a>"
	End if
	more=show_more
End Function
'*****************************博客标记替换部分结束**************************
End Class
%>