classforum.asp
来自「依蓝旅游网站管理系统Elan2008.SP2」· ASP 代码 · 共 1,287 行 · 第 1/5 页
ASP
1,287 行
Icon_Hot = EL_Common.Lang("Forum.TopicStatus.Hot", "")
Icon_Elite = EL_Common.Lang("Forum.TopicStatus.Elite", "")
Icon_Vote = EL_Common.Lang("Forum.TopicStatus.Vote", "")
TopicLength = EL_Common.ELClng(EL_Common.Lang("Forum.TopicLength", 100))
ReplyPageSizes = EL_Common.Lang("Forum.ReplyPageSizes", 10)
ReturnString = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='topic_list_tb'>"
ReturnString = ReturnString &"<tr class='topic_list_mt'>"
ReturnString = ReturnString &"<td class='topic_list_mt_status'>"& Topic_Status &"</td>"
ReturnString = ReturnString &"<td class='topic_list_mt_title'>"& Topic_Title &"</td>"
ReturnString = ReturnString &"<td class='topic_list_mt_author'>"& Topic_Author &"</td>"
ReturnString = ReturnString &"<td class='topic_list_mt_lastpost'>"& Topic_LastPost &"</td>"
ReturnString = ReturnString &"</tr>"
rsSearch.Open()
For i = 1 To RowCount
BoardID = rsSearch("BoardID")
ParentID = rsSearch("ParentID")
TopicID = rsSearch("TopicID")
Title = rsSearch("Title")
TopicType = rsSearch("TopicType")
UserID = rsSearch("UserID")
UserName = rsSearch("UserName")
Color = rsSearch("Color")
Uploadfiles = rsSearch("Uploadfiles")
IsElite = rsSearch("IsElite")
IsHot = rsSearch("IsHot")
Hits = rsSearch("Hits")
Replys = rsSearch("Replys")
PostDateTime = rsSearch("PostDateTime")
LastPostUser = rsSearch("LastPostUser")
LastPostTime = rsSearch("LastPostTime")
URL = ""
If ParentID = 0 Then
URL = InstallDir & EL_Channel.ChannelDir &"/ShowTopic.asp?BoardID="& BoardID &"&TopicID="& TopicID
Else
ParentReplys = EL_Common.GetFieldValue("COUNT(TopicID)", "EL_ForumTopic", "ChannelID="& ChannelID &" AND BoardID="& BoardID &" AND Deleted="& EL_False &" AND ParentID="& ParentID &" AND PostDateTime<='"& PostDateTime &"'")
If ParentReplys > ReplyPageSizes Then
PageNum = ParentReplys / ReplyPageSizes
If PageNum > Int(PageNum) Then
PageNum = Int(PageNum) + 1
Else
PageNum = Int(PageNum)
End If
Else
PageNum = 1
End If
URL = InstallDir & EL_Channel.ChannelDir &"/ShowTopic.asp?BoardID="& BoardID &"&TopicID="& ParentID &"&page="& PageNum &"#"& TopicID
End If
ReturnString = ReturnString &"<tr class='topic_list_tr' onmouseover=""this.className='topic_list_over'"" onmouseout=""this.className='topic_list_tr'"">"
ReturnString = ReturnString &"<td class='topic_list_icon'>"
ReturnString = ReturnString &"<a href='"& URL &"' target='_blank'>"
If TopicType = 1 Then
ReturnString = ReturnString & Icon_Vote
Else
If IsElite = True Then
ReturnString = ReturnString & Icon_Elite
Else
If IsHot = True Then
ReturnString = ReturnString & Icon_Hot
Else
If DateDiff("n", DateAdd("n", -12*60, LastPostTime), Now())>0 And Replys>0 Then
ReturnString = ReturnString & Icon_New
Else
ReturnString = ReturnString & Icon_Common
End If
End If
End If
End If
ReturnString = ReturnString &"</a></td>"
ReturnString = ReturnString &"<td class='topic_list_title'>"
ReturnString = ReturnString &"<a href='"& URL &"'>"
If Color <> "" Then
ReturnString = ReturnString &"<span style='color:"& Color &"'>"& EL_Common.GetTopic(Title, TopicLength) &"</span>"
Else
ReturnString = ReturnString & EL_Common.GetTopic(Title, TopicLength)
End If
ReturnString = ReturnString &"</a>"
If Uploadfiles <> "" Then
FileType = Split(Uploadfiles, "|")(0)
FileType = Split(FileType, ".")(1)
ReturnString = ReturnString &" "& EL_Common.Lang("BaseConfig.FileType."& UCase(FileType), "")
End If
ReturnString = ReturnString &"<td class='topic_list_author'>"
ReturnString = ReturnString &"<cite><a href='"& InstallDir &"User/ShowUser.asp?UserID="& UserID &"'>"& EL_Common.ServerHTMLEncode(UserName) &"</a></cite>"
ReturnString = ReturnString &"</td>"
ReturnString = ReturnString &"<td class='topic_list_lastpost'>"
ReturnString = ReturnString &"<em>"& LastPostTime &"</em>"
ReturnString = ReturnString &"</td>"
ReturnString = ReturnString &"</tr>"
If i<RowCount Then rsSearch.MoveNext
Next
ReturnString = ReturnString &"</table>"
StrPage = GetBoardPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, EL_Channel.ItemName, EL_Channel.ItemUnit)
rsSearch.Close()
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$SearchResult}", ReturnString)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPage}", StrPage)
Set rsSearch = Nothing
Set SearchCmd = Nothing
End If
Session("EL_LastSearchDateTime") = Now()
Response.Write HTML
End Sub
Public Sub Setting()
If CheckComeURL = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
Exit Sub
End If
If EL_User.UserIsLogin = False Then
Response.Redirect InstallDir &"User/User_Login.asp?url="& EL_Common.ServerURLEncode(ComeURL)
End If
Dim SettingCmd, EL_Board
Dim TopicID, ToBoardID, UpdateType, SetAction
TopicID = EL_Common.ELRequest("TopicID", 2)
ToBoardID = EL_Common.ELRequest("ToBoardID", 2)
SetAction = EL_Common.ELRequest("SetAction", 1)
Set EL_Board = New ClassBoard
If EL_Board.ErrorCode = 1 Then
Set EL_Board = Nothing
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error1", "指定"& EL_Channel.ClassItemName &"不存在或已被禁用"))
Exit Sub
End If
'判断权限
If EL_User.BoardSuperManager = False Then
If EL_User.IsBoardManager = True Then
If EL_Board.ParentID = 0 Then
If EL_Common.FoundInArray(Split(EL_User.ArrManageBoardID, "$"), EL_Board.BoardID &"|"& EL_Board.BoardName) = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error9", "对不起,您没有足够的管理权限"))
Set EL_Board = Nothing
Exit Sub
End If
Else
Dim ParentBoardName
ParentBoardName = EL_Common.GetFieldValue("BoardName", "EL_ForumBoard", "ChannelID="& ChannelID &" And BoardID="& EL_Board.ParentID)
If EL_Common.FoundInArray(Split(EL_User.ArrManageBoardID, "$"), EL_Board.ParentID &"|"& ParentBoardName) = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error9", "对不起,您没有足够的管理权限"))
Set EL_Board = Nothing
Exit Sub
End If
End If
Else
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error9", "对不起,您没有足够的管理权限"))
Set EL_Board = Nothing
Exit Sub
End If
End If
Dim StrPath, SettingHTML, Title, Author, PostDateTime, ParentID, Replys
Dim ArrData, Setting_Title, Setting_TypeName, Message
ArrData = EL_Common.GetFieldValue("TopicID,Title,UserName,PostDateTime,ParentID,Replys", "EL_ForumTopic", "ChannelID="& ChannelID &" AND BoardID="& EL_Board.BoardID &" AND TopicID="& TopicID)
If ArrData(0) <> TopicID Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error2", "指定帖子不存在或已被管理员删除"))
Set EL_Board = Nothing
Exit Sub
End If
Title = ArrData(1)
Author = ArrData(2)
PostDateTime = ArrData(3)
ParentID = ArrData(4)
Replys = ArrData(5)
If SetAction = "Save" Then
Dim LogText, Info, SetReason
SetReason = EL_Common.ELRequest("SetReason", 1)
Message = EL_Common.ELRequest("Message", 1)
Select Case Action
Case "Delete": UpdateType = 0 : LogText = "删除帖子"
Case "Lock": UpdateType = 1 : LogText = "屏蔽帖子"
Case "Up": UpdateType = 2 : LogText = "提升帖子"
Case "Down": UpdateType = 3 : LogText = "沉底帖子"
Case "Elite": UpdateType = 4 : LogText = "精华帖子"
Case "Top": UpdateType = 5 : LogText = "版面置顶帖子"
Case "AllTop": UpdateType = 6 : LogText = "全站置顶帖子"
Case "Move": UpdateType = 7 : LogText = "移动帖子"
End Select
Call EL_Common.InitCommand(SettingCmd, "EL_SP_TopicSetting")
With SettingCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, UpdateType)
.Parameters.Append .CreateParameter("@TopicID", 3, 1, 4, TopicID)
.Parameters.Append .CreateParameter("@BoardID", 3, 1, 4, EL_Board.BoardID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@ToBoardID", 3, 1, 4, ToBoardID)
.Parameters.Append .CreateParameter("@Message", 200, 1, 500, Message)
.Execute()
End With
Select Case SettingCmd(0)
Case 40:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error1", "指定"& EL_Channel.ClassItemName &"不存在或已被禁用"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 41:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error2", "指定帖子不存在或已被管理员删除"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 42:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error10", "指定目标"& EL_Channel.ClassItemName &"不存在或已被禁用"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 50:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error12", "指定帖子已经删除,不能对已删除帖子进行重复操作"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 51:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error13", "指定帖子已经屏蔽,不能对已屏蔽帖子进行重复操作"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 54:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error14", "指定帖子已经为精华帖,不能对已为精华帖进行重复操作"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 55:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error15", "指定帖子已经是版面固顶,不能对已固顶帖子进行重复操作"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
Case 56:
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error16", "指定帖子已经是全站固顶,不能对已全站固顶帖子进行重复操作"))
Set SettingCmd = Nothing
Set EL_Board = Nothing
Exit Sub
End Select
Set SettingCmd = Nothing
Info = ""
Info = Info &"帖子ID:"& TopicID & VBCRLF
Info = Info &"帖子主题:"& Title & VBCRLF
Info = Info &"帖子作者:"& Author & VBCRLF
Info = Info &"帖子发表日期:"& PostDateTime & VBCRLF
Info = Info &"操作原因:"& SetReason
Call InsertLog(4, ComeURL, LogText, Info, EL_User.UserName)
If Action = "Delete" Then
Dim TempParentID
TempParentID = EL_Common.GetFieldValue("ParentID", "EL_ForumTopic", "TopicID="& TopicID)
If TempParentID <> 0 Then
TopicID = TempParentID
End If
End If
If Action <> "Move" Then ToBoardID = EL_Board.BoardID
Response.Redirect "TopicSetting.asp?Action=Success&BoardID="& ToBoardID &"&TopicID="& TopicID
End If
Setting_Title = EL_Common.Lang("Forum.TopicSetting.Title", "帖子管理")
Message = EL_Common.Lang("Forum.TopicSetting.Message", "")
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?