<%
'****************************************************
' HSCMS 1.2      Power by eebaa.com
' Email: yz_xiaojun@163.com
' Web: http://www.eebaa.com
' Copyright (C) 2006 eebaa.com All Rights Reserved.
'****************************************************
dim nummer,nums,rssum,page,viewpage,thepages,pageurl
nummer=10
nums=nummer
index_url="diary"
n_sort="diary"
b_userid=replace(trim(request.QueryString("userid"))," ","")
if b_userid="" then 
   response.Redirect("./")
   response.End()
end if
url1="blog.asp?userid="&b_userid
blog_zt="<table width='300' border='0' style=""font-size:12px""><tr><td><a href='blog.asp?userid="&b_userid&"' target='_self'>文章频道</a></td><td><a href='photo.asp?userid="&b_userid&"' target='_self'>相册频道</a></td><td><a href='/blog' target='_self'>博客首页</a></td>    <td><a href='/' target='_self'>网站首页</a></td>    <td><a href='../user/blog.asp?action=adn1' target='_self'>管理博客</a></td></tr></table>"
blog_fl="<table width='100%' border='0'><tr><td><a href='../user/blog.asp?action=write1' target='_self' title='发布最新日志'><b>发表日志</b></a></td><td><a href='../user/blog.asp?action=write2' target='_self' title='发布您的相片'><b>发表相片</b></a></td>  <td><a href='../user/blog.asp?action=adn1' target='_self'><font color='red'>博客管理</font></a></td></tr></table>"
'------------------------------------------------------

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 blog_data WHERE type='article' and hidden=1 and username='"&B_userid&"' 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
	SQLQueryNums=SQLQueryNums+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)="blog.asp?Userid="&b_userid&"&Year="&RS_Month("Year")&"&Month="&RS_Month("Month")&"&Day="&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&"<DIV class=border1><DIV class=lefttitle>站点日历</DIV><div  class='msg'>"
	tmpcal=tmpcal&"<table width=""160"" 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=""blog.asp?Userid="&b_userid&"&Year="&C_Year-1&""" title=""上一年""><span class=""arrow"">7</span></a><a href=""blog.asp?Userid="&b_userid&"&Year="&Pro_Year&"&Month="&Pro_Month&""" title=""上一月""><span class=""arrow"">3</span></a> <strong>"&C_Year&"  - "&Month_Name(C_Month)&"</strong> <a href=""blog.asp?Userid="&b_userid&"&Year="&Next_Year&"&Month="&Next_Month&""" title=""下一月""><span class=""arrow"">4</span></a><a href=""blog.asp?Userid="&b_userid&"&Year="&C_Year+1&""" title=""下一年""><span class=""arrow"">8</span></a></td></tr><tr bgcolor=""#F8F8F8"" class=""calendar-week"">"
	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></DIV></DIV>"
    Calendar=tmpcal
End Function

Function  left_new()
dim tmp
sql="select top 10 id,topic,tim  from blog_data where hidden=1 and type='article' and username='"&b_userid&"' order by id desc"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
tmp=""&_
vbcrlf&"<DIV width=100% align='left'>"
do while not rs.eof
tmp=tmp&vbcrlf&"<li><a href=blog_view.asp?userid="&b_userid&"&id="&rs("id")&">"&joekoe_cms.code_html(rs("topic"),1,28)&"</a> <br><font class=gray >发表于"&joekoe_cms.time_type(rs("tim"),4)&"</font></li>"
rs.movenext
loop
rs.close
tmp=tmp&vbcrlf&"</DIV>"
left_new=tmp
end Function

Function left_hot()
dim tmp
sql="select top 10 id,topic,count  from blog_data where hidden=1 and type='article' and  username='"&b_userid&"' order by count desc"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
tmp=""&_
vbcrlf&"<DIV width=100% align='left'>"
do while not rs.eof
tmp=tmp&vbcrlf&"<li><a href=blog_view.asp?userid="&b_userid&"&id="&rs("id")&">"&joekoe_cms.code_html(rs("topic"),1,23)&"</a>&nbsp;<font class=gray>("&rs("count")&")</font></li>"
rs.movenext
loop
rs.close
tmp=tmp&vbcrlf&"</DIV>"
left_hot=tmp
end Function
'****************************************************
' HSCMS 1.2      Power by eebaa.com
' Email: yz_xiaojun@163.com
' Web: http://www.eebaa.com
' Copyright (C) 2006 eebaa.com All Rights Reserved.
'****************************************************
%>