⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myfavorites.asp

📁 秘密网源代码 传闻拉了 100W风投
💻 ASP
字号:
<!-- #include file="Setup.asp" -->
<%

if CookieUserName=empty then error("您还未<a href=Login.asp?ReturnUrl="&ReturnUrl&">登录</a>")
if ReturnUrl="" then ReturnUrl="group.asp"

FavoriteID=RequestInt("FavoriteID")
ThreadID=RequestInt("ThreadID")
ForumID=RequestInt("ForumID")
DigID=RequestInt("DigID")
FriendUserName=HTMLEncode(Request("FriendUserName"))

HtmlTop
TotalFavoriteThread=conn.Execute("Select count(FavoriteID) From [Wo_FavoriteThreads] where OwnerUserName='"&CookieUserName&"'")(0)
TotalFavoriteForums=conn.Execute("Select count(FavoriteID) From [Wo_FavoriteForums] where OwnerUserName='"&CookieUserName&"'")(0)
TotalFavoriteFriend=conn.Execute("Select count(FavoriteID) From [Wo_FavoriteUsers] where OwnerUserName='"&CookieUserName&"'")(0)
TotalFavoriteDig=conn.Execute("Select count(FavoriteID) From [Wo_FavoriteDigs] 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 [Wo_Users] where UserName='"&FriendUserName&"'").eof then error("系统中没有 "&FriendUserName&" 的资料!")

		Rs.Open "select * from [Wo_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 [Wo_Threads] where ThreadID="&ThreadID&"").eof then error("系统中没有ID为 "&ThreadID&" 的主题!")

		Rs.Open "select * from [Wo_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 [Wo_Forums] where ForumID="&ForumID&"").eof then error("系统中没有ID为 "&ForumID&" 的群组!")

		Rs.Open "select * from [Wo_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 "FavoriteDig"
		if TotalFavoriteDig>20 then error("DIG收藏夹最多只能添加 20 条数据!")
		if Conn.Execute("select Src_ID from [Wo_Source] where Src_ID="&DigID&"").eof then error("系统中没有ID为 "&DigID&" 的文章!")

		Rs.Open "select * from [Wo_FavoriteDigs] where OwnerUserName='"&CookieUserName&"' and DigSourceID="&DigID&"",Conn,1,3
		if Rs.eof then Rs.addNew
			Rs("OwnerUserName")=CookieUserName
			Rs("DigSourceID")=DigID
		Rs.update
		Rs.close
		succeed "添加成功",""
	case "DelFavoriteDigs"
		conn.Execute("delete from [Wo_FavoriteDigs] where OwnerUserName='"&CookieUserName&"' and FavoriteID="&FavoriteID&"")
		succeed "删除成功",""
		
	case "DelFavoriteForums"
		conn.Execute("delete from [Wo_FavoriteForums] where OwnerUserName='"&CookieUserName&"' and FavoriteID="&FavoriteID&"")
		succeed "删除成功",""
				
	case "DelFavoriteThreads"
		conn.Execute("delete from [Wo_FavoriteThreads] where OwnerUserName='"&CookieUserName&"' and FavoriteID="&FavoriteID&"")
		succeed "删除成功",""
		
	case "DelFavoriteFriend"
		conn.Execute("delete from [Wo_FavoriteUsers] where OwnerUserName='"&CookieUserName&"' and FriendUserName='"&FriendUserName&"'")
		succeed "删除成功",""
	case else
		default
	end select
Sub Default
%>
<table width="900" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><div id="CommonBreadCrumbArea"><%ClubTree%> → 收藏夹</div></td>
  </tr>
</table>
<table cellspacing=1 cellpadding=0 width=900 id=CommonListArea align="center">
	<TR id=CommonListTitle3 align="center">
		<TD><a href="EditProfile.asp">资料修改</a></td>
		<TD><a href="EditProfile.asp?menu=pass">密码修改</a></td>
		<TD><a href="MyUpFiles.asp">上传管理</a></td>
		<TD><a href="MyFavorites.asp">收 藏 夹</a></td>
		<TD><a href="MyMessage.asp">短信服务</a></td>
	</TR>
</TABLE>
<br>

<table cellspacing="1" cellpadding="0" width=900 id=CommonListArea align="center">
	<tr id="CommonListTitle3"><td colspan=7>&nbsp;&nbsp;好友列表</td></tr>
	<tr id="CommonListHeader" align="center" height="25">
		<td>窝友名</td>
		<td width="10%">发短信</td>
		<td width="10%">主题数</td>
		<td width="10%">经验</td>
		<td width="10%">积分</td>
		<td width="25%">最近活动</td>
		<td width="10%">动作</td>
	</tr>
