📄 user_forum.asp
字号:
<%
Option Explicit
Response.buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="../Inc/Const.asp"-->
<!--#Include File="User_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="User_Style.css" type="text/css" rel="stylesheet">
<script language="javascript" src="../Js/Common.js"></script>
<title>我的社区</title>
</head>
<body>
<%
Dim CurrentPath, CurrentPage, URLParameters, Search_Keywords, Search_Field
CurrentPage = EL_Common.ELRequest("page", 2)
Search_Keywords = EL_Common.ELRequest("Search_Keywords", 3)
Search_Field = EL_Common.ELRequest("Search_Field", 3)
URLParameters = request.ServerVariables("QUERY_STRING")
If CurrentPage<1 Then
CurrentPage = 1
Else
URLParameters = EL_Common.ReplaceText(URLParameters, "&*page=[0-9]*", "")
End If
CurrentPath = "·您现在的位置:<a href='User_MyInfo.asp'>我的资料</a>"
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" background="Images/navbg.gif"><img src="Images/navtitle.gif" width="113" height="37"></td>
<td width="87%" background="Images/navbg.gif">| <a href="User_Forum.asp" class="nav">我的社区</a> | <a href="User_Forum.asp?Action=MyTopic" class="nav">我发表的主题</a> | <a href="User_Forum.asp?Action=AttachTopic" class="nav">我参与的主题</a> | <a href="User_Forum.asp?Action=AllTopic" class="nav">我的所有帖子</a> | <a href="User_Forum.asp?Action=Elite" class="nav">我的精华帖子</a> |</td>
</tr>
</table>
<div class="dw">
<%
Select Case Action
Case "": Call Main()
Case Else: Call TopicList()
End Select
Call ApplicationTerminate()
Sub TopicList()
On Error Resume Next
Dim TopicCmd, rsTopic, i
Dim RowCount, TotalRowCount, PageCounts
Dim SQLTables, SQLFields, SQLCondition, SQLOrder, SQL, PageSizes
Dim BoardID
PageSizes = 20
BoardID = EL_Common.ELRequest("BoardID", 2)
SQLTables = "EL_ForumTopic,EL_ForumBoard"
SQLFields = "EL_ForumTopic.TopicID,EL_ForumTopic.BoardID,EL_ForumTopic.ParentID,EL_ForumTopic.Title,EL_ForumTopic.UserID,EL_ForumTopic.UserName,EL_ForumTopic.OnTop,EL_ForumTopic.IsHot,EL_ForumTopic.IsElite,EL_ForumTopic.Replys,EL_ForumTopic.PostDateTime,EL_ForumBoard.BoardName"
SQLCondition = "EL_ForumTopic.BoardID=EL_ForumBoard.BoardID AND EL_ForumTopic.Deleted="& EL_False &" "
SQLOrder = "EL_ForumTopic.PostDateTime DESC"
If BoardID > 0 Then SQLCondition = SQLCondition &" AND EL_ForumTopic.BoardID="& BoardID &" "
Select Case Action
Case "MyTopic": SQLCondition = SQLCondition &" And EL_ForumTopic.UserID="& EL_User.UserID &" And EL_ForumTopic.UserName='"& EL_User.UserName &"' And EL_ForumTopic.ParentID=0 "
Case "AttachTopic":
SQLCondition = SQLCondition &" And (TopicID IN(SELECT ParentID FROM EL_ForumTopic WHERE ParentID<>0 And UserID="& EL_User.UserID &" And UserName='"& EL_User.UserName &"') OR (EL_ForumTopic.ParentID=0 AND EL_ForumTopic.UserName='"& EL_User.UserName &"' And EL_ForumTopic.ParentID=0))"
Case "AllTopic": SQLCondition = SQLCondition &" And EL_ForumTopic.UserID="& EL_User.UserID &" And EL_ForumTopic.UserName='"& EL_User.UserName &"' "
Case "Elite": SQLCondition = SQLCondition &" And EL_ForumTopic.UserID="& EL_User.UserID &" And EL_ForumTopic.UserName='"& EL_User.UserName &"' And EL_ForumTopic.IsElite="& EL_True
Case ELse:
EL_Common.ShowErrorMsg("页面参数错误")
Exit Sub
End Select
If Search_Keywords<>"" And Search_Field<>"" Then
SQLCondition = SQLCondition &"And EL_ForumTopic."& Search_Field &" Like '%"& Search_Keywords &"%' "
End If
Call EL_Common.InitCommand(TopicCmd, "EL_SP_SplitPage")
With TopicCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, SQLTables)
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 50, "EL_ForumTopic.TopicID")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, SQLOrder)
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, SQLFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, SQLCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsTopic = .Execute()
End With
rsTopic.Close()
RowCount = TopicCmd(0)
TotalRowCount = TopicCmd(9)
PageCounts = TopicCmd(10)
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<%
Select Case Action
Case "MyTopic": Response.Write "·我的发表主题"
Case "AttachTopic": Response.Write "·我的参与主题"
Case "AllTopic": Response.Write "·我的所有帖子"
Case "Elite": Response.Write "·我的精华帖子"
End Select
%>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="7%" align="center" class="top_Item"><strong>ID</strong></td>
<td width="16%" align="center" class="top_Item"><strong>所属版面</strong></td>
<td width="60%" align="center" class="top_Item"><strong>标题</strong></td>
<td width="17%" align="center" class="top_Item"><strong>发表日期</strong></td>
</tr>
<%
If RowCount = 0 Then
Response.Write "<tr><td colspan=4 class='td_50' align=center>没有任何帖子</td></tr>"
Else
rsTopic.Open()
Dim ReplyPageSizes, PageNum, Replys, URL
ReplyPageSizes = EL_Common.Lang("Forum.ReplyPageSizes", 10)
For i = 1 To RowCount
Replys = rsTopic("Replys")
If Replys > ReplyPageSizes Then
PageNum = Replys / ReplyPageSizes
If PageNum > Int(PageNum) Then
PageNum = Int(PageNum) + 1
Else
PageNum = Int(PageNum)
End If
Else
PageNum = 1
End If
If rsTopic("ParentID") = 0 Then
URL = InstallDir &"Forum/ShowTopic.asp?BoardID="& rsTopic("BoardID") &"&TopicID="& rsTopic("TopicID")
Else
URL = InstallDir &"Forum/ShowTopic.asp?BoardID="& rsTopic("BoardID") &"&TopicID="& rsTopic("ParentID") &"&page="& PageNum &"#"& rsTopic("TopicID")
End If
%>
<tr class="td_22" onMouseOut="this.className='td_22'" onMouseOver="this.className='MouseOver_22'">
<td align="center"><%=rsTopic("TopicID")%></td>
<td align="center"><a href="<%=InstallDir%>Forum/ShowBoard.asp?BoardID=<%=rsTopic("BoardID")%>" target="_blank"><%=rsTopic("BoardName")%></a></td>
<td style="padding-left:5px;"><a href="<%=URL%>" target="_blank"><%=EL_Common.ServerHTMLEncode(rsTopic("Title"))%></a></td>
<td align="center"><%=rsTopic("PostDateTime")%></td>
</tr>
<%
If i < RowCount Then rsTopic.MoveNext
Next
rsTopic.Close()
End If
%>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%=EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "帖子", "篇")%></td>
</tr>
</table>
<%
Set rsTopic = Nothing
Set TopicCmd = Nothing
EL_Common.ShowScriptError()
End Sub
Sub Main()
On Error Resume Next
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td colspan="4" class="top_26"><strong>我的社区</strong></td>
</tr>
<tr>
<td width="15%" align="right" class="td_ItemName">发帖权限:</td>
<td width="31%" class="td_item_22"><%=EL_Common.ShowBoolean(EL_User.EnablePost, "是", "否")%></td>
<td width="12%" align="right" class="td_ItemName">论坛<%=ExpItemName%>:</td>
<td width="42%" class="td_item_22"><%=EL_User.Exps%></td>
</tr>
<tr>
<td align="right" class="td_ItemName">发帖总数:</td>
<td class="td_item_22"><%=EL_User.PostCount%></td>
<td align="right" class="td_ItemName">精华帖子数:</td>
<td class="td_item_22"><%=EL_User.EliteCount%></td>
</tr>
<tr>
<td align="right" class="td_ItemName">被删除帖子数:</td>
<td colspan="3" class="td_item_22"><%=EL_User.DeleteCount%></td>
</tr>
<tr>
<td align="right" class="td_ItemName">论坛头衔:</td>
<td class="td_item_22"><%=EL_User.ForumLevel%></td>
<td align="right" class="td_ItemName">头衔图示:</td>
<td class="td_item_22"><img src="<%=InstallDir &"Forum/Level/"& EL_User.LeveLPictrue%>" border="0" /></td>
</tr>
<tr>
<td height="25" align="right" class="td_ItemName">管理的版面:</td>
<td colspan="3" class="td_item_22">
<%
If EL_User.BoardSuperManager Then
Response.Write "所有"
Else
Dim temp, i, arr
If EL_User.ArrManageBoardID <> "" And Not ISNULL(EL_User.ArrManageBoardID) Then
Temp = Split(EL_User.ArrManageBoardID, "$")
For i = 0 To Ubound(Temp)
arr = Split(Temp, "|")
If IsArray(arr) And Ubound(arr)=1 Then
Response.Write "<a href='"& InstallDir &"Forum/ShowBoard.asp?BoardID="& arr(0) &"' target='_blank'>"& arr(1) &"</a> "
End If
Next
End If
End If
%></td>
</tr>
<tr>
<td colspan="4" align="center" class="td_50"><input type="button" name="Submit" value="我发表的主题" onClick="location.href='User_Forum.asp?Action=MyTopic'">
<input type="button" name="Submit2" value="我参与的主题" onClick="location.href='User_Forum.asp?Action=AttachTopic'">
<input type="button" name="Submit3" value="我的所有帖子" onClick="location.href='User_Forum.asp?Action=AllTopic'">
<input type="button" name="Submit4" value="我的精华帖子" onClick="location.href='User_Forum.asp?Action=Elite'"></td>
</tr>
</table>
<%
EL_Common.ShowScriptError()
End Sub
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -