%
if CookieUserName=empty then error("您还未登录论坛")
if ReturnUrl="" then ReturnUrl="Default.asp"
FavoriteID=RequestInt("FavoriteID")
ThreadID=RequestInt("ThreadID")
ForumID=RequestInt("ForumID")
FriendUserName=HTMLEncode(Request("FriendUserName"))
HtmlTop
TotalFavoriteThread=conn.Execute("Select count(FavoriteID) From [BBSXP_FavoriteThreads] where OwnerUserName='"&CookieUserName&"'")(0)
TotalFavoriteForums=conn.Execute("Select count(FavoriteID) From [BBSXP_FavoriteForums] where OwnerUserName='"&CookieUserName&"'")(0)
TotalFavoriteFriend=conn.Execute("Select count(FavoriteID) From [BBSXP_FavoriteUsers] where OwnerUserName='"&CookieUserName&"'")(0)
select case Request("menu")
case "FavoriteFriend"
if Ucase(FriendUserName)=Ucase(CookieUserName) then error("不能添加自己!")
if TotalFavoriteFriend>20 then error("好友收藏夹最多只能添加20人!")
if Conn.Execute("select UserName from [BBSXP_Users] where UserName='"&FriendUserName&"'").eof then error("系统中没有 "&FriendUserName&" 的资料!")
Rs.Open "select * from [BBSXP_FavoriteUsers] where OwnerUserName='"&CookieUserName&"' and FriendUserName='"&FriendUserName&"'",Conn,1,3
if Rs.eof then Rs.addNew
Rs("OwnerUserName")=CookieUserName
Rs("FriendUserName")=FriendUserName
Rs.update
Rs.close
succeed "添加成功",""
case "FavoriteThread"
if TotalFavoriteThread>20 then error("帖子收藏夹最多只能添加 20 条数据!")
if Conn.Execute("select ThreadID from [BBSXP_Threads] where ThreadID="&ThreadID&"").eof then error("系统中没有ID为 "&ThreadID&" 的主题!")
Rs.Open "select * from [BBSXP_FavoriteThreads] where OwnerUserName='"&CookieUserName&"' and ThreadID="&ThreadID&"",Conn,1,3
if Rs.eof then Rs.addNew
Rs("OwnerUserName")=CookieUserName
Rs("ThreadID")=ThreadID
Rs.update
Rs.close
succeed "添加成功",""
case "FavoriteForums"
if TotalFavoriteForums>20 then error("论坛收藏夹最多只能添加 20 条数据!")
if Conn.Execute("select ForumID from [BBSXP_Forums] where ForumID="&ForumID&"").eof then error("系统中没有ID为 "&ForumID&" 的论坛!")
Rs.Open "select * from [BBSXP_FavoriteForums] where OwnerUserName='"&CookieUserName&"' and ForumID="&ForumID&"",Conn,1,3
if Rs.eof then Rs.addNew
Rs("OwnerUserName")=CookieUserName
Rs("ForumID")=ForumID
Rs.update
Rs.close
succeed "添加成功",""
case "DelFavoriteForums"
conn.Execute("delete from [BBSXP_FavoriteForums] where OwnerUserName='"&CookieUserName&"' and FavoriteID="&FavoriteID&"")
succeed "删除成功",""
case "DelFavoriteThreads"
conn.Execute("delete from [BBSXP_FavoriteThreads] where OwnerUserName='"&CookieUserName&"' and FavoriteID="&FavoriteID&"")
succeed "删除成功",""
case "DelFavoriteFriend"
conn.Execute("delete from [BBSXP_FavoriteUsers] where OwnerUserName='"&CookieUserName&"' and FriendUserName='"&FriendUserName&"'")
succeed "删除成功",""
case else
default
end select
Sub Default
%>
<%ClubTree%> → 收藏夹
好友列表 |
<%
sql="select * from [BBSXP_FavoriteUsers] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc"
Set Rs=Conn.Execute(sql)
do while not Rs.eof
Set Rs1=Conn.Execute("[BBSXP_Users] where UserName='"&Rs("FriendUserName")&"'")
if Rs1.eof then conn.Execute("delete from [BBSXP_FavoriteUsers] where FavoriteID="&Rs("FavoriteID")&"")
%>
><%=Rs1("UserName")%>
| ', 600, 350);"> |
<%=Rs1("TotalPosts")%> |
<%=Rs1("Experience")%>
| <%=Rs1("UserMoney")%>
| <%=Rs1("UserActivityTime")%> |
从好友列表中删除?')" href="?menu=DelFavoriteFriend&FriendUserName=<%=Rs1("UserName")%>"> |
<%
Set Rs1 = Nothing
Rs.movenext
loop
Rs.close
Set Rs = Nothing
%>
帖子收藏夹 |
<%
Set Rs=Conn.Execute("select * from [BBSXP_FavoriteThreads] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc")
Do While Not Rs.EOF
Set Rs1=Conn.Execute("select * from [BBSXP_Threads] where ThreadID="&Rs("ThreadID")&"")
if Rs1.eof then conn.Execute("delete from [BBSXP_FavoriteThreads] where ThreadID="&Rs("ThreadID")&"")
%>
" target=_blank><%=Rs1("Topic")%> |
" target="_blank"><%=Rs1("PostAuthor")%> <%=FormatDateTime(Rs1("PostTime"),2)%> |
<%=Rs1("TotalReplies")%> |
<%=Rs1("TotalViews")%> |
<%=Rs1("LastTime")%> by " target="_blank"><%=Rs1("LastName")%> |
"> |
<%
Set Rs1 = Nothing
Rs.MoveNext
loop
Set Rs = Nothing
%>
论坛收藏夹 |
<%
Set Rs=Conn.Execute("select * from [BBSXP_FavoriteForums] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc")
Do While Not Rs.EOF
Set Rs1=Conn.Execute("select * from [BBSXP_Forums] where ForumID="&Rs("ForumID")&"")
if Rs1.eof then conn.Execute("delete from [BBSXP_FavoriteForums] where ForumID="&Rs("ForumID")&"")
%>
" target=_blank><%=Rs1("ForumName")%> |
<%=YbbEncode(Rs1("ForumDescription"))%> |
"> |
<%
Set Rs1 = Nothing
Rs.MoveNext
loop
Rs.close
%>
<%
End Sub
HtmlBottom
%>