<!-- #include file="../../include/skin.asp" -->
<!-- #include file="skins.asp" -->
<!-- #include file="../../pet/Pet_Conn.asp" -->


<%
'****************************************************
' 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.
'****************************************************
tit_fir="博客"
Dim b_userid,b_id,b_name,b_content,b_open,b_hits,b_skin,b_password,busername,b_skinmain,b_skinshowlog,webroad,topic_weeks,user_hf,blog_main,log_list,blog_zt,blog_fl,photo_main
Dim cod,d_author
dim berr:berr=""
webroad=""
topic_weeks=""
user_hf=""
blog_zt=""
'------------------------------------------------------
sub blog_first()
sql="select * from blog where username='"&b_userid&"'"
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
   response.Redirect("./")
   response.End()
else
   b_id=rs("id")
   b_name=rs("blogname")
 '  b_userid=rs("username")
   b_content=rs("content")
   b_open=rs("isopen")
   b_hits=rs("hits")
   b_password=rs("password")
   b_skin=rs("skin")
   b_skinmain=trim(rs("user_skin_main"))
   b_skinshowlog=trim(rs("user_skin_showlog"))
   if var_null(b_skin)="" then b_skin=1
end if
rs.close 

If b_skin=0 or var_null(b_skinmain)="" or var_null(b_skinshowlog)="" then 
		sql="select skinmain,skinshowlog from Oblog_userskin where id="&Int(joekoe_cms.rand_num(2)/2)&" " 
		set rs=joekoe_cms.exec(sql,1)
		if rs.eof then
		   response.Redirect("./")
		   response.End()
		else
		   b_skinmain=rs("skinmain")
		   b_skinshowlog=rs("skinshowlog")
		end if
		rs.close 
End If
if b_open=true then call joekoe_cms.exec("update blog set hits=hits+1 where id="&b_id,0)  
If b_open=false then
   Call Blog_Top()
   response.write "<div id='main'>该日志已经关闭，请联系站长！</div>"
   Call Blog_End()
   response.End()
End if 



