<!-- #Include File="Skin.asp" -->
<!-- #Include File="Cls_Class.asp" -->
<!-- #Include File="Cls_Public.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

Dim ViewData			'浏览数据数组
Dim iSpecialID,web_keywords
Web_Keywords=Replace(Web_Dim(4),"|",",")
iSpecialID = Cls.Code_ID("ID")

'//* 载入频道数据分类 *//
Public Sub Channel_Load(LoadType)
	Call Channel_Loader()
	Call Cid_Load()
	Call Class_Load()
	If LoadType = 0 Then
		Call DoWebHead(0,0)
	ElseIf LoadType = 1 Then
		Call DoWebHead(2,1)
	End If
End Sub

'//* 释放频道数据分类 *//
Public Sub Channel_End(Endtype)
	If IsArray(ViewData) Then Erase ViewData
	Call Class_End()
	If Endtype=0 Then Call DoWebEnd()
End Sub

'//* 频道数据分类并跳转网页 *//
Public Sub Channel_Redirect(frvar)
	Call Channel_End(0)
	Call Format_Redirect(frvar)
End Sub

Dim b_user,b_id,b_name,b_content,b_isopen,b_hits,b_tim,b_skinid,b_password,busername,b_skinmain,b_skinshowlog,b_links,b_leftcut,b_maincut,b_listtype,b_shownum,b_leftnum,b_listnum,b_photonum,b_photohnum,b_count1,b_count2,b_listphoto,b_listFriend
Dim IsMaster,hidden

'载入用户信息
Public Sub Blog_Load(bUserID)
	sql="select * from AsaiMHBlog where username='"&bUserID&"'"
	set rs=cls.exec(sql,1)
	if rs.eof then
		response.Redirect(Cls.Web_Dir&"Blog/")
		response.End()
	else
		hidden=rs("hidden")
		If SqlType = 1 Then
			if hidden=0 then
				Call Cls.Out_Msg("该用户的博客还未审核通过！\n\n点击关闭窗口……","javascript:window.close()")
				Exit Sub
			end if
		Else
			if hidden=False then
				Call Cls.Out_Msg("该用户的博客还未审核通过！\n\n点击关闭窗口……","javascript:window.close()")
				Exit Sub
			end if
		end if
		b_id=rs("id")
		b_name=rs("blogname")
		b_user=rs("username")
		b_content=rs("content")
		b_isopen=rs("hidden")
		b_hits=rs("hits")
		b_tim=rs("tim")
		b_password=trim(rs("password"))
		b_skinid=rs("skin")
		b_skinmain=trim(rs("user_skin_main"))
		b_skinshowlog=trim(rs("user_skin_showlog"))
		b_links=rs("links")
		b_leftcut=rs("left_cut")
		b_maincut=rs("main_cut")
		b_listtype=rs("list_type")
		b_shownum= rs("show_num")
		b_leftnum= rs("left_num")
		b_listnum=rs("list_num")
		b_photonum=rs("photo_num")
		b_photohnum=rs("photo_hnum")
		b_count1=rs("count1")
		b_count2=rs("count2")
		b_listphoto=rs("list_photo")
		b_listfriend=rs("list_friend")
	end if
	rs.close 
	IsMaster=False
	If login_username=b_user then IsMaster=True
	If b_skinid=0 or cls.is_null(b_skinmain)="" or cls.is_null(b_skinshowlog)="" then 
		sql="select top 1 id,skinmain,skinshowlog from AsaiMHUserSkin where isdefault=1" 
		dim srs
		set srs=cls.exec(sql,1)
		if srs.eof then
			response.write "无默认的博客的用户模板，请联系管理员添加！"
			response.End()
		else
			b_skinid=srs("id")
			b_skinmain=srs("skinmain")
			b_skinshowlog=srs("skinshowlog")
			sql="select * from AsaiMHblog where id="&b_id
			call cls.exec("",-1)
			rs.open sql,conn,1,3
			if not rs.eof then 
				rs("skin")=b_skinid
				rs("user_skin_main")=b_skinmain
				rs("user_skin_showlog")=b_skinshowlog
				rs.update
			end if
			rs.close
		end if
		srs.close 
	End If
	If b_password<>"" and not IsMaster  then
		if Cls.Cookies_Get("blogpsd_"&b_user)<>b_password then
			if trim(request.form("psd"))<>"" then
				if trim(request.form("psd"))=b_password then
					Call Cls.Cookies_Set("blogpsd_"&b_user,trim(request.form("psd")))
					response.Redirect(Cls.web_dir&"Blog/?"&b_user)
				Else
					Call PutOut("<table border=1 bordercolor='#0099FF' align=center width=450 ><form name=pass_frm action='"&Cls.web_dir&"Blog/Index.asp?"&b_user&"' method=post ><tr><td bgcolor='#0099FF'  height=30>  &nbsp;<font color='#FFFFFF'>密码输入</font></td></tr><tr><td height=170 align=center><font color=red>你输入的密码是错误的!</font><br /><br />要访问此博客，请输入正确密码：<br /><br /><input type=password name=psd> <input type=submit value='进入'></td></tr></form></table><br /><br />",Cls.Web_Name&"博客 - "&b_name&" - 访问需要密码-你输入的密码错误","","","","")
				end if
			else
				Call PutOut("<table border=1 bordercolor='#0099FF' align=center width=450 ><form name=pass_frm action='"&Cls.web_dir&"Blog/Index.asp?"&b_user&"' method=post ><tr><td bgcolor='#0099FF'  height=30>  &nbsp;<font color='#FFFFFF'>密码输入</font></td></tr><tr><td height=170 align=center>访问此博客需要密码，请输入密码：<br /><br /><input type=password name=psd> <input type=submit value='进入'></td></tr></form></table><br /><br />",Cls.Web_Name&"博客 - "&b_name&" - 访问需要密码","","","","")
			end if
			response.end()
		end if
	End If
	If b_isopen=true and not IsMaster then
		Call Cls.Exec("update AsaiMHblog set hits=hits+1 where id="&b_id,0)  
	Else
		If not(is_logintrue and login_username=b_user) and not IsMaster then
			Call PutOut("<table border=1 bordercolor='#0099FF' align=center width=450 ><tr><td bgcolor='#0099FF'  height=30>  &nbsp;<font color='#FFFFFF'>错误提示</font></td></tr><tr><td height=170 align=center>该博客已经关闭，请联系站长!</td></tr></table><br /><br />",Cls.Web_Name&"博客 - "&b_name&" - 该博客已经关闭","","","","")
			response.End()
		End If
	End if
End Sub

Dim v_id,v_username,v_name,v_pic,v_tim,v_counter,v_keyes,v_tags,tmp_err
Dim iSpecialTopic, iSpecialRemark, iSpecialTim

Public Function ShowChannelIndex(IsHtml)
	Tit=Cls.ChannelName:tit_fir=""
	Tit_Dir = "频道首页"
	HtmlContent = Cls.ReadTemplate(0)
	Call LoadChannelMainList(0)
	Call LoadChannelSort(0,0)
	Call LoadChannelSearch()
	HtmlContent = Html.ReadWebHead(HtmlContent)
	HtmlContent = Html.ReadWebEnd(HtmlContent)
	HtmlContent = Html.ReadBloger(HtmlContent)
	HtmlContent = Html.ReadBlogData(HtmlContent)
	HtmlContent = Html.ReadBlogPhoto(HtmlContent)
	HtmlContent = Html.ReadBlogTags(HtmlContent)
	HtmlContent = Html.ReadUserLogin(HtmlContent)
	HtmlContent = Html.ReadFlashPic(HtmlContent)
	HtmlContent = Html.ReadCast(HtmlContent)
	HtmlContent = Html.ReadCast2(HtmlContent)
	HtmlContent = Html.ReadVote(HtmlContent)
	HtmlContent = Html.ReadChannelMenu(HtmlContent)
	HtmlContent = Cls.ReHtml(HtmlContent,0)
	If IsHtml=True Then
		ShowChannelIndex = HtmlContent
	Else
		Response.Write HtmlContent
	End If
End Function

Public Function ShowChannelLists(IsHtml,ClsID)
	tit=Cls.ChannelTit&"列表"
	Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
	tit_fir=Cls.ChannelName
	IndexUrl=Cls.Web_Dir & Cls.ChannelDir
	HtmlContent = Cls.ReadTemplate(4)
	Call LoadChannelMainList(ClsID)
	Call LoadChannelSort(ClsID,0)
	Call LoadChannelSearch()
	Call Html.LoadReplaced()		
	HtmlContent = Html.ReadWebHead(HtmlContent)
	HtmlContent = Html.ReadWebEnd(HtmlContent)
	HtmlContent = Html.ReadUserLogin(HtmlContent)
	HtmlContent = Html.ReadBloger(HtmlContent)
	HtmlContent = Html.ReadBlogData(HtmlContent)
	HtmlContent = Html.ReadBlogPhoto(HtmlContent)
	HtmlContent = Html.ReadBlogTags(HtmlContent)
	HtmlContent = Html.ReadChannelMenu(HtmlContent)
	HtmlContent = Cls.ReHtml(HtmlContent,0)	
	If IsHtml=True Then
		ShowChannelLists = HtmlContent
	Else
		Response.Write HtmlContent
	End If	
End Function

