<!-- #include file="setup.asp" --><%

username=HTMLEncode(Request("username"))
id=HTMLEncode(Request("id"))

top
%>
<table class="a2" cellSpacing="1" cellPadding="4" width="97%" align="center" border="0">
	<tr class="a3">
		<td colSpan="2">
		<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table2">
			<tr>
				<td height="18">&nbsp;<img src="images/Forum_nav.gif">&nbsp; <%ClubTree%> → <a href="calendar.asp">社区日志</a> → <span id=title><a href="blog.asp">网络日志</a></span></td>
				<td align="right" height="18">
				<img src="images/jt.gif"> <a href=calendar.asp?menu=newcalendar>发表日志</a></td>
			</tr>
		</table>
		</td>
	</tr>
</table>

<br>
<table border="0" width="97%" align="center">
	<tr>
		<td align="center">
		<table class="a2" style="WIDTH:100%" height="100%" cellspacing="1" cellpadding="3" border="0" id="table5">
			<tr>
				<td class="a1" align="middle" height="25"><b>网络日志</b></td>
			</tr>
			<tr align="middle">
				<td bgcolor="#ffffff" align="left" height="100">
<%


if id<>"" then
sql="select * from [calendar] where id="&id&" order by id Desc"
else
sql="select * from [calendar] where (hide=0 or username='"&Request.Cookies("username")&"') and username='"&username&"' order by id Desc"
end if

rs.Open sql,Conn,1

if rs.eof then error("<li>该用户暂时没有任何日志")

pagesetup=10 '设定每页的显示数量
rs.pagesize=pagesetup
TotalPage=rs.pagecount  '总页数
PageCount = cint(Request.QueryString("ToPage"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then rs.absolutepage=PageCount '跳转到指定页数
i=0
Do While Not RS.EOF and i<pagesetup
i=i+1
username=rs("username")
content=rs("content")

if id="" then
content=ReplaceText(content,"<[^>]*>","")
if len(content)>200 then content=left(""&content&"",200)&"..."
end if


%>
				<table border="0" width="100%" cellspacing="10">
					<tr>
						<td>
						<b><font size="4"><%=rs("title")%></font></b><br>
						<br><%=content%>
<%if rs("hide")=1 then%><br><br>注：<font color="#FF0000">本篇日志为隐藏状态</font><%end if%>
<hr>
<%if id="" then%>
<a href="?id=<%=rs("id")%>">阅读全文</a>
<%else%>
<font color="#C0C0C0">阅读全文</font>
<%end if%>
 | 
<%if Request.Cookies("username")=username then%>
<a href="calendar.asp?menu=newcalendar&id=<%=rs("id")%>">编辑</a>
<%else%>
<font color="#C0C0C0">编辑</font>
<%end if%>
 | 
<%if username= Request.Cookies("username") or membercode > 3 then%>
<a href="calendar.asp?menu=del&id=<%=rs("id")%>" onclick="checkclick('您确定要删除此条日志?')">删除</a>
<%else%>
<font color="#C0C0C0">删除</font>
<%end if%>
 | <%=rs("addtime")%> by <a href="Profile.asp?username=<%=username%>"><%=username%></a></td>
					</tr>
				</table>
<%
RS.MoveNext
loop

RS.Close  
%>
				</td>
			</tr>
		</table>
		<p><b>[<script>ShowPage(<%=TotalPage%>,<%=PageCount%>,"username=<%=username%>")</script>]</b></p>
		</td>
		<td width="200" align="right" valign="top">
		<table class="a2" style="WIDTH:95%" cellspacing="1" cellpadding="3" border="0">
			<tr class="a1">
				<td align="middle" height="25"><b>档案文件</b></td>
			</tr>
			<tr align="middle">
				<td bgcolor="#ffffff">
<%
sql="select * from [user] where username='"&username&"'"
Set Rs=Conn.Execute(sql)

select case rs("sex")
case "male"
sex="男"
case "female"
sex="女"
end select

if rs("birthday")<>"" then birthyear=year(now)-split(rs("birthday"),"-")(0)

userphoto=rs("userphoto")
UserInfo=split(rs("UserInfo"),"\")
realname=UserInfo(0)
country=UserInfo(1)
province=UserInfo(2)
city=UserInfo(3)
postcode=UserInfo(4)
blood=UserInfo(5)
belief=UserInfo(6)
occupation=UserInfo(7)
marital=UserInfo(8)
education=UserInfo(9)
college=UserInfo(10)
address=UserInfo(11)
phone=UserInfo(12)
character=UserInfo(13)
personal=UserInfo(14)
rs.close
%>
<script>
if("<%=userphoto%>"!=""){
document.write("<a target=_blank href=<%=userphoto%>><img src=<%=userphoto%> border=0 width=150></a>")
}
</script>
				<table cellspacing="2" cellpadding="2" width="100%" border="0">
					<tr>
						<td valign="top">姓名：</td>
						<td width="120" ><%=username%></td>
					</tr>
					<tr>
						<td valign="top">年龄：</td>
						<td width="120"><%=birthyear%>
						</td>
					</tr>
					<tr>
						<td valign="top">性别：</td>
						<td width="120"><%=sex%></td>
					</tr>
					<tr>
						<td valign="top">职业：</td>
						<td width="120"><%=occupation%></td>
					</tr>
					<tr>
						<td valign="top"><font class="bold">位置：</font></td>
						<td width="120"><%=country%><br>
						<%=province%><br>
						<%=city%></td>
					</tr>
					<tr>
						<td colspan="2"><%=personal%></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr align="middle">
				<td bgcolor="#ffffff" align="right">
				<a href="Profile.asp?username=<%=username%>">查看档案文件详细信息</a></td>
			</tr>
		</table>
		<br>
		<table class="a2" style="WIDTH:95%" cellspacing="1" cellpadding="3" border="0">
			<tr>
				<td class="a1" align="middle" height="25"><b>以往公开日志</b></td>
			</tr>
			<tr bgcolor="#ffffff">
				<td>
<%
sql="select top 10 * from [calendar] where hide=0 and username='"&username&"' order by id Desc"

Set Rs=Conn.Execute(sql)
Do While Not RS.EOF
%><li><a href=?id=<%=rs("id")%>><%=rs("title")%></a> (<%=rs("adddate")%>)</li><%
RS.MoveNext
loop
RS.Close   
%>
</td></tr>
		</table>
		　</td>
	</tr>
</table>

<script>title.innerHTML='<a href="blog.asp?username=<%=username%>">“<%=username%>”网络日志</a>'</script>

<%

htmlend
%>