end sub





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 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 sql_chk(strr)
dim str: str=strr
str=trim(str)
str=replace(str," ","")
str=replace(str,"--","")
str=replace(str,"'","""")
sql_chk=str
end function


function  user_info()
dim tmp,bface
sql="select username,face,emoney,integral from user_data where id="&b_userid
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then 
busername=rs(0)
bface=rs(1)
bemoney=rs(2)
bintegral=rs(3)
end if
rs.close
tmp="<table width='100%' border='0' cellspacing='0' cellpadding='0' align=center><tr><td colspan=2 align=center><a href='../user/view.asp?username="&busername&"'><img src='"&bface&"' border=0 onload='javascript:if(this.width>140)this.width=140;'></a></td></tr><tr><td colspan=2 align=center><a href='../user/view.asp?username="&busername&"'><b>"&busername&"</b></a>&nbsp;"&bemoney&"&nbsp;"&img_skin("emoney")&"&nbsp;"&bintegral&"<font class=gray>分</font></td></tr><tr align=center><td ><a href='../user/friend.asp?action=add&add_username="&busername&"' target=_blank>加为好友</a> </td><td > <a href='../user/mail.asp?action=msg_write&accept="&busername&"' target=_blank>发送短信</a></td></tr></table>"
'response.write tmp
user_info=tmp

End Function 

Sub Blog_Top()
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang=zh-CN xml:lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<TITLE><%=b_name%>--<%=topic%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="" name=Copyright>

<script language=javascript src="../style/hscms_functions.js"></script>
<script language="JavaScript" src="../style/hscms_select.js"></script>
<script language="VBScript" type="text/VBScript">
Function checkdate()
y=year(Now)
m=month(Now)
d=day(Now)
theDate=document.all("a_year").value&"-"&document.all("a_month").value&"-"&document.all("a_day").value
if DateDiff("d", Now, theDate)>0 then
alert("那天还没有到呢！")
document.all("a_year").value=y
document.all("a_month").value=m
document.all("a_day").value=d
end if
End Function
</script>
<style type="text/css">
.calendar {color: #666;text-align: center;font: 11px Verdana;}
.calendar-week {color: #666;text-align: center;font: bold 11px Tahoma;}
.calendar-today {color: #666;background-image: url(images/bg_today.gif); text-align: center;font: 11px Verdana;}
.calendar-thisday {color: #666;background-image: url(images/bg_thisday.gif);text-align: center;font: 11px Verdana;}
.arrow {font-family: webdings;}
.gray{ color:#666666; }
.red { color:#FF0000; }
.blue { color:#0066CC; }
</style>
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
</HEAD>
<BODY>


<%
End Sub






Function blog_search()
Dim B_sea
b_sea="<table width=100% ><FORM action='blog.asp?userid="&b_userid&"&action=search' method=post><tr><td><DIV width=100> <INPUT size=25 name=keyword value='"&keyword&"'><BR>"
if sel<>"author" then
    b_sea=b_sea&"<INPUT type=radio CHECKED value='topic' name=sel>标题 "
	else
	b_sea=b_sea&"<INPUT type=radio CHECKED value='topic' name=sel CHECKED >标题 "
  End if
  if sel="author" then
    b_sea=b_sea&"<INPUT type=radio CHECKED value='author' name=sel> "
  else
    b_sea=b_sea&"<INPUT type=radio  value='author' name=sel> "
  End If
   b_sea=b_sea&"作者 <SELECT name=stype>"
  if stype<>"photo" then 
      b_sea=b_sea&"<OPTION value='article' >"
   Else
      b_sea=b_sea&"<OPTION value='article' selected>"
   End if
   b_sea=b_sea&"文章</OPTION>"
   if stype="photo" then 
      b_sea=b_sea&"<OPTION value='photo' selected>"
   Else
      b_sea=b_sea&"<OPTION value='photo' >"
   End If
   b_sea=b_sea&"相册</OPTION></SELECT> <INPUT type=submit value=查询></td></tr></form></table>"
   Blog_search=b_sea
End Function

Function blog_pl(num,rid)
	sql="select top "&num&" re_id,rusername,rword,username from review where rsort='diary' and username='"&rid&"' order by rid desc"
	  call joekoe_cms.exec("",-1)
	  rs.open sql,conn,1,1
	dim tmp1,typess
	if not rs.eof then 
		tmp1=vbcrlf&"<div width=100% align='left'>"
		do while not rs.eof
			tmp1=tmp1&vbcrlf&"<li><a href=blog_view.asp?userid="&rs("username")&"&id="&rs("re_id")&" title='回复人："&joekoe_cms.code_html(rs("rusername"),1,0)&"'>"&joekoe_cms.code_html(rs("rword"),1,25)&"</a></li>"
		rs.movenext
		loop	
	
		tmp1=tmp1&vbcrlf&"</div>"
    else
	     tmp1="无回复信息"
	End If
		rs.close
	blog_pl=tmp1
End function

Function photo_pl(num,rid)
	sql="select top "&num&" re_id,rusername,rword,username from review where rsort='photo' and username='"&rid&"' order by rid desc"
	  call joekoe_cms.exec("",-1)
	  rs.open sql,conn,1,1
	dim tmp1
	if not rs.eof then 
		tmp1=vbcrlf&"<div width=100% align='left'>"
		do while not rs.eof
			tmp1=tmp1&vbcrlf&"<li><a href=photo_view.asp?userid="&rs("username")&"&id="&rs("re_id")&" title='回复人："&joekoe_cms.code_html(rs("rusername"),1,0)&"'>"&joekoe_cms.code_html(rs("rword"),1,25)&"</a></li>"
		rs.movenext
		loop	
	
		tmp1=tmp1&vbcrlf&"</div>"
    else
	     tmp1="无回复信息"
	End If
		rs.close
	photo_pl=tmp1
End function

Function hot_blog1(num)
sql="select top "&num&" blogname,username,hits from blog order by hits desc"
set rs=joekoe_cms.exec(sql,1)
dim tmp1
tmp1=vbcrlf&"<table cellspacing=1 cellpadding=4 border=0 width='100%'>"
do while not rs.eof
tmp1=tmp1&vbcrlf&"<tr><td width='90%'><a href=../blog/blog.asp?userid="&rs("username")&" title='["&idtoname(rs("username"))&"] 的博客' ><b>"&rs("blogname")&"</b></a></td><td width='*' align=right><font class=gray>"&rs("hits")&"</font></td></tr>" 
rs.movenext
loop

tmp1=tmp1&vbcrlf&"</table>"
rs.close
'call hscms_blog_table("热门博客",tmp1)
hot_blog1=tmp1
end Function 

Sub Blog_End()
%>
<DIV id=footer>
<DIV id=nav_r><IMG alt="" src="images/main/boke_logo.gif" border=0> </DIV>
Power by <A href="http://www.35me.com/" target=_blank><U>流浪者家园</U></A> 
<BR>Copyright &copy; 2005-2006 35ME.com All Rights Reserved.</DIV></DIV></CENTER></BODY></HTML>
<%
End Sub


Function showPet(Str)
	Dim poppet,pet,User
	User=Str
	poppet="select * from [mypetdata] where username ='"& User &"'"
	set rspet = connpet.execute(poppet)
	if not rspet.eof then
	Dim t,today,pett,petlevel,petep,petshowlevel,level1,level2,petpic,pethp,petatk,petdef,petmaxhp,petsp,levelpic,mypet,mypetlevel,turn
	Dim hpf,spf,petdead,petsex,petpk,mypetsx,imgset
	t=now()
	today = date()
	pett= DateDiff("d", rspet("petregdate"), today)    
	petlevel = sqr((Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)))
	petsex = rspet("mypetsex")
	turn=int(rspet("relive"))		'转生设置
	if turn<1 then 
	turn = "<font color=red>未</font>"
	else
	turn=turn &" 转"
	end if
	petep = int (100 * (petlevel - int (petlevel)))
	petshowlevel =  int (petlevel + 1)
	levelpic=int(petshowlevel/10)
	if (levelpic>10) then levelpic=11 end if
	level1=int(petshowlevel/2)
	level2=int(petshowlevel/2)
	petpic=rspet("mypetname")
	pethp=rspet("mypethp")
	petatk=rspet("mypetatk")+rspet("item1Num")+rspet("item2Num")+2+level1
	petdef=rspet("mypetdef")+rspet("item3Num")+rspet("item4Num")+rspet("item5Num")+3+level1
	if (petshowlevel<2) then 
	petmaxhp=DEF_PET_basichp 
	else 
	petmaxhp=DEF_PET_basichp+petshowlevel*5
	end if
	petsp=rspet("mypetsp")-pett*DEF_PET_basicsp2
	if(petsp>DEF_PET_basicsp) then petsp=DEF_PET_basicsp end if
	hpf= int (100 * (pethp / petmaxhp)) - 1
	spf= int (100 * (petsp / DEF_PET_basicsp)) - 1
	if (pethp<0) then pethp=0 end if
	if (petsp<0) then petsp=0 end if
	if (rspet("openpk") < 2) then
	petpk="来啊，PK，PK"
	else
	petpk="我不想打，不想不想……"
	end if
	if ( hpf >= 98 ) then hpf = hpf - 2 end if
	if ( spf >= 98 ) then spf = spf - 2 end if

	if pethp<1 or petsp<1 then 
	petdead= "死亡"
	else
	if petsp<1000 then
	petdead="<font color=red>我快饿死了,主人虐待我!</font>"
	else
	petdead= "生存"
	end if
	end if

	if petsex>1 then 
	petsex= "女生"
	else
	petsex= "男生"
	end if

	mypet=rspet("mypet")
	mypetsx = rspet("mypetsx")
	mypetlevel = rspet("mypetlevel")
	dim petkill,pic
	if (rspet("mypetdead") = 1) then
	petkill=""
	else
	petkill=""
	end if
	imgset = rspet("imgset")    
	if (imgset=-1)  then 
	pic=levelpic
	else
	pic=imgset
	end if
	showPet="<tr><td><font color=purple>宠物宝宝</font>：<a href=../pet/petview.asp?username="& User &" title=查看宠物信息 target=_blank><font color=red>"&rspet("mypet")&"</font></a></td></tr>" & _
          vbcrlf&"<tr><td><div align=center><a href=../pet/petview.asp?username="& User &" title=查看"&User&"的宠物属性 target=_blank><img src=../pet/images/pet/"&petpic&"/"&petkill&""&petpic&""&pic&".gif border=0></a></div></td></tr>" & _
          vbcrlf&"<tr><td><div align=center>====<a href=../pet/petrisk.asp target=_blank title=宠物大冒险>!我的宝宝要去冒险咯!</a>====" & _
          vbcrlf&"<BR>等级："&mypetlevel&"级&nbsp;&nbsp;属性："&mypetsx&"<BR>状态："&petdead&"&nbsp;&nbsp;转生："&turn&"</div></div></td></tr>" & _
          vbcrlf&"<tr><td><div align=center><a href=../pet/petbattle.asp?atkname="& User &"&action=atkpet title=和他的宠物pk："&petpk&" target=_blank><font color=purple>☆攻击他的宠物宝宝☆</font></a></div></td></tr>" & _
          vbcrlf&"</td></tr>"
     else
	 showPet = "<tr><td align=center><FONT COLOR=""#FF0000"">还没宠物，<br>快去买一个啊!</FONT><br>[<a href=../pet/petshop.asp><font color=navy>宠物商店</font></a>]</td></tr>"
	 end if
	rspet.close
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.
'****************************************************
%>