Public Function ShowChannelList(IsHtml,ClsID,PgID,ListAction)
	Select Case ListAction
	Case "top"
		tit="固顶"&Cls.ChannelTit
		tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	Case "focus"
		tit="焦点"&Cls.ChannelTit
		tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	Case "good"
		tit="推荐"&Cls.ChannelTit
		tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	Case "hot"
		tit="热门"&Cls.ChannelTit
		tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	Case "search"
		tit=Cls.ChannelTit&"搜索"
		tit_fir=Cls.ChannelName
		Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	Case "special"
		tit=Cls.ChannelTit&"专题"
		tit_fir=Cls.ChannelName	
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(4)
		HtmlContent = Replace(HtmlContent,"{$SpecialID}",iSpecialID)
		HtmlContent = Replace(HtmlContent,"{$s_name}",iSpecialTopic)
		HtmlContent = Replace(HtmlContent,"{$s_remark}",iSpecialRemark)
		HtmlContent = Replace(HtmlContent,"{$s_tim}",iSpecialTim)
	Case Else
		tit=Cls.ChannelTit&"列表"
		tit_fir=Cls.ChannelName
		Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(3)
	End Select
	Dim ListContent,ListContents,HtmlUrl
	Dim Mhead,obj_search,obj_page
	Dim Tempstr, PageCt
	Dim SQL, i, foundstr, ListStyle
	Dim sDot,sTitle, sTopic, BestCode, BestString
	Dim ArticleTopic, ClassName, HtmlFileUrl,ImageURL, WriteTime, LinkTarget, HtmlFileName
	Dim tmp_sql,tmp_sql_order,tmp_url,tmp_keyword
	Mhead="":tmp_url=""
	Select Case ListAction
	Case "hot"
		mhead=tit
		tmp_sql="A.hits>20"
		tmp_sql_order="A.hits desc"
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=hot' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "good"
		mhead=tit
		tmp_sql="A.isgood=1"
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=good' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "focus"
		mhead=tit
		tmp_sql="A.isfocus=1"
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=focus' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "top"
		mhead=tit
		tmp_sql="A.istop=1"	
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=top' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "search"
		if int(ClsID)>0 then
			tmp_sql="A.ClassID in ("&Class_Cid_Get(Clsid)&")"
		else
			tmp_sql=""
		end if
		set obj_search=New Cls_Search
		obj_search.inc_url="?c_id="&ClsID&"action=Search&"
		obj_search.inc_sql=tmp_sql
		call obj_search.format_search("A.BlogName","A.BlogName,A.username",2,1,0)
		tmp_url=obj_search.inc_url
		tmp_sql=obj_search.inc_sql
		tmp_keyword=obj_search.keyword 
		mhead=mhead&"（"&Cls.code_html(obj_search.keyword,1,0)&"）"
		set obj_search=nothing
	Case "special"
		tmp_url="?ID="&iSpecialID&"&"
		tmp_sql="A.SpecialID="&iSpecialID
		mhead=tit
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=top' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case Else
		if int(ClsID)>0 then tmp_sql="A.ClassID="&ClsID
		mhead=tit
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=special&id="&iSpecialID&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	End Select
	if tmp_sql="" then
		tmp_sql="A.hidden=1"
	else
		tmp_sql="A.hidden=1 and "&tmp_sql
	End if
	if tmp_sql_order="" then
		tmp_sql_order="A.id desc"
	else
		tmp_sql_order=tmp_sql_order&",A.id desc"
	End if
	set obj_page=New Cls_PageCute
	obj_page.nummer=Cls.ChannelListNum
	obj_page.page_tit=Cls.ChannelTit
	obj_page.page_unit=Cls.ChannelUnit
	obj_page.v_id="A.id"
	if action="hot" then obj_page.v_id="A.hits"
	'tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
	call obj_page.p_init("","[AsaiMHBlog] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,"")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	If Instr(HtmlContent,"[ShowList]") > 0 Then
		ListContents=""
		ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
		'检查分页数据
		If PgID<>"" then obj_page.setpage=PgID
		Call obj_page.p_main("A.ID,A.ClassID,A.BlogName,A.hits,A.username,A.Tim,A.isgood,C.ClassName","[AsaiMHBlog] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,tmp_sql_order)
		'循还读数据
		For i=1 to obj_page.page_num
		If rs.eof Then exit for
		If (i Mod 2) = 0 Then
			ListStyle = "ll" & 1
		Else
			ListStyle = "ll" & 2
		End If
		If Rs("isgood") <> 0 Then
			BestCode = 2
			BestString = "<font color='red'>推荐</font>"
		Else
			BestCode = 1
			BestString = ""
		End If
		'前标
		sDot=Cls.GetDot(false,false,rs("isgood"))
		'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
		sTitle = Cls.Cuted(Rs("blogname"), Cls.ChannelCuteNum)
		'sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
		'-------------搜索关键字显亮 
		sTitle = Cls.Channel_Search(sTitle)
		ClassName = Rs("ClassName")
		HtmlFileUrl = Cls.Web_Dir&  "Blog/?" & Rs("username")
		WriteTime = Cls.ShowDateTime(Rs("tim"),6)
		If Cls.ChannelIsNewWindow <> 0 Then
			LinkTarget = " target=""_blank"""
		Else
			LinkTarget = ""
		End If
		ArticleTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='博客名称：" & Rs("blogname") & "&#13;&#10;创建时间：" & Rs("tim") & "&#13;&#10;访问次数：" & Rs("hits") & "'>" & sTitle & "</a>"
		Tempstr = ListContent
		Tempstr = Replace(Tempstr, "{$PhotoTopic}", ArticleTopic)
		Tempstr = Replace(Tempstr, "{$PhotoPicture}", Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("blogname") & "'" & LinkTarget & " class=""im"">" & ImageUrl & "</a>"))
		Tempstr = Replace(Tempstr, "{$PhotoID}", Rs("ID"))
		Tempstr = Replace(Tempstr, "{$PhotoTitle}", sTitle)
		Tempstr = Replace(Tempstr, "{$Title}", Rs("blogname"))
		Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
		Tempstr = Replace(Tempstr, "{$Dot}", sDot)
		Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
		Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
		Tempstr = Replace(Tempstr, "[]", "")
		Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
		Tempstr = Replace(Tempstr, "{$Time}", WriteTime)
		Tempstr = Replace(Tempstr, "{$SoftHits}", Rs("hits"))
		Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
		Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
		Tempstr = Replace(Tempstr, "{$BestString}", BestString)
		ListContents=ListContents&Tempstr
		rs.movenext
		Next	
		rs.close
		If Cls.ChannelIsCreatHtml = True And ListAction<>"search" then
			obj_page.pageurl="index_"
			obj_page.pagevar=""
			obj_page.pagefirvar="index_1"&Cls.ChannelHtmlExtName
			obj_page.pageext=Cls.ChannelHtmlExtName
		Else
			if ListAction="search" then
				obj_page.pageurl = tmp_url
			elseif  ListAction<>"" and ListAction<>"List" then
				obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
			else
				obj_page.pageurl="?c_id="&ClsID&"&"
			end if
		End if
		'内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call Html.LoadReplaced()
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
		HtmlContent = Html.ReadBloger(HtmlContent)
		HtmlContent = Html.ReadBlogData(HtmlContent)
		HtmlContent = Html.ReadBlogPhoto(HtmlContent)
		HtmlContent = Html.ReadBlogTags(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
		If IsHtml=True Then
			ShowChannelList = HtmlContent
		Else
			Response.Write HtmlContent
		End If
		set obj_page=nothing 	
	End If
End Function

'//* 列表初始 *//
Public Sub LoadListFirst()
	Select Case action
	Case "top"
		Call ShowChannelList(False,Cid,"","top")
	Case "focus"
		Call ShowChannelList(False,Cid,"","focus")		
	Case "good"
		Call ShowChannelList(False,Cid,"","good")
	Case "hot"
		Call ShowChannelList(False,Cid,"","hot")
	Case "search"
		Call ShowChannelList(False,Cid,"","search")
	Case Else
		if int(cid)<1 then Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
		If Class_Child_Get(Cid)=0 Then
			Call ShowChannelList(False,Cid,"","List")
		Else
			Call ShowChannelLists(False,Cid)
		End If
	End Select
End Sub

Public Function ShowChannelList2(sType,ClsID,PgID,ListAction)
	dim tmp_where
	If sType=2 Then
		Cls.ChannelTit="相片"
		tmp_where=" and type=2"
	Else
		Cls.ChannelTit="日志"
		tmp_where=" and type=1"
	End If
	Select Case ListAction
	Case "hot"
		tit="热门"&Cls.ChannelTit
		Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(1)
	Case "search"
	    	tit=Cls.ChannelTit&"搜索"
	    	tit_fir=Cls.ChannelName
		Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(1)
	Case Else
		tit=Cls.ChannelTit&"列表"
		tit_fir=Cls.ChannelName
	    	Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(1)
	End Select
	Dim ListContent,ListContents,HtmlUrl
	Dim Mhead,obj_search,obj_page
	Dim Tempstr, PageCt
	Dim SQL, i, foundstr, ListStyle
	Dim sDot,sTitle, sTopic, BestCode, BestString
	Dim ArticleTopic, ClassName, HtmlFileUrl,ImageURL, WriteTime, LinkTarget, HtmlFileName
	Dim tmp_sql,tmp_sql_order,tmp_url,tmp_keyword
	Mhead="":tmp_url=""
	Select Case ListAction
	Case "hot"
		mhead=tit
		tmp_sql="count>10"
		tmp_sql_order="count desc"
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=hot' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "search"
		tmp_sql=""
		set obj_search=New Cls_Search
		obj_search.inc_url="?type="&stype&"&action=Search&"
		obj_search.inc_sql=tmp_sql
		call obj_search.format_search("Tags","Topic,username,Tags",2,1,0)
		tmp_url=obj_search.inc_url
		tmp_sql=obj_search.inc_sql
		tmp_keyword=obj_search.keyword
		mhead=mhead&"（"&Cls.code_html(obj_search.keyword,1,0)&"）"
		set obj_search=nothing
	Case Else
	  if int(ClsID)>0 then tmp_sql="A.ClassID="&ClsID
	  mhead=tit
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href="&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ClsID&" target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	End Select
	if tmp_sql="" then
		tmp_sql="hidden=1"
	else
		tmp_sql="hidden=1 and "&tmp_sql
	End if
	if tmp_sql_order="" then
		tmp_sql_order="id desc"
	else
		tmp_sql_order=tmp_sql_order&",id desc"
	End if
	set obj_page=New Cls_PageCute
	obj_page.nummer=Cls.ChannelListNum
	obj_page.page_tit=Cls.ChannelTit
	obj_page.page_unit=Cls.ChannelUnit
	obj_page.v_id="id"
	if action="hot" then obj_page.v_id="count"
	'tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
	call obj_page.p_init("","[AsaiMHBlogData]",tmp_sql&tmp_where,"")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	If Instr(HtmlContent,"[ShowList]") > 0 Then
		ListContents=""
		ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
		'检查分页数据
		If PgID<>"" then obj_page.setpage=PgID
			Call obj_page.p_main("ID,Topic,count,username,pic,Tim","[AsaiMHBlogData]",tmp_sql&tmp_where,tmp_sql_order)
			'循还读数据
			For i=1 to obj_page.page_num
			If rs.eof Then exit for
			If (i Mod 2) = 0 Then
				ListStyle = "ll" & 1
			Else
				ListStyle = "ll" & 2
			End If
			BestCode = 1
			BestString = ""
			'前标
			sDot=Cls.GetDot(false,false,false)
			'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
			sTitle = Cls.Cuted(Rs("topic"), Cls.ChannelCuteNum)
			'sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
			'-------------搜索关键字显亮 
			sTitle = Cls.Channel_Search(sTitle)
			ClassName = Cls.ChannelTit
			HtmlFileUrl = Cls.Web_Dir&  "Blog/View/?" & Rs("ID")
			WriteTime = Cls.ShowDateTime(Rs("tim"),6)
			If Cls.ChannelIsNewWindow <> 0 Then
				LinkTarget = " target=""_blank"""
			Else
				LinkTarget = ""
			End If
			If rs("Pic")="" then
				ImageUrl = Cls.Web_Dir&"Skin/no_pic.gif"
			else
				ImageUrl = rs("Pic")
			end if
			ImageUrl = "<img src='"&ImageUrl&"' width=100 height=90 class=""ig"">"		
			ArticleTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='"&Cls.ChannelTit&"名称：" & Rs("topic") & "&#13;&#10;发表时间：" & Rs("tim") & "&#13;&#10;浏览次数：" & Rs("count") & "'>" & sTitle & "</a>"
			Tempstr = ListContent
			Tempstr = Replace(Tempstr, "{$Topic}", ArticleTopic)
			Tempstr = Replace(Tempstr, "{$Picture}", Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("topic") & "'" & LinkTarget & ">" & ImageUrl & "</a>"))
			Tempstr = Replace(Tempstr, "{ID}", Rs("ID"))
			Tempstr = Replace(Tempstr, "{$Title}", Rs("topic"))
			Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
			Tempstr = Replace(Tempstr, "{$Dot}", sDot)
			Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
			Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
			Tempstr = Replace(Tempstr, "[]", "")
			Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
			Tempstr = Replace(Tempstr, "{$Time}", WriteTime)
			Tempstr = Replace(Tempstr, "{$Hits}", Rs("count"))
			Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
			Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
			Tempstr = Replace(Tempstr, "{$BestString}", BestString)
			ListContents=ListContents&Tempstr
			rs.movenext
		Next	
		rs.close
		If Cls.ChannelIsCreatHtml = True And ListAction<>"search" then
			obj_page.pageurl="index_"
			obj_page.pagevar=""
			obj_page.pagefirvar="index_1"&Cls.ChannelHtmlExtName
			obj_page.pageext=Cls.ChannelHtmlExtName
		Else
			if ListAction="search" then
				obj_page.pageurl = tmp_url
			elseif  ListAction<>"" and ListAction<>"List" then
				obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&Type="&sType&"&"
			else
				obj_page.pageurl="?Type="&sType&"&"
			end if
		End if
		'内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call Html.LoadReplaced()
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
		HtmlContent=Replace(HtmlContent,"{$Type}",sType)
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
		HtmlContent = Html.ReadBloger(HtmlContent)
		HtmlContent = Html.ReadBlogData(HtmlContent)
		HtmlContent = Html.ReadBlogPhoto(HtmlContent)
		HtmlContent = Html.ReadBlogTags(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
		Response.Write HtmlContent
		set obj_page=nothing 	
	End If
End Function

Public Function ShowChannelPhoto(ClsID,PgID,ListAction)
	Cls.ChannelTit="相片"
	Select Case ListAction
	Case "hot"
		tit="热门"&Cls.ChannelTit
		Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(2)
	Case "search"
		tit=Cls.ChannelTit&"搜索"
		tit_fir=Cls.ChannelName
		Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(2)
	Case Else
		tit=Cls.ChannelTit&"列表"
		tit_fir=Cls.ChannelName
		Tit_Dir = ""
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(2)
	End Select
	Dim ListContent,ListContents,HtmlUrl
	Dim Mhead,obj_search,obj_page
	Dim Tempstr, PageCt
	Dim SQL, i, foundstr, ListStyle
	Dim sDot,sTitle, sTopic, BestCode, BestString
	Dim ArticleTopic, ClassName, HtmlFileUrl,ImageURL, WriteTime, LinkTarget, HtmlFileName
	Dim tmp_sql,tmp_sql_order,tmp_url,tmp_keyword
	Mhead="":tmp_url=""
	Select Case ListAction
	Case "hot"
		mhead=tit
		tmp_sql="count>10 and type=2 "
		tmp_sql_order="count desc"
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=hot' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Case "search"
		tmp_sql=""
		set obj_search=New Cls_Search
		obj_search.inc_url="?action=Search&"
		obj_search.inc_sql=tmp_sql
		call obj_search.format_search("Topic","Topic,username",2,1,0)
		tmp_url=obj_search.inc_url
		tmp_sql=obj_search.inc_sql
		tmp_keyword=obj_search.keyword
		mhead=mhead&"（"&Cls.code_html(obj_search.keyword,1,0)&"）"
		set obj_search=nothing
	Case Else
	  if int(ClsID)>0 then tmp_sql="A.ClassID="&ClsID
	  mhead=tit
	  If Cls.RssTrue then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href="&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ClsID&" target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	End Select
	if tmp_sql="" then
		tmp_sql="hidden=1 and type=2"
	else
		tmp_sql="hidden=1 and "&tmp_sql
	End if
	if tmp_sql_order="" then
		tmp_sql_order="id desc"
	else
		tmp_sql_order=tmp_sql_order&",id desc"
	End if
	set obj_page=New Cls_PageCute
	obj_page.nummer=Cls.ChannelListNum
	obj_page.page_tit=Cls.ChannelTit
	obj_page.page_unit=Cls.ChannelUnit
	obj_page.v_id="id"
	if action="hot" then obj_page.v_id="count"
	'tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
	call obj_page.p_init("","[AsaiMHBlogData]",tmp_sql,"")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	If Instr(HtmlContent,"[ShowList]") > 0 Then
		ListContents=""
		ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
		'检查分页数据
		If PgID<>"" then obj_page.setpage=PgID
		Call obj_page.p_main("ID,Topic,count,username,pic,Tim","[AsaiMHBlogData]",tmp_sql,tmp_sql_order)
		'循还读数据
		i = 0
		If Rs.BOF And Rs.EOF Then
			ListContents = Cls.GetPic("<img src='"&Cls.Web_Dir&"Skin/no_pic.gif' border=0>")
		Else
			ListContents = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
			Do While Not Rs.EOF
			ListContents = ListContents & "<tr>" & vbCrLf
			For i = 1 To 4
				ListContents = ListContents & "<td align=""center"" class=""imagelist"">"
				If Not Rs.EOF Then
					sTitle = Cls.Cuted(Rs("topic"), CInt( Cls.ChannelCuteNum))
					'sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
					'-------------搜索关键字显亮 
					sTitle = Cls.Channel_Search(sTitle)
					If rs("Pic")="" then
						ImageUrl = Cls.Web_Dir&"Skin/no_pic.gif"
					else
						ImageUrl = rs("Pic")
					end if
					ImageUrl = "<img src='"&ImageUrl&"' width=120 height=90 class=""ig"">"
					HtmlFileUrl = Cls.Web_dir & "Blog/View/?" & Rs("ID")
					If Cls.ChannelIsNewWindow <> 0 Then
						LinkTarget = " target=""_blank"""
					Else
						LinkTarget = ""
					End If
					ListContents = ListContents & ListContent
					ListContents = Replace(ListContents, "{$Picture}", Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("topic") & "'" & LinkTarget & ">" & ImageUrl & "</a>"))
					ListContents = Replace(ListContents, "{$Topic}", "<a href='" & HtmlFileUrl & "' title='" & Rs("topic") & "'" & LinkTarget & ">" & sTitle & "</a>")
					Rs.MoveNext
				End If
				ListContents = ListContents & "</td>" & vbCrLf
			Next
			ListContents = ListContents & "</tr>" & vbCrLf
			Loop
			ListContents = ListContents & "</table>" & vbCrLf
		End If
		If Cls.ChannelIsCreatHtml = True And ListAction<>"search" then
			obj_page.pageurl="index_"
			obj_page.pagevar=""
			obj_page.pagefirvar="index_1"&Cls.ChannelHtmlExtName
			obj_page.pageext=Cls.ChannelHtmlExtName
		Else
			if ListAction="search" then
				obj_page.pageurl = tmp_url
			elseif  ListAction<>"" and ListAction<>"List" then
				obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
			else
				obj_page.pageurl=obj_page.pageurl&""
			end if
		End if
        	'内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call Html.LoadReplaced()
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
		HtmlContent = Html.ReadBloger(HtmlContent)
		HtmlContent = Html.ReadBlogData(HtmlContent)
		HtmlContent = Html.ReadBlogPhoto(HtmlContent)
		HtmlContent = Html.ReadBlogTags(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
		Response.Write HtmlContent
		set obj_page=nothing 	
		End If
End Function

Public Function ShowChannelTags(sType)
	If sType<>2 Then
		sType=1
		Cls.ChannelTit="日志"
	Else
		sType=2
		Cls.ChannelTit="相片"
	End If
	Tit=Cls.ChannelName:tit_fir=""
	Tit_Dir = "频道首页"
	HtmlContent = Cls.ReadTemplate(5)
	HtmlContent = Replace(HtmlContent,"{$Type}",sType)
	Call Html.LoadReplaced()
	Call LoadChannelSort(0,0)
	Call LoadChannelSearch()
	HtmlContent = Html.ReadWebHead(HtmlContent)
	HtmlContent = Html.ReadWebEnd(HtmlContent)
	HtmlContent = Html.ReadBloger(HtmlContent)
	HtmlContent = Html.ReadBlogData(HtmlContent)
	HtmlContent = Html.ReadBlogPhoto(HtmlContent)
	HtmlContent = Html.ReadBlogTags(HtmlContent)
	HtmlContent = Html.ReadUserLogin(HtmlContent)
	HtmlContent = Html.ReadFlashPic(HtmlContent)
	HtmlContent = Html.ReadCast(HtmlContent)
	HtmlContent = Html.ReadCast2(HtmlContent)
	HtmlContent = Html.ReadVote(HtmlContent)
	HtmlContent = Html.ReadChannelMenu(HtmlContent)
	HtmlContent = Cls.ReHtml(HtmlContent,0)
	Response.Write HtmlContent
End Function

Sub LoadChannelMainList(ListCid)
	Dim ListContent,ListContents
	Dim tmp1,ncid,ncname,mores
	Dim isdb,lablez,si,ji
	ListContents=""
	If Instr(HtmlContent,"[Repeat=1]") > 0 Then
		isdb = False
		lablez = "[Repeat=1]"
	ElseIf Instr(HtmlContent,"[Repeat=2]") > 0 Then
		isdb =True	   
		lablez = "[Repeat=2]"
	Else
		Call Html.LoadReplaced()
		Exit Sub
	End If
	ListContent = Cls.CutFixContent(HtmlContent, lablez , "[/Repeat]", 0)
	If ClassTrue Then
		ji=2
		
		for si=0 to ClassNum
		if int(ClassArr(2,si))=ListCid then
			ncid=Int(ClassArr(0,si))
			ncname=ClassArr(1,si)
			tmp1=""
			If Cls.ChannelIsCreatHtml = True then
				mores=Cls.Web_Dir & Cls.ChannelDir & "/"&ClassArr(8,si)&"index_1"&Cls.ChannelHtmlExtName
			Else
				mores="List.asp?c_id="&ncid
			End If
			If Cls.RssTrue Then ChannelRss="<link type='application/rss+xml' rel='alternate'><a href="&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ncid&" target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
			ListContents=ListContents&ListContent 
			ListContents=Replace(ListContents,"{$ClassID}",ncid)
			ListContents=Replace(ListContents,"{$ClassName}",ncname)
			ListContents=Replace(ListContents,"{$more}",mores)
			ListContents=Replace(ListContents,"{$Channel_Xml}",ChannelRss)
			
			
			
			ji=ji+1
		End If
		next
		
	Else
		ListContents="请先添加分类"
	End If
	HtmlContent=Replace(HtmlContent,lablez & ListContent&"[/Repeat]",ListContents)
	HtmlContent=Replace(HtmlContent,"{$ClassID}",ListCid)
	Call Html.LoadReplaced()
End Sub

'//* 频道搜索 *//
Public Function LoadChannelSearch()
	If Instr(HtmlContent,"{$Search}")>0 then
		HtmlContent=Replace(HtmlContent,"{$Search}",format_nsort_sea(ChannelSort,img_skin("search"),Class_Select_Type(Cls.ChannelTit,Cls.ClassDepth,0),Cls.ChannelTit))
	End If
End Function

'//* 频道导航 *//
Public Sub LoadChannelSort(tCid,tCtype)
	Dim TmpStr, TmpImg ,Tmpur1,tmpurl
	If Instr(HtmlContent,"{$SortList}")>0 then
		TmpStr=TmpStr&"<li><div class=slis>"&img_skin("sort_c1")&"<a href='List.asp?action=good'>推荐博客</a></div>"
		TmpStr=TmpStr&"<div class=slis>"&img_skin("sort_c1")&"<a href='List.asp?action=hot'>热门博客</a></div></li>"
		TmpStr=TmpStr&"<li><div class=slis>"&img_skin("sort_c1")&"<a href='List1.asp'>最新日志</a></div>"
		TmpStr=TmpStr&"<div class=slis>"&img_skin("sort_c1")&"<a href='List1.asp?action=hot'>热门日志</a></div></li>"
		TmpStr=TmpStr&"<li><div class=slis>"&img_skin("sort_c1")&"<a href='List2.asp'>最新相片</a></div>"
		TmpStr=TmpStr&"<div class=slis>"&img_skin("sort_c1")&"<a href='List2.asp?action=hot'>热门相片</a></div></li>"
		TmpStr=TmpStr&"<li><div class=slis>"&img_skin("sort_c1")&"<a href='Tags.asp'>日志标签</a></div>"
		TmpStr=TmpStr&"<div class=slis>"&img_skin("sort_c1")&"<a href='Tags.asp?type=2'>相片标签</a></div></li>"
		TmpStr=TmpStr&vbcrlf&LoadClass(tCid,tCtype,Cls.ChannelIsCreatHtml)
		HtmlContent=Replace(HtmlContent,"{$SortList}","<ul>"&VbCrlf&Tmpstr&VbCrlf&"</ul>")
	End If
End Sub

Function UserSkinList(v_sid,acturl)
	dim tmp_i,sql3,rs3,rs2,sql2,obj_page
	set obj_page=New Cls_PageCute
	obj_page.nummer=12
	obj_page.page_tit="模板"
	obj_page.page_unit="个"
	obj_page.v_id="id"
	obj_page.pageurl=acturl
	call obj_page.p_init("","[AsaiMHUserSkin] ","","")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	if int(obj_page.rssum)<1 then
		UserSkinList = "<table cellpadding='4' cellspacing='1' class=table><tr><td class=td>没有样式</td></tr><tr class=tr height=150><td align=center >没有样式</td></tr></table>"
		exit Function
	end if
	Call obj_page.p_main("*","[AsaiMHUserSkin]","","id desc")
	UserSkinList=vbcrlf&"<table cellpadding='4' cellspacing='1' class=table>"
	For i=1 to obj_page.page_num
	If rs.eof Then exit for
	If (i Mod 3) = 1 Then UserSkinList=UserSkinList&vbcrlf&"<tr class=tr>"
	UserSkinList=UserSkinList&vbcrlf&"<td align=center><a href='"&Cls.Web_Dir&"Blog/Skin.asp?action=show&id="&trim(rs("id"))&"' target='_blank' title='点击预览该用户模板'><img width=160 height=120 src='"&Cls.Web_Dir&"Blog/"&trim(rs("skinpic"))&"' border=0></a><br />"
	UserSkinList=UserSkinList&vbcrlf&"<input type=radio name=skin value="&trim(rs("id"))
	if v_sid=rs("id") then UserSkinList=UserSkinList&" checked"
	UserSkinList=UserSkinList&">样式-[<font color=red >"&trim(rs("userskinname"))&"</font>]</td>"
	If (i Mod 3) = 0 Then UserSkinList=UserSkinList&"</tr>"
	rs.movenext
	next
        if i < 12 and (i Mod 3) = 2 Then UserSkinList=UserSkinList&vbcrlf&"<td></td><td></td></tr>"
        if i < 12 and (i Mod 3) = 0 Then UserSkinList=UserSkinList&vbcrlf&"<td></td></tr>"
	UserSkinList=UserSkinList&vbcrlf&"<tr class=trp><td colspan=3><div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div></td></tr>"
	UserSkinList=UserSkinList&vbcrlf&"</table>"
	rs.close
	set rs=nothing
End Function

Public Function ShowUserIndex(oShowStr)
	Dim ContentHtml,uShowStr
	Dim obj_page,sCid,sPage,sPageURL,eYear,eMonth,eDay,Keyword,Sel
	Dim Sqls,id,c_id,topic,topic_head,btype,tags,tim,hits,renum,d_author,icon,weather,word
	uShowStr = Split(oShowStr&"///////","/")
	'uShowNum = Ubound(uShowStr)
	' URL = /?user/page/class/year/month/day/sel/keyword
	Call Blog_Load(uShowStr(0))
	sPage = Cls.ChkNumeric(uShowStr(1))
	sCid = Cls.ChkNumeric(uShowStr(2))
	eYear = Cls.ChkNumeric(uShowStr(3))
	eMonth = Cls.ChkNumeric(uShowStr(4))
	eDay = Cls.ChkNumeric(uShowStr(5))
	Sel = uShowStr(6)
	Keyword = uShowStr(7)
	If sPage=0 Then sPage=1
	'SQL筛选数据
	If eYear<>0 Then 
		Sqls=" And B.year="&eYear
		If eMonth<>0 Then 
			Sqls=Sqls&" And B.month="&eMonth
			If eDay<>0 Then 
				Sqls=Sqls&" And B.day="&eDay
			End If
		End If
	End If
	If sCid<>0  Then
		Sqls = Sqls & " And B.cid = "&sCid
	End If
	If Keyword<>"" And Sel<>"" Then
		If Sel = "1" Then
			Sqls = Sqls & " And B.Topic Like '%" & keyword & "%' "
		Else
			Sqls = Sqls & " And B.Author Like '%" & keyword & "%' "
		End If
	End If
	'列表开始
	ContentHtml=""
	set obj_page=New Cls_PageCute
	obj_page.nummer=b_listnum
	obj_page.page_tit="日志"
	obj_page.page_unit="篇"
	obj_page.v_id="B.ID"
	obj_page.pagevar=""
	obj_page.pageurl="?"&uShowStr(0)&"/"
	if uShowStr(2)<>"" then 
		obj_page.pageext="/"&uShowStr(2)
		if uShowStr(3)<>"" Then
			obj_page.pageext=obj_page.pageext&"/"&uShowStr(3)
			if uShowStr(4)<>"" Then
				obj_page.pageext=obj_page.pageext&"/"&uShowStr(4)
				if uShowStr(5)<>"" Then
					obj_page.pageext=obj_page.pageext&"/"&uShowStr(5)
						if uShowStr(7)<>"" then
							obj_page.pageext=obj_page.pageext&"/"&uShowStr(6)&"/"&uShowStr(7)
						end if
				end if	
			end if
		end if
	end if 
	obj_page.setpage=sPage
	call obj_page.p_init("","[AsaiMHBlogData] B Left JOIn [AsaiMHBlogSort] S ON B.CID=S.ID","B.Type = 1 And B.Hidden =1 And B.Username='"&b_user&"'" & Sqls,"")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	if int(obj_page.rssum)<1 then
		ContentHtml = "<div id=mod_bloglist class=mod rel=drag><table width=100% border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>日志列表</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id=m_blog class=modbox style=overflow-x:hidden><br /><br />没有日志哦！<br /><br />"
	else
		ContentHtml="<div id=mod_bloglist class=mod rel=drag><table width=100% border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>日志列表</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id=m_blog class=modbox style=overflow-x:hidden>"
		Call obj_page.p_main("B.ID,B.cid,B.type,B.tags,B.topic,B.word,B.tim,B.icon,B.weather,B.count,B.Reply,B.author,B.username,S.sort","[AsaiMHBlogData] B Left JOIn [AsaiMHBlogSort] S ON B.CID=S.ID","B.Type = 1 And B.Hidden =1 And B.Username='"&b_user&"'" & Sqls,"B.ID Desc")
		For i=1 to obj_page.page_num
		If rs.eof Then exit for
		id=rs("id")
		c_id=rs("cid")
		topic=rs("topic")
		btype=rs("type")
		word=rs("word")
		tim=rs("tim")
		icon=rs("icon")
		weather=rs("weather")
		hits=rs("count")
		renum=rs("reply")
		tags=rs("tags")
		if rs("author")<>"" then
			d_author=rs("author")
		else
			d_author=rs("username")
		end if
		if c_id<>0 then
			topic_head="日志分类：<a href='?"&b_user&"/0/"&c_id&"'>"&rs("sort")&"</a>"
		else
			topic_head=""
		end if
		ContentHtml=ContentHtml&"<div class=tit><a href='View/?"&id&"'>"&Cls.Code_Html(topic,1,b_maincut)&"</a></div>"
		ContentHtml=ContentHtml&"<div class='date'>"&topic_head&" 发布人："&format_user_name(d_author,0,"")&" | "&tim&" | 星期"&weeks(datepart("w",tim))&"&nbsp;&nbsp;<IMG src='images/weather/"&weather&".gif' align=absMiddle></div>"
		if b_listtype=0 then
			ContentHtml=ContentHtml&"<table style='table-layout:fixed'><tr><td><div class='cnt' >"&left(PrintTrueText(word),b_shownum)&"......</div></td></tr></table>"
			ContentHtml=ContentHtml&"<div class=more><a href='View/?"&id&"'>阅读全文&gt;&gt;</A></div> "
			If tags="" then
				ContentHtml=ContentHtml&"<div class='opt'>浏览("&hits&") | 回复("&renum&")</div>"
			Else
				ContentHtml=ContentHtml&"<div class='opt'>标签：<font class=Gys>"&Blog_UserTags(tags,btype)&"</font> | 浏览("&hits&") | 回复("&renum&")</div>"
			End If
		else
			If tags="" then
				ContentHtml=ContentHtml&"<div class='opt'>浏览("&hits+1&") | 回复(0)</div>"
			Else
				ContentHtml=ContentHtml&"<div class='opt'>标签：<font class=Gys>"&Blog_UserTags(tags,btype)&"</font> | 浏览("&hits+1&") | 回复(0)</div>"
			End If
		end if
		ContentHtml=ContentHtml&"<div class='line'>&nbsp;</div>"
		rs.movenext
		next
		Rs.close
	end if
	ContentHtml=ContentHtml&"<div id=page> "&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div></div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
	Dim TmpSkin:TmpSkin=b_skinmain
	If InStr(TmpSkin,"$show_calendar$")>0 Then TmpSkin = Replace(TmpSkin,"$show_calendar$",Calendar(eYear,eMonth,eDay))
	If InStr(TmpSkin,"$show_subject_l$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject_l$",Main_Sort(1))
	If InStr(TmpSkin,"$show_subject$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject$",Left_Sort(1))
	If InStr(TmpSkin,"$show_comment$")>0 Then TmpSkin = Replace(TmpSkin,"$show_comment$",Left_Pl(1))
	If InStr(TmpSkin,"$show_newblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newblog$",Left_New(1))
	If InStr(TmpSkin,"$show_hotblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotblog$",Left_Hot(1))
	If InStr(TmpSkin,"$show_newphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newphoto$",Left_New(2))
	If InStr(TmpSkin,"$show_hotphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotphoto$",Left_Hot(2))
	If InStr(TmpSkin,"$show_newmessage$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newmessage$",Left_Msg())
	If InStr(TmpSkin,"$show_login$")>0 Then TmpSkin = Replace(TmpSkin,"$show_login$",User_Login())
	If InStr(TmpSkin,"$show_links$")>0 Then TmpSkin = Replace(TmpSkin,"$show_links$",Left_Links())
	If InStr(TmpSkin,"$show_search$")>0 Then TmpSkin = Replace(TmpSkin,"$show_search$",Blog_Search(1,""))
	If InStr(TmpSkin,"$show_info$")>0 Then TmpSkin = Replace(TmpSkin,"$show_info$",Show_Info())
	TmpSkin = Replace(TmpSkin,"$show_blogname$",b_name)
	TmpSkin = Replace(TmpSkin,"$show_placard$",B_content)
	TmpSkin = Replace(TmpSkin,"$show_blogurl$",GetUrl)
	TmpSkin = Replace(TmpSkin,"$show_blogurls$",GetUrls)
	TmpSkin = Replace(TmpSkin,"$show_myfriend$",Blog_Friend(b_listFriend,d_author))
	TmpSkin = Replace(TmpSkin,"$show_photo$",Blog_Photo(b_listphoto,d_author))
	TmpSkin = Replace(TmpSkin,"$show_userface$",Blog_UserFace(b_user))
	TmpSkin = Replace(TmpSkin,"$show_log$",ContentHtml)
	TmpSkin = Replace(TmpSkin,"$show_xml$","")
	TmpSkin = Cls.ReHtml(TmpSkin,0)
	If Int(Web_Dim(15)) = 0 Then
		Call PutOut(TmpSkin,Cls.Web_Name&"博客 - "&b_name&" - 日志列表",b_user,"日志",b_content,"")
	Else
		Call PutOut(TmpSkin,b_name&" - 日志列表 - "&Cls.Web_Name&"博客",b_user,"日志",b_content,"")
	End if
End Function 

Public Function ShowUserPhoto(oShowStr)
	Dim ContentHtml,uShowStr
	Dim obj_page,sCid,sPage,sPageURL
	Dim Sqls,id,topic,pic,tim,d_author,word
	uShowStr = Split(oShowStr&"//","/")
	'uShowNum = Ubound(uShowStr)
	'URL = /?user/page/class/
	Call Blog_Load(uShowStr(0))
	sPage = Cls.ChkNumeric(uShowStr(1))
	sCid = Cls.ChkNumeric(uShowStr(2))
	If sPage=0 Then sPage=1
	If sCid<>0  Then
		Sqls = Sqls & " And cid = "&sCid
	End If
	'列表开始
	ContentHtml=""
	set obj_page=New Cls_PageCute
	obj_page.nummer=b_photonum
	obj_page.page_tit="相片"
	obj_page.page_unit="张"
	obj_page.v_id="ID"
	obj_page.pagevar=""
	obj_page.pageurl="?"&uShowStr(0)&"/"
	if uShowStr(2)<>"" then 
		obj_page.pageext="/"&uShowStr(2)
	end if 
	obj_page.setpage=sPage
	call obj_page.p_init("","[AsaiMHBlogData] ","Type = 2 And Hidden =1 And Username='"&b_user&"'" & Sqls,"")
	sql=obj_page.sql_count
	set rs=Cls.exec(sql,1)
	obj_page.rssum=rs(0)
	rs.close
	if int(obj_page.rssum)<1 then
		ContentHtml = "<div id=mod_bloglist class=mod rel=drag><table width=100% border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>日志列表</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id=m_blog class=modbox style=overflow-x:hidden><br /><br /><img src="&Cls.Web_Dir&"Skin/no_pic.gif><br /><br />"
	else
		ContentHtml=ContentHtml&"<div id=mod_bloglist class=mod rel=drag><table width='100%' border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>图片列表</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id=m_blog class=modbox style=overflow-x:hidden>"
		ContentHtml=ContentHtml&"<table width='100%' border=0 cellspacing=0 cellpadding=0> "
		Call obj_page.p_main("*","[AsaiMHBlogData]","Type = 2 And Hidden =1 And Username='"&b_user&"'" & Sqls,"ID Desc")
		Do While Not Rs.EOF
		ContentHtml=ContentHtml&"<tr>"
		For i=1 to b_photohnum
		ContentHtml=ContentHtml&"<td>"
		If not rs.eof then
			id=rs("id")
			topic=rs("topic")
			pic=rs("pic")
			'word=rs("word")
			tim=rs("tim")
			if rs("author")<>"" then
				d_author=rs("author")
			else
				d_author=rs("username")
			end if
			ContentHtml=ContentHtml&"<table border=0 cellspacing=0 cellpadding=2><tr><td align=center>"&Cls.GetPic("<a href='../View/?"&id&"'><img src='"&pic&"' width=110 height=90 border=0></a>")&"</td></tr><tr><td align=center><a href='../View/?"&id&"' title='"&Cls.Code_Html(topic,1,0)&"'>"&Cls.Code_Html(topic,1,18)&"</a></td></tr></table>"
			rs.movenext
		end if
		ContentHtml=ContentHtml&"</td>"
		next
		ContentHtml=ContentHtml&"</tr>"
		Loop
		Rs.close
		ContentHtml=ContentHtml&"</table>"&ukong 
	end if 
	ContentHtml=ContentHtml&"<div id=page> "&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div></div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
	Dim TmpSkin:TmpSkin=b_skinmain
	TmpSkin = Replace(TmpSkin, "skin/","../skin/")
	If InStr(TmpSkin,"$show_calendar$")>0 Then TmpSkin = Replace(TmpSkin,"$show_calendar$",Calendar(0,0,0))
	If InStr(TmpSkin,"$show_subject_l$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject_l$",Main_Sort(2))
	If InStr(TmpSkin,"$show_subject$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject$",Left_Sort(2))
	If InStr(TmpSkin,"$show_comment$")>0 Then TmpSkin = Replace(TmpSkin,"$show_comment$",Left_Pl(2))
	If InStr(TmpSkin,"$show_newblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newblog$",Left_New(1))
	If InStr(TmpSkin,"$show_hotblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotblog$",Left_Hot(1))
	If InStr(TmpSkin,"$show_newphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newphoto$",Left_New(2))
	If InStr(TmpSkin,"$show_hotphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotphoto$",Left_Hot(2))
	If InStr(TmpSkin,"$show_newmessage$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newmessage$",Left_Msg())
	If InStr(TmpSkin,"$show_login$")>0 Then TmpSkin = Replace(TmpSkin,"$show_login$",User_Login())
	If InStr(TmpSkin,"$show_links$")>0 Then TmpSkin = Replace(TmpSkin,"$show_links$",Left_Links())
	If InStr(TmpSkin,"$show_search$")>0 Then TmpSkin = Replace(TmpSkin,"$show_search$",Blog_Search(1,""))
	If InStr(TmpSkin,"$show_info$")>0 Then TmpSkin = Replace(TmpSkin,"$show_info$",Show_Info())
	TmpSkin = Replace(TmpSkin,"$show_blogname$",b_name)
	TmpSkin = Replace(TmpSkin,"$show_placard$",B_content)
	TmpSkin = Replace(TmpSkin,"$show_blogurl$",GetUrl)
	TmpSkin = Replace(TmpSkin,"$show_blogurl$",GetUrls)
	TmpSkin = Replace(TmpSkin,"$show_myfriend$",Blog_Friend(b_listFriend,b_user))
	TmpSkin = Replace(TmpSkin,"$show_photo$",Blog_Photo(b_listphoto,b_user))
	TmpSkin = Replace(TmpSkin,"$show_userface$",Blog_UserFace(b_user))
	TmpSkin = Replace(TmpSkin,"$show_log$",ContentHtml)
	TmpSkin = Replace(TmpSkin,"$show_xml$","")
	TmpSkin = Cls.ReHtml(TmpSkin,0)
	If Int(Web_Dim(15)) = 0 Then
		Call PutOut(TmpSkin,Cls.Web_Name&"博客 - "&b_name&" - 相册列表",b_user,"相片",b_content,"")
	Else
		Call PutOut(TmpSkin,b_name&" - 相册列表 - "&Cls.Web_Name&"博客",b_user,"相片",b_content,"")
	End if
End Function 

Public Function ShowUserContent(ByVal sID)
	Dim ContentHtml,eYear,eMonth,eDay,A_tags,B_tags,C_tags,BlogHost
	Dim id,c_id,sortname,topic_head,busr,btype,tags,pic,topic,tim,d_author,icon,weather,word,hits,renum
	'Sql="Select Top 1 B.ID,B.cid,B.type,B.tags,B.topic,B.word,B.tim,B.icon,B.weather,B.pic,B.count,B.author,B.username,B.year,B.Month,B.day,B.Reply,B.hidden,S.sort From [AsaiMHBlogData] B Left JOIn [AsaiMHBlogSort] S ON B.CID=S.ID Where B.ID="&sID&""
	Sql="Select Top 1 B.ID,B.cid,B.type,B.tags,B.topic,B.word,B.tim,B.icon,B.weather,B.pic,B.count,B.author,B.username,B.year,B.Month,B.day,B.Reply,B.hidden,S.sort From [AsaiMHBlogData] B Left JOIn [AsaiMHBlogSort] S ON B.CID=S.ID Where B.ID="&sID&" And B.Hidden =1"
	Set rs=Cls.Exec(Sql,1)
	If rs.eof Then 
		rs.Close 
		Response.Write "<div id=m_blog class=modbox style=overflow-x:hidden><br /><br /><br /><center>对不起，你要查看的内容不存在！<br /><br /><a href="&Cls.Web_Dir&"Blog/>返回博客首页</a></center></div>" 
		Response.End 
	Elseif login_username<>rs("username") and rs("hidden")=false then 
		rs.Close 
		Response.Write "<div id=m_blog class=modbox style=overflow-x:hidden><br /><br /><br /><center>对不起，你要查看的内容没有公开！<br /><br /><a href="&Cls.Web_Dir&"Blog/>返回博客首页</a></center></div>" 
		Response.End 
	Else
		id=rs("id")
		c_id=rs("cid")
		topic=rs("topic")
		btype=rs("type")
		tags=rs("tags")
		busr=rs("username")
		word=Ubb.Ubbcode(Replace(rs("word"),"abc","abc"))
		tim=rs("tim")
		hits=rs("count")
		renum=rs("reply")
		sortname=rs("sort")
		weather=rs("weather")
		A_tags=split(tags," ")
		For i=0 to ubound(A_tags)
		B_tags=right(A_tags(i),len(A_tags(i))-instr(A_tags(i)," "))
		If btype="1" then
			C_tags=C_tags&"<A href='"&Cls.Web_Dir&"Blog/List1.asp?Action=search&sea_type=tags&keyword="&B_tags&"' target=_blank>"&B_tags&"</A> "
		Else
			C_tags=C_tags&"<A href='"&Cls.Web_Dir&"Blog/List2.asp?Action=search&sea_type=tags&keyword="&B_tags&"' target=_blank>"&B_tags&"</A> "
		End If
		next
		erase A_tags
		If rs("author")<>"" then
			d_author=rs("author")
		Else
			d_author=rs("username")
		End If
		if is_logintrue and login_username=rs("username") then
			If btype="1" then
				BlogHost=BlogHost&"<A href='"&Cls.Web_Dir&"Blog/User.asp?action=edit1&id="&sID&"'><img src="&Cls.Web_Dir&"Blog/Images/Main/icon_edit.gif border=0 align=absmiddle></A>&nbsp;<A href='#'><img src="&Cls.Web_Dir&"Blog/Images/Main/icon_del.gif border=0 align=absmiddle target=_blank></A>&nbsp;"
			Else
				BlogHost=BlogHost&"<A href='"&Cls.Web_Dir&"Blog/User.asp?action=edit2&id="&sID&"'><img src="&Cls.Web_Dir&"Blog/Images/Main/icon_edit.gif border=0 align=absmiddle></A>&nbsp;<A href='#'><img src="&Cls.Web_Dir&"Blog/Images/Main/icon_del.gif border=0 align=absmiddle target=_blank></A>&nbsp;"
			End If
		Else
			BlogHost=BlogHost&""
		End If
		ContentHtml=ContentHtml&"<div id=mod_bloglist class=mod rel=drag><table width='100%' border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>查看内容</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id=m_blog class=modbox style=overflow-x:hidden>"
		If btype=1 Then
			icon=rs("icon")
			eYear=rs("Year")
			eMonth=rs("Month")
			eDay=rs("Day")
			rs.close
			Call Blog_Load(busr)
			if c_id<>0 then
				topic_head="日志分类：<a href='../?"&b_user&"/0/"&c_id&"'>"&sortname&"</a>"
			else
				topic_head=""
			end if
			ContentHtml=ContentHtml&"<div class=tit>"&Cls.Code_Html(topic,1,0)&"</div>"
			ContentHtml=ContentHtml&"<div class='date'>"&topic_head&" 发布人："&format_user_name(d_author,0,"")&" | "&tim&" | 星期"&weeks(datepart("w",tim))&"&nbsp;&nbsp;<IMG src='"&cls.web_dir&"Blog/Images/weather/"&weather&".gif' align=absMiddle> &nbsp;"&BlogHost&"</div>"
			ContentHtml=ContentHtml&"<table style='table-layout:fixed;width:100%'><tr><td><div id=blog_text class=cnt  >"&word&"</div></td></tr></table><br>"
			If tags="" then
				ContentHtml=ContentHtml&"<div class=opt>浏览("&hits+1&") | 回复("&renum&")</div>"
			Else
				ContentHtml=ContentHtml&"<div class=opt>标签：<font class=Gys>"&C_tags&"</font> | 浏览("&hits+1&") | 回复("&renum&")</div>"
			End If
		Else
			pic=rs("pic")
			rs.close
			Call Blog_Load(busr)
			if c_id<>0 then
				topic_head="图片分类：<a href='../Photo/?"&b_user&"/0/"&c_id&"'>"&sortname&"</a>"
			else
				topic_head=""
			end if
			ContentHtml=ContentHtml&"<div class=tit>"&Cls.Code_Html(topic,1,0)&"</div>"
			ContentHtml=ContentHtml&"<div class='date'>"&topic_head&" 发布人："&format_user_name(d_author,0,"")&" | "&tim&" | 星期"&weeks(datepart("w",tim))&" &nbsp;"&BlogHost&"</div>"
			ContentHtml=ContentHtml&"<p align=center><a href='"&pic&"' target='_blank' rel=""lightbox""><img src='"&pic&"' border=0 onmousewheel=""return bbimg(this)"" onload=""return imgzoom(this,550);"" align=center alt='点击浏览此图片'></a><p>"
			'ContentHtml=ContentHtml&"<br /><br /><Div><img src='"&pic&"' border=0 onmousewheel=""return bbimg(this)"" onload=""return imgzoom(this,550);"" onclick=""zoom(this,'"&pic&"','/images/viewpic')"" style=""cursor: pointer;""></Div>"
			'ContentHtml=ContentHtml&"<br /><br /><Div><a href='"&pic&"' target='_blank'><img src='"&pic&"' border=0 onmousewheel=""return bbimg(this)"" onload=""javascript:if(this.width>450)this.width=450;"" align=center alt='在新窗口中浏览此图片'></a></Div>"
			ContentHtml=ContentHtml&"<table style='table-layout:fixed;width:100%'><tr><td><div id=blog_text class=cnt  >"&word&"</div></td></tr></table><br>"
			If tags="" then
				ContentHtml=ContentHtml&"<div class=opt>浏览("&hits+1&") | 回复("&renum&")</div>"
			Else
				ContentHtml=ContentHtml&"<div class=opt>标签：<font class=Gys>"&C_tags&"</font> | 浏览("&hits+1&") | 回复("&renum&")</div>"
			End If
		End If
		'上下篇
		ContentHtml=ContentHtml&"<br /><div id=in_nav>"&LoadViewAbout(id,btype,d_author,"Up")&"&nbsp;&nbsp;&nbsp;&nbsp;"&LoadViewAbout(id,btype,d_author,"Down")&"</div>"
		'更新浏览量
		Call Cls.Exec("Update AsaiMHBlogData Set Count=Count+1 Where ID="&ID,0)
		'载入评论
		ContentHtml=ContentHtml&"<br />"&review_type(ChannelIDs,id,Cls.Web_Dir&Cls.ChannelDir&"/View/?"&id,0,b_user,"")&"</div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
	End If
	Dim TmpSkin:TmpSkin=b_skinmain
	TmpSkin = Replace(TmpSkin, "skin/","../skin/")
	If InStr(TmpSkin,"$show_calendar$")>0 Then TmpSkin = Replace(TmpSkin,"$show_calendar$",Calendar(eYear,eMonth,eDay))
	If InStr(TmpSkin,"$show_subject_l$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject_l$",Main_Sort(btype))
	If InStr(TmpSkin,"$show_subject$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject$",Left_Sort(btype))
	If InStr(TmpSkin,"$show_comment$")>0 Then TmpSkin = Replace(TmpSkin,"$show_comment$",Left_Pl(btype))
	If InStr(TmpSkin,"$show_newblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newblog$",Left_New(1))
	If InStr(TmpSkin,"$show_hotblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotblog$",Left_Hot(1))
	If InStr(TmpSkin,"$show_newphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newphoto$",Left_New(2))
	If InStr(TmpSkin,"$show_hotphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotphoto$",Left_Hot(2))
	If InStr(TmpSkin,"$show_newmessage$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newmessage$",Left_Msg())
	If InStr(TmpSkin,"$show_login$")>0 Then TmpSkin = Replace(TmpSkin,"$show_login$",User_Login())
	If InStr(TmpSkin,"$show_links$")>0 Then TmpSkin = Replace(TmpSkin,"$show_links$",Left_Links())
	If InStr(TmpSkin,"$show_search$")>0 Then TmpSkin = Replace(TmpSkin,"$show_search$",Blog_Search(1,""))
	If InStr(TmpSkin,"$show_info$")>0 Then TmpSkin = Replace(TmpSkin,"$show_info$",Show_Info())
	TmpSkin = Replace(TmpSkin,"$show_blogname$",b_name)
	TmpSkin = Replace(TmpSkin,"$show_placard$",B_content)
	TmpSkin = Replace(TmpSkin,"$show_blogurl$",GetUrl)
	TmpSkin = Replace(TmpSkin,"$show_blogurls$",GetUrls)
	TmpSkin = Replace(TmpSkin,"$show_myfriend$",Blog_Friend(b_listFriend,d_author))
	TmpSkin = Replace(TmpSkin,"$show_photo$",Blog_Photo(b_listphoto,d_author))
	TmpSkin = Replace(TmpSkin,"$show_userface$",Blog_UserFace(b_user))
	TmpSkin = Replace(TmpSkin,"$show_log$",ContentHtml)
	TmpSkin = Replace(TmpSkin,"$show_xml$","")
	TmpSkin = Cls.ReHtml(TmpSkin,0)
	If Int(Web_Dim(15)) = 0 Then
		If tags="" then
			Call PutOut(TmpSkin,Cls.Web_Name&"博客 - "&b_name&" - "&topic&"",d_author,tags,b_content,"")
		Else
			Call PutOut(TmpSkin,Cls.Web_Name&"博客 - "&b_name&" - "&topic&"(标签："&tags&")",d_author,tags,b_content,tags)
		End If
	Else
		If tags="" then
			Call PutOut(TmpSkin,topic&" - "&b_name&" - "&Cls.Web_Name&"博客",d_author,tags,b_content,"")
		Else
			Call PutOut(TmpSkin,topic&"(标签："&tags&") - "&b_name&" - "&Cls.Web_Name&"博客",d_author,tags,b_content,tags)
		End If
	End if
End Function 

'//* 浏览相关 *//
Public Function LoadViewAbout(b_vid,b_vtype,d_author,va_t)
	dim tmp1,tmp2,tmp_sql,va_tit,va_where
	if b_vtype = 1 then
		va_tit = "篇日志"
		va_where = "and type=1"
	else
		va_tit = "张相片"
		va_where = "and type=2"
	end if
	tmp2="上一"&va_tit&"：&nbsp;"
	tmp1=tmp2&"没有找到上"&va_Tit&""
	tmp_sql="Select top 1 id,topic from AsaiMHBlogData where username='"&d_author&"' and hidden=1 "&va_where&" and id<"&b_vid&" order by id desc"
	if va_t="Down" then
	tmp2="下一"&va_tit&"：&nbsp;"
	tmp1=tmp2&"没有找到下"&va_Tit&""
	tmp_sql="Select top 1 id,topic from AsaiMHBlogData "&Cls.ChannelTable&" where username='"&d_author&"' and hidden=1 "&va_where&" and id>"&b_vid&" order by id"
	End if
	set rs=Cls.exec(tmp_sql,1)
	if not rs.eof then
		tmp1=tmp2&"<a href='"&Cls.Web_Dir&"Blog/View/?"&rs(0)&"' title='"&Cls.code_html(rs(1),1,0)&"'>"&Cls.code_html(rs(1),1,0)&"</a>"
	End if
	rs.close
	LoadViewAbout=tmp1
End Function

Public Function ShowUserGBook(oShowStr)
	Dim ContentHtml,uShowStr,Found_Err
	Dim obj_page,sPage,sPageURL
	Dim Sqls,id,luser,topic,pic,tim,word,reply,retim,isreply,email,homepage
	uShowStr = Split(oShowStr&"/","/")
	'uShowNum = Ubound(uShowStr)
	'URL = /?user/page/class/
	Call Blog_Load(uShowStr(0))
	sPage = Cls.ChkNumeric(uShowStr(1))
	If sPage=0 Then sPage=1
  	if cls.chk() then
    		Dim druser,drword,drtopic,drmail,drhome
		druser=trim(request.form("user"))
		drtopic=trim(request.form("topic"))
		drword=trim(request.form("word"))
		drmail=trim(request.form("email"))
		drhome=trim(request.form("home"))
		found_err=""
		if druser="" or isnull(druser) then
			found_err=found_err & "+请正确输入 <font color=red>您的名称</font>（长度1-20）<br />"
		end if    
		if drtopic="" or isnull(drtopic) then
			found_err=found_err & "+请正确输入 <font color=red>留言标题</font>（长度1-20）<br />"
		end if
		if drmail<>"" and drmail<>"@" then
			if not cls.is_email(drmail,30) then found_err=found_err & "+请正确输入 <font color=red>电子邮箱地址</font><br />"
		else
			drmail=""
		end if
		if drhome<>""and drhome<>"http://" then
			if instr(drhome,".")=0 or instr(drhome,"http://")=0 then found_err=found_err & "+请正确输入 <font color=red>个人主页地址</font><br />"
		else
			drhome=""
		end if
		if drword="" or isnull(drword) then
			found_err=found_err & "+留言的 <font color=red>内容</font> 是必需要的！请输入。<br />"
		end if
		if len(drword)>1000 then
			found_err=found_err & "+留言的 <font color=red>内容</font> 不能大于250字。<br />"
		end if
		if found_err<>"" then
			ContentHtml=ContentHtml&"<table cellspacing=1 cellpadding=4 class=table align='center'><tr class=tr><td align=center height=150 colspan=3>"&found_error(found_err,460)&"</td></tr></table>"
		else
			sql="select * from AsaiMHBlogBook"
			call cls.exec("",-1)
			rs.open sql,conn,1,3
			rs.addnew
			rs("buser")=b_user
			rs("luser")=druser
			rs("topic")=drtopic
			rs("email")=drmail
			rs("home")=drhome
			rs("word")=drword
			rs("reply")=""
			rs("secret")=0
			rs("hidden")=1
			rs("tim")=now()
			if Is_LoginTrue and druser=login_username then
				rs("isuser")=1
			else
				rs("isuser")=0
				rs("isreply")=false
			end if
			rs.update
			rs.close
			ContentHtml=ContentHtml&"<div id=mod_bloglist class=mod rel=drag><table width='100%' border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>留言反馈</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id='m_blog' class='modbox' style='overflow-x:hidden;'><table cellspacing=1 cellpadding=4 class=table align='center'>"
			ContentHtml=ContentHtml&"<tr><td align=center><b>成功留言</b></td></tr>"
			ContentHtml=ContentHtml&"<tr class=tr><td align=center height=150 colspan=2>"
			ContentHtml=ContentHtml&"<font color=red>恭喜！您已成功在此博客留言!</font><br /><br />"
			ContentHtml=ContentHtml&"<a href='?"&b_user&"'>返回留言页面</a><br /><br />"
			ContentHtml=ContentHtml&"（系统将在 <font color=red>"&Format_Mid_Num(25)&"</font> 秒钟后自动返回）<meta http-equiv='refresh' content='"&Format_Mid_Num(25)&"; url=?"&b_user&"'>"
			ContentHtml=ContentHtml&"</td></tr></table></div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
		end if
	else
		'留言列表开始
		ContentHtml=""
		set obj_page=New Cls_PageCute
		obj_page.nummer=b_listnum
		obj_page.page_tit="留言"
		obj_page.page_unit="条"
		obj_page.v_id="ID"
		obj_page.pagevar=""
		obj_page.pageurl="?"&uShowStr(0)&"/"
		obj_page.setpage=sPage
		call obj_page.p_init("","[AsaiMHBlogBook] ","Hidden =1 And buser='"&b_user&"'","")
		sql=obj_page.sql_count
		set rs=Cls.exec(sql,1)
		obj_page.rssum=rs(0)
		rs.close
		if int(obj_page.rssum)<1 then
			ContentHtml=ContentHtml&"<div id=mod_bloglist class=mod rel=drag><table width='100%' border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>留言反馈</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id='m_blog' class='modbox' style='overflow-x:hidden;'><br /><br />暂时还没有留言!<br /><br /></div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
		else
			ContentHtml=ContentHtml&"<div id=mod_bloglist class=mod rel=drag><table width='100%' border=0 cellspacing=0 cellpadding=0 class=modth><tr><td class=modtl width=7>&nbsp;</td><td class=modtc nowrap><div class=modhead><span class=modtit>留言反馈</span></div></td><td class=modtc nowrap align=right><div class=modopt></div></td><td class=modtr width=7>&nbsp;</td></tr></table><div id='m_blog' class='modbox' style='overflow-x:hidden;'>"
		end if
		Call obj_page.p_main("*","[AsaiMHBlogBook]","Hidden =1 And buser='"&b_user&"'","ID Desc")
		Do While Not Rs.EOF
			id=rs("id")
			luser=rs("luser")
			topic=rs("topic")
			word=rs("word")
			email=rs("email")
			homepage=rs("home")
			tim=rs("tim")
			reply=rs("reply")
			retim=rs("retim")
			isreply=rs("isreply")
			if email<>"" then email=" <a href='mailto:"&email&"' title='点击这里给我发邮件'>邮件</a> "
			if homepage<>"" then homepage=" <a href='"&homepage&"' target='_blank' title='点击这里访问我的个人主页'>主页</a> "
			ContentHtml=ContentHtml&"<div class=tit>"&Cls.Code_Html(topic,1,b_maincut)&"</div><div class=opt>"&email&" | "&homepage&"<span class=date>"&luser&" 留言于 "&tim&"</span></div><table style=table-layout:fixed><tr><td><div class=cnt>"&Cls.Code_Html(word,2,0)&"</div></td></tr></table>"
			if isreply=true then
				ContentHtml=ContentHtml&"<br><br><font color=red>站长["&b_user&"]回复于"&retim&"</font><br />"&Cls.Code_Html(reply,2,0)&""
			end if
			ContentHtml=ContentHtml&"<div class=line>&nbsp;</div>"
			rs.movenext
		Loop
		Rs.close
		ContentHtml=ContentHtml&"<div id='page'> "&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		ContentHtml=ContentHtml&"<div id='m_comment_post'>"
		ContentHtml=ContentHtml&"<table width=100% border=0 cellspacing=5 cellpadding=0>"
		ContentHtml=ContentHtml&"<form name=write_frm action='./?"&b_user&"' method=post  onsubmit='frm_submitonce(this);'>"
		ContentHtml=ContentHtml&"<input type=hidden name=chk value='yes'>"
		ContentHtml=ContentHtml&"<tr><td colspan=2><IMG  src='"&cls.web_dir&"Blog/Images/main/topic.gif' border=0 align=absMiddle> <font style=""font-size:12px""><b>欢迎你留言</b></font></td></tr>"	
		ContentHtml=ContentHtml&"<tr><td class=f14 width=88>您的姓名：</td><td><input type=text class=txt name=user value='"&login_username&"' size=25 maxlength=20></td></tr>"
		ContentHtml=ContentHtml&"<tr><td class=f14>电子邮件：</td><td><input type=text class=txt name=email value='"&login_email&"' size=25 maxlength=30></td></tr>"
		ContentHtml=ContentHtml&"<tr><td class=f14>个人主页：</td><td><input type=text class=txt name=home value='http://' size=25 maxlength=50></td></tr>"
		ContentHtml=ContentHtml&"<tr><td class=f14>留言标题：</td><td><input type=text class=txt name=topic value='' size=40 maxlength=30></td></tr>"
		ContentHtml=ContentHtml&"<tr valign=top><td class=f14>留言内容：<br />1000字内</td><td><textarea rows=8 cols=55 name=word></textarea></td></tr>"
		ContentHtml=ContentHtml&"<tr class=trb>"
		ContentHtml=ContentHtml&"<td align=center colspan=2><input type=submit class=btn name=wsubmit value=' 确 认 '>　　<input type=reset class=btn value=' 重 置 '></td>"
		ContentHtml=ContentHtml&"</tr>"
		ContentHtml=ContentHtml&"</form>"
		ContentHtml=ContentHtml&"</table></div></div><table width='100%' border=0 cellspacing=0 cellpadding=0 height=8><tr><td class=modbl width=7>&nbsp;</td><td class=modbc>&nbsp;</td><td class=modbr width=7>&nbsp;</td></tr></table></div>"
	end if
	Dim TmpSkin:TmpSkin=b_skinmain
	TmpSkin = Replace(TmpSkin, "skin/","../skin/")
	If InStr(TmpSkin,"$show_calendar$")>0 Then TmpSkin = Replace(TmpSkin,"$show_calendar$",Calendar(0,0,0))
	If InStr(TmpSkin,"$show_subject_l$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject_l$",Main_Sort(1))
	If InStr(TmpSkin,"$show_subject$")>0 Then TmpSkin = Replace(TmpSkin,"$show_subject$",Left_Sort(1))
	If InStr(TmpSkin,"$show_comment$")>0 Then TmpSkin = Replace(TmpSkin,"$show_comment$",Left_Pl(1))
	If InStr(TmpSkin,"$show_newblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newblog$",Left_New(1))
	If InStr(TmpSkin,"$show_hotblog$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotblog$",Left_Hot(1))
	If InStr(TmpSkin,"$show_newphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newphoto$",Left_New(2))
	If InStr(TmpSkin,"$show_hotphoto$")>0 Then TmpSkin = Replace(TmpSkin,"$show_hotphoto$",Left_Hot(2))
	If InStr(TmpSkin,"$show_newmessage$")>0 Then TmpSkin = Replace(TmpSkin,"$show_newmessage$",Left_Msg())
	If InStr(TmpSkin,"$show_login$")>0 Then TmpSkin = Replace(TmpSkin,"$show_login$",User_Login())
	If InStr(TmpSkin,"$show_links$")>0 Then TmpSkin = Replace(TmpSkin,"$show_links$",Left_Links())
	If InStr(TmpSkin,"$show_search$")>0 Then TmpSkin = Replace(TmpSkin,"$show_search$",Blog_Search(1,""))
	If InStr(TmpSkin,"$show_info$")>0 Then TmpSkin = Replace(TmpSkin,"$show_info$",Show_Info())
	TmpSkin = Replace(TmpSkin,"$show_blogname$",b_name)
	TmpSkin = Replace(TmpSkin,"$show_placard$",B_content)
	TmpSkin = Replace(TmpSkin,"$show_blogurl$",GetUrl)
	TmpSkin = Replace(TmpSkin,"$show_blogurls$",GetUrls)
	TmpSkin = Replace(TmpSkin,"$show_myfriend$",Blog_Friend(b_listFriend,b_user))
	TmpSkin = Replace(TmpSkin,"$show_photo$",Blog_Photo(b_listphoto,b_user))
	TmpSkin = Replace(TmpSkin,"$show_userface$",Blog_UserFace(b_user))
	TmpSkin = Replace(TmpSkin,"$show_log$",ContentHtml)
	TmpSkin = Replace(TmpSkin,"$show_xml$","")
	TmpSkin = Cls.ReHtml(TmpSkin,0)
	If Int(Web_Dim(15)) = 0 Then
		Call PutOut(TmpSkin,Cls.Web_Name&"博客 - "&b_name&" - 留言本 - "&topic&"",b_user,"",b_content,"")
	Else
		Call PutOut(TmpSkin,b_name&" - 留言本 - "&topic&" - "&Cls.Web_Name&"博客",b_user,"",b_content,"")
	End if
End Function 

Function Left_New(ltype)
	dim tmp
	sql="select top "&b_leftnum&" id,topic,pic,count,tim  from AsaiMHBlogData where hidden=1 and type="&ltype&" and username='"&b_user&"' order by id desc"
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&""
	do while not rs.eof
	if ltype="2" then
		tmp=tmp&vbcrlf&"<div class=item><a href="&Cls.Web_Dir&"Blog/View/?"&rs("id")&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"浏览量:"&rs("count")&vbcrlf&"发布时间:"&rs("tim")&"""><img src="&rs("pic")&" border=0 width=180><br>"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><div class=line>&nbsp;</div>"
	else
		tmp=tmp&vbcrlf&"<div class=item><a href="&Cls.Web_Dir&"Blog/View/?"&rs("id")&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"浏览量:"&rs("count")&vbcrlf&"发布时间:"&rs("tim")&""">"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><div class=line>&nbsp;</div>"
	end if
	rs.movenext
	loop
	rs.close
	tmp=tmp&vbcrlf&""
	Left_New=tmp
end Function

Function Left_Hot(ltype)
	dim tmp
	sql="select top "&b_leftnum&" id,topic,pic,count,tim  from AsaiMHBlogData where hidden=1 and type="&ltype&" and  username='"&b_user&"' order by count desc"
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&""
	do while not rs.eof
	if ltype="2" then
		tmp=tmp&vbcrlf&"<div class=item><a href="&Cls.Web_Dir&"Blog/View/?"&rs("id")&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"浏览量:"&rs("count")&vbcrlf&"发布时间:"&rs("tim")&"""><img src="&rs("pic")&" border=0 width=180><br>"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><div class=line>&nbsp;</div>"
	else
		tmp=tmp&vbcrlf&"<div class=item><a href="&Cls.Web_Dir&"Blog/View/?"&rs("id")&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"浏览量:"&rs("count")&vbcrlf&"发布时间:"&rs("tim")&""">"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><div class=line>&nbsp;</div>"
	end if
	rs.movenext
	loop
	rs.close
	tmp=tmp&vbcrlf&""
	Left_Hot=tmp
end Function

Function Left_Pl(ltype)
	dim tmp
	If SqlType = 1 Then 
		sql="select top "&b_leftnum&" id,topic,retim  from AsaiMHBlogData where hidden=1 and type="&ltype&" and retim<>'' and username='"&b_user&"' order by retim desc"
	Else
		sql="select top "&b_leftnum&" id,topic,retim  from AsaiMHBlogData where hidden=1 and type="&ltype&" and retim<>null and username='"&b_user&"' order by retim desc"
	End If
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&""
	do while not rs.eof
		tmp=tmp&vbcrlf&"<div class=index><div class=item><a href="&Cls.Web_Dir&"Blog/View/?"&rs("id")&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"评论时间:"&rs("retim")&""">"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><span class=date>"&rs("retim")&"</span></div><div class=line>&nbsp;</div>"
		rs.movenext
	loop
	rs.close
	tmp=tmp&vbcrlf&""
	Left_Pl=tmp
end Function

Function Left_Msg()
	dim tmp
	sql="select top "&b_leftnum&" id,topic,tim  from AsaiMHBlogBook where hidden=1 and buser='"&b_user&"' order by id desc"
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&""
	do while not rs.eof
		tmp=tmp&vbcrlf&"<div class=index><div class=item><a href="&Cls.Web_Dir&"Blog/GBook/?"&b_user&" title=""标题:"&Cls.Code_Html(rs("topic"),1,0)&vbcrlf&"时间:"&rs("tim")&""">"&Cls.Code_Html(rs("topic"),1,b_leftcut)&"</a></div><span class=date>"&rs("tim")&"</span></div><div class=line>&nbsp;</div>"
		rs.movenext
	loop
	rs.close
	tmp=tmp&vbcrlf&""
	Left_Msg=tmp
end Function

Function Left_Links()
	dim tmp,ldim,lnum,lstr
	tmp=vbcrlf&""
	b_links=Cls.Code_Html(b_links,1,0)
	ldim=split(b_links,"@@@")
	lnum=ubound(ldim)
	for i=0 to lnum
		lstr=split(ldim(i),"|||")
		if ubound(lstr)<>1 then exit for
		tmp=tmp&vbcrlf&"<div class=item><span style=margin-left:18px><a href="""&lstr(1)&""" target=""_blank"" title=""点击这里访问"""&lstr(0)&""""">"&lstr(0)&"</a></span><span id=linkArea>"&lstr(1)&"</span></div><div class=line>&nbsp;</div>"
	next
	tmp=tmp&vbcrlf&""
	Left_Links=tmp
End Function

Function Left_Sort(ltype)
	dim tmp
	sql="select id,sort,count from AsaiMHBlogSort where type="&ltype&" and (showtype=0 or showtype=1) and  username='"&b_user&"' order by orders,id desc"
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&"<div class=item>"
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"' class='on' target=_blank>网站首页</a> "
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/' class='on'>博客首页</a></div><div class=line>&nbsp;</div>"
	tmp=tmp&vbcrlf&"<div class=item><a href='"&Cls.Web_Dir&"Blog/?"&b_user&"' class='on'><b>个人首页</b></a> "
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/?"&b_user&"'>日志</a> "
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/Photo/?"&b_user&"'>相册</a> "
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/GBook/?"&b_user&"'>留言</a></div><div class=line>&nbsp;</div>"
	'if rs.eof then tmp=tmp&vbcrlf&"<div class=item>暂无自定分类</div><div class=line>&nbsp;</div>"
	if rs.eof then tmp=tmp&vbcrlf&""
	do while not rs.eof
	if ltype = 1 then
		tmp=tmp&vbcrlf&"<div class=item><a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/"&rs("id")&""">"&Cls.Code_Html(rs("sort"),1,0)&"</a>("&rs("count")&")</div><div class=line>&nbsp;</div>"
	else
		tmp=tmp&vbcrlf&"<div class=item><a href="""&Cls.Web_Dir&"Blog/Photo/?"&b_user&"/0/"&rs("id")&""">"&Cls.Code_Html(rs("sort"),1,0)&"</a>("&rs("count")&")</div><div class=line>&nbsp;</div>"
	end if
	rs.movenext
	loop
	rs.close
	Left_Sort=tmp
End Function

Function Main_Sort(ltype)
	dim tmp
	sql="select id,sort,count from AsaiMHBlogSort where type="&ltype&" and (showtype=0 or showtype=2) and  username='"&b_user&"' order by orders,id desc"
	set rs=Cls.Exec(Sql,1)
	tmp=vbcrlf&""
	tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/'>博客主页</a><span>|</span>"
	if ltype = 1 then
		tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/?"&b_user&"' class='on'>首页</a>"
		tmp=tmp&vbcrlf&"<span>|</span><a href='"&Cls.Web_Dir&"Blog/?"&b_user&"'>博文</a>"
	else
		tmp=tmp&vbcrlf&"<a href='"&Cls.Web_Dir&"Blog/?"&b_user&"'>首页</a>"
		tmp=tmp&vbcrlf&"<span>|</span><a href='"&Cls.Web_Dir&"Blog/?"&b_user&"'>博文</a>"
		tmp=tmp&vbcrlf&"<span>|</span><a href='"&Cls.Web_Dir&"Blog/Photo/?"&b_user&"' class='on'>相册</a>"
	end if
	if rs.eof then 
		tmp=tmp&vbcrlf&""
	else
		do while not rs.eof 
		if ltype = 1 then
			tmp=tmp&vbcrlf&"<span>|</span><a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/"&rs("id")&""">"&Cls.Code_Html(rs("sort"),1,0)&"</a>"
		else
			tmp=tmp&vbcrlf&"<span>|</span><a href="""&Cls.Web_Dir&"Blog/Photo/?"&b_user&"/0/"&rs("id")&""">"&Cls.Code_Html(rs("sort"),1,0)&"</a>"
		end if
		rs.movenext
		loop
		rs.close
	end if
	if ltype = 1 then
		tmp=tmp&vbcrlf&"<span>|</span><a href='"&Cls.Web_Dir&"Blog/Photo/?"&b_user&"'>相册</a>"
	end if
	tmp=tmp&vbcrlf&"<span>|</span><a href='"&Cls.Web_Dir&"Blog/GBook/?"&b_user&"'>留言</a>"
	Main_Sort=tmp
End Function

Function Show_Info()
	dim tmp
	tmp=vbcrlf&"<div class=item><span style=margin-left:18px></span><span id=linkArea>博主名称："&format_user_name(b_user,0,"")&"</span></div>"
	tmp=tmp&vbcrlf&"<div class=item><span style=margin-left:18px></span><span id=linkArea>日志数量："&b_count1&"</span></div>"
	tmp=tmp&vbcrlf&"<div class=item><span style=margin-left:18px></span><span id=linkArea>相片数量："&b_count2&"</span></div>"
	tmp=tmp&vbcrlf&"<div class=item><span style=margin-left:18px></span><span id=linkArea>访问人数："&b_hits+1&"</span></div>"
	tmp=tmp&vbcrlf&"<div class=item><span style=margin-left:18px></span><span id=linkArea>创建时间："&cls.time_type(b_tim,4)&"</span></div>"
	Show_Info=tmp
End Function

Function PutOut(WriteHtml,wTit,wauthor,wkeyword,wdescription,tags)
	Call Cls.UpdateUserOnline(wTit)
	Response. Write "<HTML>" &_
	Vbcrlf & "<HEAD>" &_
	Vbcrlf & "<title>"&wTit&"</title>" &_
	Vbcrlf & "<meta http-equiv=""Content-Language"" content=""zh-CN"" />" &_
	Vbcrlf & "<meta name=""keyword"" content="""&b_name&"，"&wauthor&""&tags&""&wkeyword&"，"&web_keywords&"，"&Cls.web_Name&"博客"" />" &_
	Vbcrlf & "<meta name=""description"" content="""&wdescription&""&tags&""" />" &_
	Vbcrlf & "<meta name=""author"" content="""&b_name&"，"&wauthor&""&tags&""&wkeyword&""" />" &_
	Vbcrlf & "<meta name=""robots"" content=""index,follow"" />" &_
	Vbcrlf & "<meta name=""googlebot"" content=""index, follow"" />" &_
	Vbcrlf & "<style type=""text/css"">" &_
	Vbcrlf & "/*-----------整体用户模板其它CSS样式-----------*/" &_
	Vbcrlf & ".calendar-today {background-image: url("&Cls.Web_Dir&"Blog/Images/bg_today.gif);}" &_
	Vbcrlf & ".calendar-thisday {background-image: url("&Cls.Web_Dir&"Blog/Images/bg_thisday.gif);}" &_
	Vbcrlf & "/*-----------整体用户模板评论CSS样式-----------*/" &_
	Vbcrlf & "#m_info div,ul,li{list-style:none;margin:0px;padding:0px;}.rv_td { background-image: url("""&cls.web_skindir&"th.gif"");}" &_
	Vbcrlf & "/*-----------整体用户模板UBB样式-----------*/" &_
	Vbcrlf & ".UBBContainer{border:1px solid #ccc;background:#f7f7f7;border-left:3px solid;}" &_
	Vbcrlf & ".UBBTitle{font-weight:bold;padding:4px;background:#eee;border-bottom:1px dotted #ccc;}" &_
	Vbcrlf & ".UBBContent{padding:6px;line-height:160%;}" &_
	Vbcrlf & ".UBBContent textarea {width:450px;margin-bottom:2px;}" &_
	Vbcrlf & "/*-----------整体用户模板图片预览样式-----------*/" &_
	Vbcrlf & ".popupmenu_popup {text-align: left; line-height: 1.4em; padding: 10px; overflow: hidden; border: 1px solid #CAD9EA; background: #FFF url("""&cls.web_dir&"Images/ViewPic/PortalBox_Bg.gif""); background-repeat: repeat-x; background-position: 0 1px;}" &_
	Vbcrlf & "</style>" &_
	Vbcrlf & "<script src="""&Cls.web_Dir&"Blog/Images/Blog.js"" type=""text/javascript""></script>" &_
	Vbcrlf & "<script src="""&cls.web_dir&"Style/View.js"" type=""text/javascript""></script>" &_
	Vbcrlf & "<script src="""&Cls.web_Dir&"Style/LightBox2prototype.js"" type=""text/javascript""></script>" &_
	Vbcrlf & "<script src="""&Cls.web_Dir&"Style/LightBox2scriptaculous.js?load=effects"" type=""text/javascript""></script>" &_
	Vbcrlf & "<script src="""&Cls.web_Dir&"Style/LightBox2.js"" type=""text/javascript""></script>" &_
	Vbcrlf & "<link rel=""stylesheet"" href="""&Cls.web_Dir&"Style/LightBox2.css"" type=""text/css"" media=""screen"">" &_
	Vbcrlf & "</HEAD>" &_
	Vbcrlf & "<BODY>" &_
	Vbcrlf & "<noscript><iframe src=*.htm></iframe></noscript>" &_
	Vbcrlf & WriteHtml &_
	Vbcrlf & "<br><br><center><div id=ft><I>"&Cls.web_copyright&"</I><br />总<a href='"&Cls.Web_Dir&"Common/Online.asp'>在线</a>：<font color=red>"&Cls.LK_Online&"</font>&nbsp;人，用户数：<font color=blue>"&Cls.LK_UserOnline&"</font>&nbsp;人，游客数：<font color=green>"&Cls.LK_Online - Cls.LK_UserOnline&"</font>&nbsp;人</div></center>" &_
	Vbcrlf & "</BODY>" &_
	Vbcrlf & "</HTML>"
End Function

function weeks(w)
	select case w
	case 1 weeks="日"
	case 2 weeks="一"
	case 3 weeks="二"
	case 4 weeks="三"
	case 5 weeks="四"
	case 6 weeks="五"
	case 7 weeks="六"
	end select
end function

Function BlogURL(UrlStr)
	If UrlStr<>"" Then
		BlogURL="/"&BlogURL
	Else
		BlogURL="" 
	End If
End Function 

Function killhtmlEncode(str)
	dim re
	set re = New RegExp
	re.Global = True
	re.IgnoreCase = True
	Dim TStr1:TStr1=str
	re.Pattern = "\<([A-Za-z0-9\./=\?%\-&_~`@$\(\)[\]\':+!#\ \""\f]*)\>"
	TStr1 = re.Replace(TStr1, " ")
	re.Pattern = "\[([A-Za-z0-9\./=\?%\-&_~`@$\(\)[\]\':+!#\ \""\f]*)\]"
	TStr1 = re.Replace(TStr1,"")
	Set Re = Nothing
	killhtmlEncode=TStr1
