classforum.asp
来自「依蓝旅游网站管理系统Elan2008.SP2」· ASP 代码 · 共 1,287 行 · 第 1/5 页
ASP
1,287 行
StrPath = EL_Common.Lang("BaseConfig.Path", " >> ")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"'>"& EL_Channel.ChannelName &"</a>"
If EL_Board.ParentID <> 0 Then
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowBoard.asp?BoardID="& EL_Board.ParentID &"'>"& EL_Board.ParentName &"</a>"
End If
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowBoard.asp?BoardID="& EL_Board.BoardID &"'>"& EL_Board.BoardName &"</a>"
If Action = "Reply" Or Action = "Quote" Then
EL_Common.ShowPath = EL_Common.ShowPath & StrPath & EL_Common.ServerHTMLEncode(Title)
Else
EL_Common.ShowPath = EL_Common.ShowPath & StrPath & ActionTitle
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ActionTitle}", ActionTitle)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_UserName}", "<input type='text' readonly=true value='"& EL_Common.ServerHTMLEncode(Form_UserName) &"' />")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_Class}", Label_Class())
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_Title}", "<input type='text' name='Title' id='Title' value='"& EL_Common.ServerHTMLEncode(Title) &"' size='60' />")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_TitleColor}", Label_TitleColor(Color))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_Icons}", Label_Icons(Icon))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_Editor}", Label_Editor(Content))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_Action}", Form_Action)
HTML = Label_Vote(HTML, TopicType, Action)
If EL_Board.EnableCheckCode = True Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_CheckCode}", "<input type='text' name='CheckCode' id='CheckCode' size='10' /> <img src='"& InstallDir &"Inc/CheckCode.asp?t="& Now() &"' style='cursor:pointer;' onClick=""this.src='"& InstallDir &"Inc/CheckCode.asp?t='+Math.random()"" />")
Else
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Form_CheckCode}", "")
End If
Set EL_Board = Nothing
Set EL_Topic = Nothing
Response.Write HTML
End Sub
Public Sub ShowTopic()
Dim EL_Board, EL_Topic, StrPath
Dim TopicCmd, rsTopic, i
Dim PageSizes, RowCount, TotalRowCount, PageCounts
Dim SQLTables, SQLFields, SQLCondition, SQLOrder, SQL
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
Set EL_Topic = New ClassTopic
EL_Topic.BoardID = EL_Board.BoardID
Call EL_Topic.GetTopicInfo()
If EL_Topic.ErrorCode = 1 Or EL_Topic.Deleted = True Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error2", "指定帖子不存在或已被管理员删除"))
Set EL_Board = Nothing
Set EL_Topic = Nothing
Exit Sub
End If
If EL_Topic.Locked = True Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Forum.Error8", "此帖已被管理屏蔽"))
Set EL_Board = Nothing
Set EL_Topic = Nothing
Exit Sub
End If
PageSizes = EL_Common.Lang("Forum.ReplyPageSizes", 10)
SQLTables = "EL_ForumTopic"
SQLFields = "TopicID,ParentID,Title,TopicType,UserID,UserName,Color,Icon,Content,Uploadfiles,PostDateTime,Locked,Editor,OnTop,IsHot,IsElite"
SQLCondition = "ChannelID="& ChannelID &" AND BoardID="& EL_Board.BoardID &" AND Deleted="& EL_False &" AND (TopicID="& EL_Topic.TopicID &" OR ParentID="& EL_Topic.TopicID &")"
SQLOrder = "ParentID ASC, PostDateTime ASC"
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, "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)
HTML = EL_Common.Template(ChannelID, 24, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(EL_Topic.Title, EL_Channel.ChannelName, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, EL_Board.BoardID, EL_Board.TopicSkinID))
StrPath = EL_Common.Lang("BaseConfig.Path", " >> ")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"'>"& EL_Channel.ChannelName &"</a>"
If EL_Board.ParentID <> 0 Then
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowBoard.asp?BoardID="& EL_Board.ParentID &"'>"& EL_Board.ParentName &"</a>"
End If
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowBoard.asp?BoardID="& EL_Board.BoardID &"'>"& EL_Board.BoardName &"</a>"
EL_Common.ShowPath = EL_Common.ShowPath & StrPath & EL_Common.Lang("Forum.ViewTopic", "浏览帖子")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
Dim TopicID, ParentID, Title, TopicType, UserID, UserName, Color, Icon, Content, Uploadfiles, PostDateTime, Locked, Editor, OnTop, IsHot, IsElite
Dim ListHTML, VoteHTML, Match, Matches, ItemHTML, MatchString
Dim TempListHTML, TempVoteHTML, SeatName, EditHint, StrEditor
Dim LockTopic, UserInfo, k
Dim Property_Top, Property_AllTop, Property_Hot, Property_Elite, PropertyString
CommonRegExp.Pattern = "\[TopicList\][\w\W]*\[\/TopicList\]"
Set Matches = CommonRegExp.Execute(HTML)
ListHTML = Matches(0)
CommonRegExp.Pattern = "\[Vote\][\w\W]*\[\/Vote\]"
Set Matches = CommonRegExp.Execute(HTML)
VoteHTML = Matches(0)
SeatName = EL_Common.Lang("Forum.SeatName", "#")
LockTopic = EL_Common.Lang("Forum.Error8", "此帖已被管理屏蔽")
EditHint = EL_Common.Lang("Forum.EditHint", "此帖由 {$UserName} 于 {$PostDateTime} 编辑过")
Property_Top = EL_Common.Lang("Forum.Property.Top", "版面置顶")
Property_AllTop = EL_Common.Lang("Forum.Property.AllTop", "全站置顶")
Property_Hot = EL_Common.Lang("Forum.Property.Hot", "热门")
Property_Elite = EL_Common.Lang("Forum.Property.Elite", "精华 ")
rsTopic.Open()
For i = 1 To RowCount
TopicID = rsTopic("TopicID")
ParentID = rsTopic("ParentID")
Title = EL_Common.ServerHTMLEncode(rsTopic("Title"))
TopicType = rsTopic("TopicType")
UserID = rsTopic("UserID")
UserName = rsTopic("UserName")
Color = rsTopic("Color")
Icon = rsTopic("Icon")
Content = rsTopic("Content")
Uploadfiles = rsTopic("Uploadfiles")
PostDateTime = rsTopic("PostDateTime")
Locked = rsTopic("Locked")
Editor = rsTopic("Editor")
OnTop = rsTopic("OnTop")
IsHot = rsTopic("IsHot")
IsElite = rsTopic("IsElite")
If Color <> "" Then
Title = "<span style='color:"& Color &"'>"& Title &"</span>"
End If
If ParentID = 0 Then
If TopicType = 0 Then
TempVoteHTML = ""
Else
TempVoteHTML = EL_Common.ReplaceText(VoteHTML, "\[Vote\]", "")
TempVoteHTML = EL_Common.ReplaceText(TempVoteHTML, "\[\/Vote\]", "")
TempVoteHTML = Label_ShowVote(TempVoteHTML, EL_Board.BoardID, EL_Topic.TopicID)
End If
End If
ItemHTML = ListHTML
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[TopicList\]", "")
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[\/TopicList\]", "")
If i = 1 Then
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[TopicTitle\]", "")
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[\/TopicTitle\]", "")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$TopicTitle}", EL_Topic.Title)
Else
CommonRegExp.Pattern = "\[TopicTitle\][\w\W]*\[\/TopicTitle\]"
Set Matches = CommonRegExp.Execute(ItemHTML)
For Each Match In Matches
ItemHTML = Replace(ItemHTML, Match.value, "")
Next
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$TopicID}", TopicID)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$UserName}", UserName)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$UserID}", UserID)
Call TopicUserInfo(ItemHTML, UserID)
If Locked = True Then
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Icon}", "")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Title}", "")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Content}", "<span style='color:#999999'>******** "& LockTopic &" ********</span>")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$FileList}", "")
Else
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Icon}", "<img src='"& InstallDir & EL_Channel.ChannelDir &"/face/"& Icon &".gif' border='0' />")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Title}", Title)
If Editor <> "" And Not ISNULL(Editor) Then
Dim ArrEditor, ArrTemp
ArrEditor = Split(Editor, "$")
StrEditor = ""
For k = 1 To Ubound(ArrEditor)
ArrTemp = Split(ArrEditor(k), "|")
StrEditor = StrEditor &"<p>"& EL_Common.RegExpStaticLabel(EditHint, "{$UserName}", ArrTemp(0)) &"</p>"
StrEditor = EL_Common.RegExpStaticLabel(StrEditor, "{$PostDateTime}", FormatDateTime(ArrTemp(1), 0))
Next
StrEditor = "<div class='view_editor'>"& StrEditor &"</div>"
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Content}", Content & StrEditor)
Else
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Content}", Content)
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$FileList}", FileList(Uploadfiles))
End If
PropertyString = ""
If OnTop = 2 Then
PropertyString = EL_Common.Join2String(PropertyString, Property_AllTop, " ")
ElseIf OnTop = 1 Then
PropertyString = EL_Common.Join2String(PropertyString, Property_Top, " ")
End If
If IsElite Then
PropertyString = EL_Common.Join2String(PropertyString, Property_Elite, " ")
End If
If IsHot Then
PropertyString = EL_Common.Join2String(PropertyString, Property_Hot, " ")
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$PostDateTime}", PostDateTime)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$TopicProperty}", PropertyString)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$SeatIndex}", (CurrentPage-1)*PageSizes+i & SeatName)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$TopicAction}", TopicAction(EL_Board.BoardID, TopicID))
TempListHTML = TempListHTML & ItemHTML
If i<RowCount Then rsTopic.MoveNext
Next
rsTopic.Close()
HTML = Replace(HTML, ListHTML, TempListHTML)
HTML = Replace(HTML, VoteHTML, TempVoteHTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BoardID}", EL_Board.BoardID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TopicID}", EL_Topic.TopicID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ViewNum}", EL_Topic.Hits)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPage}", GetBoardPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, EL_Channel.ItemName, EL_Channel.ItemUnit))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PrevAndNext}", GetPrevAndNext(EL_Board.BoardID, EL_Topic.TopicID))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$AdminAction}", AdminAction(EL_Board.BoardID, EL_Topic.TopicID))
CommonRegExp.Pattern = "\[ReplyForm\][\w\W]*\[\/ReplyForm\]"
Set Matches = CommonRegExp.Execute(HTML)
For Each Match In Matches
MatchString = Match.Value
If EL_User.UserIsLogin = True And EL_User.EnablePost = True Then
ItemHTML = MatchString
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[ReplyForm\]", "")
ItemHTML = EL_Common.ReplaceText(ItemHTML, "\[\/ReplyForm\]", "")
Dim Form_Action
Form_Action = "<input type='hidden' id='Action' name='Action' value='SaveReply' />"
Form_Action = Form_Action &"<input type='hidden' id='BoardID' name='BoardID' value='"& EL_Board.BoardID &"' />"
Form_Action = Form_Action &"<input type='hidden' id='TopicType' name='TopicType' value='0' />"
Form_Action = Form_Action &"<input type='hidden' id='TopicID' name='TopicID' value='"& EL_Topic.TopicID &"' />"
Form_Action = Form_Action &"<input type='hidden' id='Uploadfiles' name='Uploadfiles' value='' />"
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_UserName}", "<input type='text' readonly=true value='"& EL_Common.ServerHTMLEncode(EL_User.UserName) &"' />")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_Class}", Label_Class())
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_Title}", "<input type='text' name='Title' id='Title' value='"& EL_Common.ServerHTMLEncode(EL_Common.Lang("Forum.NewTopic.ReplyTitle", "RE:") & EL_Topic.Title) &"' size='60' />")
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_TitleColor}", Label_TitleColor(""))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_Icons}", Label_Icons(0))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_Editor}", Label_Editor(""))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_Action}", Form_Action)
If EL_Board.EnableCheckCode = True Then
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Form_CheckCode}", "<inp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?