<%

	sql="select * from [Wo_FavoriteUsers] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc"
	Set Rs=Conn.Execute(sql)
	do while not Rs.eof
		Set Rs1=Conn.Execute("[Wo_Users] where UserName='"&Rs("FriendUserName")&"'")
		if Rs1.eof then conn.Execute("delete from [Wo_FavoriteUsers] where FavoriteID="&Rs("FavoriteID")&"")

%>
	<tr align=center id="CommonListCell" height="25">
		<td vAlign=center><a target="wh" href=Profile.asp?UserName=<%=Rs1("UserName")%>><%=Rs1("UserName")%></a>
		<td><a onclick="javascript:Wo_Modal.Open('MyMessage.asp?menu=Post&RecipientUserName=<%=Rs1("UserName")%>', 600, 350);"><img border="0" src="Images/message.gif"></a></td>
		<td><%=Rs1("TotalPosts")%></td>
		<td><%=Rs1("Experience")%></a>
		<td><%=Rs1("UserMoney")%></a>
		<td><%=Rs1("UserActivityTime")%></td>
		<td><a onclick="return window.confirm('确实要将 <%=Rs1("UserName")%> 从好友列表中删除?')" href="?menu=DelFavoriteFriend&FriendUserName=<%=Rs1("UserName")%>"><img src=images/delete.gif border=0></a></td>
	</tr>
<%
	Set Rs1 = Nothing
	Rs.movenext
	loop
	Rs.close
	Set Rs = Nothing
%>

</table>

<br>
<table cellspacing="1" cellpadding="0" width="900" id=CommonListArea align="center">
	<tr id="CommonListTitle3"><td colspan=7>&nbsp;&nbsp;关注您的窝友</td></tr>
	<tr id="CommonListHeader" align="center" height="25">
		<td>窝友名</td>
		<td width="10%">发短信</td>
		<td width="10%">主题数</td>
		<td width="10%">经验</td>
		<td width="10%">积分</td>
		<td width="25%">最近活动</td>
		<td width="10%">动作</td>
	</tr>
	</tr>
<%
	sql="select * from [Wo_FavoriteUsers] where FriendUserName='"&CookieUserName&"' order by FavoriteID desc"
	Set Rs=Conn.Execute(sql)
	do while not Rs.eof
		Set Rs1=Conn.Execute("[Wo_Users] where UserName='"&Rs("OwnerUserName")&"'")
%>
	<tr align=center id="CommonListCell" height="25">
		<td vAlign=center><a target="wh" href=Profile.asp?UserName=<%=Rs1("UserName")%>><%=Rs1("UserName")%></a>
		<td><a onclick="javascript:Wo_Modal.Open('MyMessage.asp?menu=Post&RecipientUserName=<%=Rs1("UserName")%>', 600, 350);"><img border="0" src="Images/message.gif"></a></td>
		<td><%=Rs1("TotalPosts")%></td>
		<td><%=Rs1("Experience")%></a>
		<td><%=Rs1("UserMoney")%></a>
		<td><%=Rs1("UserActivityTime")%></td>
		<td><a title="将 <%=RS1("UserName")%> 加为好友" href="MyFavorites.asp?menu=FavoriteFriend&FriendUserName=<%=Rs1("UserName")%>"><img src=images/favs.gif border=0></a></td>
	</tr>
<%
		Set Rs1 = Nothing
		Rs.movenext
	loop
	Rs.close
	Set Rs = Nothing
%>
</table>

<br>
<table cellspacing="1" cellpadding="0" width="900" id=CommonListArea align="center">
	<tr id="CommonListTitle3"><td colspan=6>&nbsp;&nbsp;主题收藏夹</td></tr>
	<tr align="center" id="CommonListHeader" height="25">
		<td width="40%">主题</td>
		<td width="10%">作者</td>
		<td width="10%">回复</td>
		<td width="10%">查看</td>
		<td>最后更新</td>
		<td width="10%">动作</td>
	</tr>
<%
Set Rs=Conn.Execute("select * from [Wo_FavoriteThreads] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc")
Do While Not Rs.EOF
	Set Rs1=Conn.Execute("select * from [Wo_Threads] where ThreadID="&Rs("ThreadID")&"")
	if Rs1.eof then conn.Execute("delete from [Wo_FavoriteThreads] where ThreadID="&Rs("ThreadID")&"")