End Function

Function PrintTrueText(tempString)
	If tempString<>"" Then
		PrintTrueText=Replace(Replace(Replace(Replace(Replace(killhtmlEncode(tempString),VbCrLf & " ","<br />" & "&nbsp;"),VbCrLf,"<br />" & VbCrLf),"   "," &nbsp; "),"  "," &nbsp;"),chr(9)," &nbsp; &nbsp; &nbsp;")
		If Left(PrintTrueText,1) = chr(32) Then
			PrintTrueText = "&nbsp;" & Mid(PrintTrueText,2)
		End If
	Else
		PrintTrueText=""
	End If
End Function

Function Calendar(C_Year,C_Month,C_Day)  'BLOG日历
	ReDim Link_Days(2,0)
	Dim Link_Count,tmpcal,tmpmem
	tmpcal=""
	Link_Count=0
	Dim This_Year,This_Month,This_Day,RS_Month,Link_TF
	IF C_Year=Empty Then C_Year=Year(Now())
	IF C_Month=Empty Then C_Month=Month(Now())
	IF C_Day=Empty Then C_Day=0
	C_Year=Cint(C_Year)
	C_Month=Cint(C_Month)
	C_Day=Cint(C_Day)
	This_Year=C_Year
	This_Month=C_Month
	This_Day=C_Day
	Dim To_Day,To_Month,To_Year
	To_Day=Cint(Day(Now()))
	To_Month=Cint(Month(Now()))
	To_Year=Cint(Year(Now()))
	SQL="SELECT Year,Month,Day FROM AsaiMHBlogData WHERE type=1 and hidden=1 and username='"&B_user&"' AND Year="&C_Year&" AND Month="&C_Month&" ORDER BY Day"
	Set RS_Month=Server.CreateObject("ADODB.RecordSet")
	RS_Month.Open SQL,Conn,1,1
	Dim the_Day
	the_Day=0
	Do While NOT RS_Month.EOF
		IF RS_Month("Day")<>the_Day Then
			the_Day=RS_Month("Day")
			ReDim PreServe Link_Days(2,Link_Count)
			Link_Days(0,Link_Count)=RS_Month("Month")
			Link_Days(1,Link_Count)=RS_Month("Day")
			Link_Days(2,Link_Count)=Cls.Web_Dir&"Blog/?"&b_user&"/0/0/"&RS_Month("Year")&"/"&RS_Month("Month")&"/"&RS_Month("Day")
			Link_Count=Link_Count+1
		End IF
		RS_Month.MoveNext
	Loop
	RS_Month.Close
	Set RS_Month=Nothing	
	Dim Month_Name(12)
	Month_Name(0)=""
	Month_Name(1)="1"
	Month_Name(2)="2"
	Month_Name(3)="3"
	Month_Name(4)="4"
	Month_Name(5)="5"
	Month_Name(6)="6"
	Month_Name(7)="7"
	Month_Name(8)="8"
	Month_Name(9)="9"
	Month_Name(10)="10"
	Month_Name(11)="11"
	Month_Name(12)="12"
	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("February 29, " & This_Year) Then Month_Days(2)=29	
	Dim Start_Week
	Start_Week=WeekDay(C_Month&"-1-"&C_Year)-1	
	Dim Next_Month,Next_Year,Pro_Month,Pro_Year
	Next_Month=C_Month+1
	Next_Year=C_Year
	IF Next_Month>12 then 
		Next_Month=1
		Next_Year=Next_Year+1
	End IF
	Pro_Month=C_Month-1
	Pro_Year=C_Year
	IF Pro_Month<1 then 
		Pro_Month=12
		Pro_Year=Pro_Year-1
	End IF
	tmpcal=tmpcal&""
	tmpcal=tmpcal&"<table width=""100%"" height=""100"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" background=""images/calendar/month"&Month_Name(C_Month)&".gif""><tr><td colspan=""7"" align=""center"">"
	tmpcal=tmpcal&"<a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/0/"&C_Year-1&""" title=""上一年"">&lt;&lt;</a><a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/0/"&Pro_Year&"/"&Pro_Month&""" title=""上一月""> &lt;</a> <strong>"&C_Year&"  - "&Month_Name(C_Month)&"</strong> <a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/0/"&Next_Year&"/"&Next_Month&""" title=""下一月"">&gt; </a><a href="""&Cls.Web_Dir&"Blog/?"&b_user&"/0/0/"&C_Year+1&""" title=""下一年"">&gt;&gt;</a></td></tr><tr class=""item-year"">"
	tmpcal=tmpcal&"<td>日</td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td></tr><tr>"
	Dim j,k,l,m
	For  i=0 TO Start_Week-1
		tmpcal=tmpcal&"<td class=""calendar"">&nbsp;</td>"
	Next
	Dim This_BGColor
	j=1
	tmpmem=""
	While j<=month_Days(This_Month)
	 	For k=start_Week To 6
			This_BGColor="calendar"
			IF j=To_Day AND This_Year=To_Year AND This_Month=To_Month Then This_BGColor="calendar-today"
			IF j=This_Day Then This_BGColor="calendar-thisday"
			tmpmem=tmpmem&"<td class="""&This_BGColor&""">"
			Link_TF="Flase"
			For l=0 TO Ubound(Link_Days,2)
				IF Link_Days(0,l)<>"" Then
					IF Link_Days(0,l)=This_Month AND Link_Days(1,l)=j Then
						tmpmem=tmpmem&"<a href="""&Link_Days(2,l)&""" class=blue>"
						Link_TF="True"
					End IF
				End IF
			Next
		IF j<=Month_Days(This_Month) Then tmpmem=tmpmem&j
		IF Link_TF="True" Then tmpmem=tmpmem&"</a>"
        tmpmem=tmpmem&"</td>"
		j=j+1
	Next
	Start_Week=0
	tmpmem=tmpmem&"</tr><tr>"
	Wend
	tmpcal=tmpcal&tmpmem
	tmpcal=tmpcal&"<td></td></tr></table>"
	Calendar=tmpcal
End Function

Function Blog_Search(sel,keyword)
	Dim B_sea
	b_sea="<FORM action='"&cls.web_dir&"Blog/Search.asp' method=get><input type=hidden name=user value='"&b_user&"'><div width='100%'> 关 键 字：<INPUT size=14 name=keyword value='"&keyword&"'><br />搜索目标：<select name=sel>"
	if sel="1" then
		b_sea=b_sea&"<option value='1' selected>标题</option>"
	else
		b_sea=b_sea&"<option value='1' >标题</option>"
	End if
	if sel="2" then
		b_sea=b_sea&"<option value='2' selected>作者</option>"
	else
		b_sea=b_sea&"<option value='2'>作者</option>"
	End If
	b_sea=b_sea&"</select>&nbsp;&nbsp;&nbsp;<INPUT type=submit value='搜 索' class=submit></Div></form>"
	Blog_Search=b_sea
End Function
 
Function Blog_Friend(num,bUserID)
	Dim sTmp,username,sex,web_n_sex,i,obj_page
	Set obj_page=new Cls_PageCute
	obj_page.nummer=num
	Call obj_page.p_init("id","AsaiMHUserFriend","username1='"&bUserID&"'","id desc")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_info()
	sql="select top "&num&" AsaiMHUserFriend.id,AsaiMHUserFriend.username2,AsaiMHUserData.power,AsaiMHUserData.sex,AsaiMHUserData.integral,AsaiMHUserData.emoney " & _
      "from AsaiMHUserFriend,AsaiMHUserData where AsaiMHUserFriend.username2=AsaiMHUserData.username and AsaiMHUserFriend.username1='"&bUserID&"' order by AsaiMHUserFriend.id"
	Call Cls.Exe_Conn(Rs,SQL,1)
	For i=1 To obj_page.page_num
		username=rs("username2")
		sex="boy"
		web_n_sex=Cls.Web_Boy
		if rs("sex")=false then
			sex="girl"
			web_n_sex=Cls.Web_girl
		End If
		sTmp=sTmp&"<tr class=frd_list align=left>" & _
		vbcrlf&"<td width='60%'>"&format_user_name(username,0,"")&"</td>" & _
		vbcrlf&"<td width='10%'><img border=0 src='"&Cls.web_skindir&"sys/icon_"&format_power(rs("power"),0)&".gif' title='"&username&" 是 "&format_power(rs("power"),1)&"' align=absmiddle></td>" & _
		vbcrlf&"<td width='10%'><img border=0 src='"&Cls.web_skindir&"sys/"&sex&".gif' title='"&username&" 是 "&web_n_sex&"' align=absmiddle></td>" & _
		vbcrlf&"<td width='10%'><a href='"&Cls.web_dir&"User/Mail.asp?action=msg_write&accept="&server.urlencode(username)&"' target=_blank><img src='"&Cls.web_skindir&"mail/msg.gif' title='给 "&username&" 发送短信' border=0></a></td>" & _
		vbcrlf&"</tr>"
		rs.movenext
	next
	rs.close
	Blog_Friend="<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center' class='frd_list_render_in_table'>"&sTmp&"</table>"
End Function

Function Blog_Photo(num,bUserID)
	Dim ID,Topic,Topic1,ClassName,HtmlFileUrl,Pics1,pic,Links1,HtmlFileNames,sTmp
	SQL="SELECT top "&num&" id,topic,pic FROM AsaiMHBlogData WHERE type=2 and hidden=1 and username='"&bUserID&"' order by id desc"
	Set Rs = Cls.Exec(SQL,1)
	If Rs.BOF And Rs.EOF Then
		sTmp = Cls.GetPic("<img src='"&Cls.Web_Dir&"Skin/no_pic.gif' border=0>")
	Else
		Do While Not Rs.EOF
			id=rs("id")
			HtmlFileUrl = ""&Cls.web_dir&"Blog/View/?" & Rs("ID")
			Pic=rs("pic")
			pic=Cls.code_html(pic,1,0)
			pics1= pics1&"|"&pic
			topic=rs("topic")
			topic1= topic1&"|"&topic
			links1= links1&"|"&HtmlFileUrl
			rs.movenext
		loop
		rs.close
		if left(pics1,1)="|" then pics1=right(pics1,len(pics1)-1)
		if left(links1,1)="|" then links1=right(links1,len(links1)-1)
		if left(Topic1,1)="|" then Topic1=right(Topic1,len(Topic1)-1)
		sTmp= vbcrlf&"<script type=""text/javascript"" src="""&Cls.Web_Dir&"Style/WriteFlashHtml.js""></script>" &_
		vbcrlf&"<script type=""text/javascript"">writeFlashHTML(""_version=8,0,0,0"" ,""_swf="&Cls.Web_Dir&"images/small/bcastr.swf"", ""_width=180"", ""_height=200"", ""_quality=high"", ""_flashvars=bcastr_flie="&pics1&"&bcastr_link="&links1&"&bcastr_title="&Topic1&"&autoPlayTime=3&titlebgalpha=45&titlebgcolor=0x0466B1&titleplace=tc&titlesize=28&titlefont=Verdana&target=_self"", ""_menu=false"");</script>"
	End If
	Blog_Photo="<TABLE cellSpacing=1 cellPadding=4 border=0 align=center><TBODY><TR><TD>"&sTmp&"</TD></TR></TBODY></table>" 
End Function

Function Blog_UserFace(bUserID)
	Dim ID,face,face_w,face_h,sTmp
	SQL="SELECT top 1 id,face,face_w,face_h FROM AsaiMHUserData WHERE username='"&bUserID&"' order by id desc"
	Set Rs = Cls.Exec(SQL,1)
	face=rs("face")
	face_w=rs("face_w")
	face_h=rs("face_h")
	If Cls.Is_Null(face)="" Then
		sTmp = Cls.GetPic("<img src='"&Cls.Web_Dir&"Skin/no_pic.gif' border=0>")
	Else
		sTmp= vbcrlf&"<img src='"&face&"' border=0 width="&face_w&" height="&face_h&">"
	End If
	Blog_UserFace="<TABLE cellSpacing=1 cellPadding=4 border=0 align=center><TBODY><TR><TD>"&sTmp&"</TD></TR></TBODY></table>" 
End Function

Function Blog_UserTags(tags,btype)
	Dim tmp,A_tags,B_tags
	tags=rs("tags")
	A_tags=split(tags," ")
	For i=0 to ubound(A_tags)
		B_tags=right(A_tags(i),len(A_tags(i))-instr(A_tags(i)," "))
		If btype="1" then
			tmp=tmp&"<A href='"&Cls.Web_Dir&"Blog/List1.asp?Action=search&sea_type=tags&keyword="&B_tags&"' target=_blank>"&B_tags&"</A> "
		Else
			tmp=tmp&"<A href='"&Cls.Web_Dir&"Blog/List2.asp?Action=search&sea_type=tags&keyword="&B_tags&"' target=_blank>"&B_tags&"</A> "
		End If
	next
	erase A_tags
	Blog_UserTags=""&tmp&"" 
End Function

Private Function GetUrl()
	Dim ScriptAddress 
	ScriptAddress = Replace(Cls.Web_Url,"http://","")
	ScriptAddress = ScriptAddress & "/Blog/?"&b_user&""
	GetUrl = "http://"&ScriptAddress&""
	'GetUrl = "<a href='http://"&ScriptAddress&"' target='_blank'>http://"&ScriptAddress&"</a>"
End Function

Private Function GetUrls()
	Dim ScriptAddress, M_ItemUrl, M_item,page 
	ScriptAddress = LCase(Request.ServerVariables("Server_Name")) '取得当前地址
	ScriptAddress ="Http://"&ScriptAddress
	M_ItemUrl = ""
	If (Request.QueryString <> "") Then
		ScriptAddress =  ScriptAddress & "/Blog/?"
		For Each M_item In Request.QueryString
			If InStr(page,M_Item)=0 Then
				M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&""))  & "&"
			End If
		Next
	end if
	M_ItemUrl = Left(M_ItemUrl, Len(M_ItemUrl) - 2)
	GetUrls = ScriptAddress & M_ItemUrl
End Function
%>