%>
	<tr id="CommonListCell" height="25">
		<td><a href="ShowPost.asp?ThreadID=<%=Rs1("ThreadID")%>" target=wh><%=Rs1("Topic")%></a></td>
		<td align=center><a href="Profile.asp?UserName=<%=Rs1("PostAuthor")%>" target="wh"><%=Rs1("PostAuthor")%></a><br><%=FormatDateTime(Rs1("PostTime"),2)%></td>
		<td align=center><%=Rs1("TotalReplies")%></td>
		<td align=center><%=Rs1("TotalViews")%></td>
		<td align=center><%=Rs1("LastTime")%><br>by <a href="Profile.asp?UserName=<%=Rs1("LastName")%>" target="wh"><%=Rs1("LastName")%></a></td>
		<td align=center><a onclick="return window.confirm('您确定要删除该链接?')" href="?menu=DelFavoriteThreads&FavoriteID=<%=Rs("FavoriteID")%>"><img src=images/delete.gif border=0></a></td>
	</tr>
<%
	Set Rs1 = Nothing
Rs.MoveNext
loop
Set Rs = Nothing
%>
</table>
<br>
<table cellspacing="1" cellpadding="0" width="900" id=CommonListArea align="center">
	<tr id="CommonListTitle3"><td colspan=6>&nbsp;&nbsp;Dig文章收藏夹</td></tr>
	<tr align="center" id="CommonListHeader" height="25">
		<td width="40%">标题</td>
		<td width="10%">作者</td>
		<td width="10%">评论</td>
		<td width="10%">查看</td>
		<td width="10%">动作</td>
	</tr>
<%
Set Rs=Conn.Execute("select * from [Wo_FavoriteDigs] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc")
Do While Not Rs.EOF
	Set Rs1=Conn.Execute("select * from [Wo_source] where Src_ID="&Rs("DigSourceID")&"")
	if Rs1.eof then conn.Execute("delete from [Wo_FavoriteDigs] where DigSourceID="&Rs("DigSourceID")&"")
%>
	<tr id="CommonListCell" height="25">
		<td><a href="show.asp?Src_ID=<%=Rs1("Src_ID")%>" target=wh><%=Rs1("Src_Title")%></a></td>
		<%set Rs33=Conn.Execute("select UserName from Wo_Users where UserID="&Rs1("Src_UserID")&"")
		if Rs33.eof then 
		Uname=""
		else
		Uname=Rs33("UserName")
		end if
		set rs33=nothing%>
		<td align=center><a href="Profile.asp?UserName=<%=Uname%>" target="wh"><%=Uname%></a><br><%=FormatDateTime(Rs1("Src_AddDate"),2)%></td>
		<td align=center><%=Rs1("Src_RevertNum")%></td>
		<td align=center><%=Rs1("Src_SeeNum")%></td>
		<td align=center><a onclick="return window.confirm('您确定要删除该链接?')" href="?menu=DelFavoriteDigs&FavoriteID=<%=Rs("FavoriteID")%>"><img src=images/delete.gif border=0></a></td>
	</tr>
<%
	Set Rs1 = Nothing
Rs.MoveNext
loop
Set Rs = Nothing
%>
</table>

<br>
<table cellspacing="1" cellpadding="0" width="900" id=CommonListArea align="center">
	<tr id="CommonListTitle3"><td colspan=3>&nbsp;&nbsp;群组收藏夹</td></tr>
	<tr id="CommonListHeader" align="center" height="25">
		<td width="30%">版块名称</td>
		<td>描述</td>
		<td width="10%">动作</td>
	</tr>
<%
Set Rs=Conn.Execute("select * from [Wo_FavoriteForums] where OwnerUserName='"&CookieUserName&"' order by FavoriteID desc")
Do While Not Rs.EOF

	Set Rs1=Conn.Execute("select * from [Wo_Forums] where ForumID="&Rs("ForumID")&"")
	if Rs1.eof then conn.Execute("delete from [Wo_FavoriteForums] where ForumID="&Rs("ForumID")&"")

%>
	<tr id="CommonListCell" height="25">
		<td><a href="ShowForum.asp?ForumID=<%=Rs1("ForumID")%>" target=wh><%=Rs1("ForumName")%></a></td>
		<td><%=YbbEncode(Rs1("ForumDescription"))%></td>
		<td align=center><a onclick="return window.confirm('您确定要删除该链接?')" href="?menu=DelFavoriteForums&FavoriteID=<%=Rs("FavoriteID")%>"><img src=images/delete.gif border=0></a></td>
	</tr>
<%
	Set Rs1 = Nothing
	
Rs.MoveNext
loop
Rs.close
%>
</table>
<%
End Sub
HtmlBottom
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -