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

📄 forum_topics.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		'1 = tblTopic.Poll_ID
		'2 = tblTopic.Moved_ID
		'3 = tblTopic.Subject
		'4 = tblTopic.Icon
		'5 = tblTopic.Start_Thread_ID
		'6 = tblTopic.Last_Thread_ID
		'7 = tblTopic.No_of_replies
		'8 = tblTopic.No_of_views
		'9 = tblTopic.Locked
		'10 = tblTopic.Priority
		'11 = tblTopic.Hide
		'12 = tblThread.Message_date
		'13 = tblThread.Message,
		'14 = tblThread.Author_ID,
		'15 = tblAuthor.Username,
		'16 = LastThread.Message_date,
		'17 = LastThread.Author_ID,
		'18 = LastAuthor.Username
		'19 = tblTopic.Event_date
		'20 = tblTopic.Event_date_end

		'Read in Topic details from the database
		lngTopicID = CLng(sarryTopics(0,intCurrentRecord))
		lngPollID = CLng(sarryTopics(1,intCurrentRecord))
		intMovedForumID = CInt(sarryTopics(2,intCurrentRecord))
		strSubject = sarryTopics(3,intCurrentRecord)
		strTopicIcon = sarryTopics(4,intCurrentRecord)
		lngNumberOfReplies = CLng(sarryTopics(7,intCurrentRecord))
		lngNumberOfViews = CLng(sarryTopics(8,intCurrentRecord))
		blnTopicLocked = CBool(sarryTopics(9,intCurrentRecord))
		intPriority = CInt(sarryTopics(10,intCurrentRecord))
		blnHideTopic = CBool(sarryTopics(11,intCurrentRecord))
		dtmEventDate = sarryTopics(19,intCurrentRecord)
		dtmEventDateEnd = sarryTopics(20,intCurrentRecord)

		'Read in the first post details
		dtmFirstEntryDate = CDate(sarryTopics(12,intCurrentRecord))
		strFirstPostMsg = Mid(sarryTopics(13,intCurrentRecord), 1, 275)
		lngTopicStartUserID = CLng(sarryTopics(14,intCurrentRecord))
		strTopicStartUsername = sarryTopics(15,intCurrentRecord)

		'Read in the last post details
		lngLastEntryMessageID = CLng(sarryTopics(6,intCurrentRecord))
		dtmLastEntryDate = CDate(sarryTopics(16,intCurrentRecord))
		lngLastEntryUserID = CLng(sarryTopics(17,intCurrentRecord))
		strLastEntryUsername = sarryTopics(18,intCurrentRecord)
		

		'Clean up input to prevent XXS hack
		strSubject = formatInput(strSubject)

		'Remove HTML from message for subject link title
		strFirstPostMsg = removeHTML(strFirstPostMsg, 150, true)

		'Clean up input to prevent XXS hack
		strFirstPostMsg = formatInput(strFirstPostMsg)
		
		
		
		
		'Unread Posts *********
		intUnReadPostCount = 0
					
		'If there is a newer post than the last time the unread posts array was initilised run it again
		If dtmLastEntryDate > CDate(Session("dtmUnReadPostCheck")) Then Call UnreadPosts()
						
		'Count the number of unread posts in this forum
		If isArray(sarryUnReadPosts) AND dtmLastEntryDate > dtmLastVisitDate Then
			For intUnReadForumPostsLoop = 0 to UBound(sarryUnReadPosts,2)
				'Increament unread post count
				If CLng(sarryUnReadPosts(1,intUnReadForumPostsLoop)) = lngTopicID AND sarryUnReadPosts(3,intUnReadForumPostsLoop) = "1" Then intUnReadPostCount = intUnReadPostCount + 1
			Next	
		End If
		

		'Get a record number for the number of non priority posts
		If intPriority <= 1 Then intNonPriorityTopicNum = intNonPriorityTopicNum + 1

		'If this is the first topic that is not important then display the forum topics bar
		If intNonPriorityTopicNum = 1 Then Response.Write vbCrLf & "    <tr class=""tableSubLedger""><td colspan=""6"">" & strTxtForum & " " & strTxtTopics & "</td></tr>"

		'If this is the first topic and it is an important one then display a bar saying so
		If intCurrentRecord = 0 AND intPriority => 2 Then Response.Write vbCrLf & "<tr class=""tableSubLedger""><td colspan=""6"">" & strTxtAnnouncements & "</td></tr>"


		


		'Calculate the row colour
		If intCurrentRecord MOD 2=0 Then strTableRowColour = "evenTableRow" Else strTableRowColour = "oddTableRow"

		'If this is a hidden post then change the row colour to highlight it
		If blnHideTopic Then strTableRowColour = "hiddenTableRow"


		'Write the HTML of the Topic descriptions as hyperlinks to the Topic details and message
		Response.Write(vbCrLf & "  <tr class=""" & strTableRowColour & """>")

		
		'Display the status topic icons
		Response.Write(vbCrLf & "   <td align=""center"">")
		%><!-- #include file="includes/topic_status_icons_inc.asp" --><%
     		Response.Write("</td>")




     		Response.Write(vbCrLf & "   <td><div style=""float:left"">")
     	
		 'If the user is a forum admin or a moderator then give let them delete the topic
		 If blnAdmin  OR blnModerator Then 
		 	
		 	Response.Write("<span id=""modTools" & lngTopicID & """ onclick=""showDropDown('modTools" & lngTopicID & "', 'modToolsMenu" & lngTopicID & "', 120, 0);"" class=""dropDownPointer""><img src=""" & strImagePath & "moderator_tools." & strForumImageType & """ alt=""" & strTxtModeratorTools & """ title=""" & strTxtModeratorTools & """ /></span> " & _
			"<div id=""modToolsMenu" & lngTopicID & """ class=""dropDownStatusBar"">" & _
			"<a href=""javascript:winOpener('pop_up_topic_admin.asp?TID=" & lngTopicID & strQsSID2 & "','admin',1,1,600,285)""><div>" & strTxtTopicAdmin & "</div></a>")
			
			'Lock or un-lock forum if admin
			If blnTopicLocked Then
				Response.Write("<a href=""lock_topic.asp?mode=UnLock&amp;TID=" & lngTopicID & "&FID=" & intForumID & strQsSID2 & """><div>" & strTxtUnLockTopic & "</div></a>")
			Else
				Response.Write("<a href=""lock_topic.asp?mode=Lock&amp;TID=" & lngTopicID & "&FID=" & intForumID & strQsSID2 & """><div>" & strTxtLockTopic & "</div></a>")
			End If

			'Hide or show topic
			If blnHideTopic = false Then
				Response.Write("<a href=""lock_topic.asp?mode=Hide&amp;TID=" & lngTopicID & "&amp;FID=" & intForumID & strQsSID2 & """><div>" & strTxtHideTopic & "</div></a>")
			Else
				Response.Write("<a href=""lock_topic.asp?mode=Show&amp;TID=" & lngTopicID & "&amp;FID=" & intForumID & strQsSID2 & """><div>" & strTxtShowTopic & "</div></a>")
			End If
			
			Response.Write("<a href=""delete_topic.asp?TID=" & lngTopicID & "&amp;PN=" & intRecordPositionPageNum & strQsSID2 & """ onclick=""return confirm('" & strTxtDeleteTopicAlert & "')""><div>" & strTxtDeleteTopic & "</div></a>")
			Response.Write("</div>")
		 	
		End If
		
		
		
		'If topic icons enabled and we have a topic icon display it	
     		If blnTopicIcon AND strTopicIcon <> "" Then Response.Write("<img src=""" & strTopicIcon & """ alt=""" & strTxtMessageIcon & """ title=""" & strTxtMessageIcon & """ /> ")



		'Display the subject of the topic
		Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID)
		If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3")
		Response.Write("" & strQsSID2 & """ title=""" & strFirstPostMsg & """>" & strSubject & "</a>")
		
		'Display who started the topic and when
		Response.Write("<br /><span class=""smText"">" & strTxtBy & " <a href=""member_profile.asp?PF=" & lngTopicStartUserID & strQsSID2 & """  class=""smLink"" rel=""nofollow"">" & strTopicStartUsername & "</a>, " & DateFormat(dtmFirstEntryDate) & " " & strTxtAt & " " & TimeFormat(dtmFirstEntryDate) & "</span>" & _
		"</div>")



		 'Calculate the number of pages for the topic and display links if there are more than 1 page
		 intNumberOfTopicPages = ((lngNumberOfReplies + 1)\intThreadsPerPage)

		 'If there is a remainder from calculating the num of pages add 1 to the number of pages
		 If ((lngNumberOfReplies + 1) Mod intThreadsPerPage) > 0 Then intNumberOfTopicPages = intNumberOfTopicPages + 1

		 'If there is more than 1 page for the topic display links to the other pages
		 If intNumberOfTopicPages > 1 Then

		 	Response.Write("<div style=""float:right;""><img src=""" & strImagePath & "multiple_pages." & strForumImageType & """ alt=""" & strTxtMultiplePages & """ title=""" & strTxtMultiplePages & """ />")

		 	'Loop round to display the links to the other pages
		 	For intTopicPagesLoopCounter = 1 To intNumberOfTopicPages

		 		'If there is more than 3 pages display ... last page and exit the loop
		 		If intTopicPagesLoopCounter > 3 Then

		 			'If this is position 4 then display just the 4th page
		 			If intNumberOfTopicPages = 4 Then
		 				Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&amp;PN=4")
						'If a priority topic need to make sure we don't change forum
			 			If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3")
			 			Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " 4"">4</a>")

					'Else display the last 2 pages
					Else

						Response.Write("&nbsp;")

						Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&amp;PN=" & intNumberOfTopicPages - 1)
						'If a priority topic need to make sure we don't change forum
			 			If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3")
			 			Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intNumberOfTopicPages - 1 & """>" & intNumberOfTopicPages - 1 & "</a>")

			 			Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&amp;PN=" & intNumberOfTopicPages)
						'If a priority topic need to make sure we don't change forum
			 			If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3")
			 			Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intNumberOfTopicPages & """>" & intNumberOfTopicPages & "</a>")

					End If

					'Exit the loop as we are finshed here
		 			Exit For
		 		End If

		 		'Display the links to the other pages
		 		Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&amp;PN=" & intTopicPagesLoopCounter)

		 		'If a priority topic need to make sure we don't change forum
		 		If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3")
		 		Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intTopicPagesLoopCounter & """>" & intTopicPagesLoopCounter & "</a>")
		 	Next
		 	Response.Write("</div>")
		 End If
		  %></td>
   <td align="center"><% = lngNumberOfReplies %></td>
   <td align="center"><% = lngNumberOfViews %></td>
   <td class="smText" nowrap="nowrap"><% = strTxtBy %> <a href="member_profile.asp?PF=<% = lngLastEntryUserID & strQsSID2 %>"  class="smLink" rel="nofollow"><% = strLastEntryUsername %></a><br/> <% = DateFormat(dtmLastEntryDate) & " " & strTxtAt & " " & TimeFormat(dtmLastEntryDate) %> <%
   
   		'If there are unread posts display a differnet icon and link to the last unread post
   		If intUnReadPostCount > 0 Then
   			 
   			Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID)
   			If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3") 
			Response.Write("" & strQsSID2 & """><img src=""" & strImagePath & "view_unread_post." & strForumImageType & """ alt=""" & strTxtViewUnreadPost & " [" & intUnReadPostCount & " " & strTxtNewPosts & "]"" title=""" & strTxtViewUnreadPost & " [" & intUnReadPostCount & " " & strTxtNewPosts & "]"" /></a> ") 
   	
   		'Else there are no unread posts so display a normal topic link
   		Else
			Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID)
			If intPriority = 3 Then Response.Write("&amp;FID=" & intForumID & "&amp;PR=3") 
			Response.Write("" & strQsSID2 & """><img src=""" & strImagePath & "view_last_post." & strForumImageType & """ alt=""" & strTxtViewLastPost & """ title=""" & strTxtViewLastPost & """ /></a> ") 
   		End If
   
   %></td>
  </tr><%

		'Move to the next record
		intCurrentRecord = intCurrentRecord + 1
	Loop
End If


        %>
</table>
<table class="basicTable" cellspacing="0" cellpadding="4" align="center">
 <tr>
  <td>
   <a href="new_topic_form.asp?FID=<% = intForumID & strQsSID2 %>" title="<% = strTxtCreateNewTopic %>" class="largeButton" rel="nofollow">&nbsp;<% = strTxtNewTopic %> <img src="<% = strImagePath %>new_topic.<% = strForumImageType %>" alt="<% = strTxtCreateNewTopic %>" /></a><%

'If the user can create a poll disply a create poll link
If blnPollCreate Then Response.Write ("<a href=""new_poll_form.asp?FID=" & intForumID & strQsSID2 & """ title=""" & strTxtCreateNewPoll & """ class=""largeButton"" rel=""nofollow"">&nbsp;&nbsp;" & strTxtNewPoll & "&nbsp;&nbsp;<img src=""" & strImagePath & "new_poll." & strForumImageType & """  alt=""" & strTxtCreateNewPoll & """></a>")

%>
  </td>
  <td align="right" nowrap="nowrap"><!-- #include file="includes/page_link_inc.asp" --></td>
 </tr>
 <tr>
  <td valign="top"><br /><!-- #include file="includes/forum_jump_inc.asp" --></td>
  <td class="smText" align="right" nowrap="nowrap"><!-- #include file="includes/show_forum_permissions_inc.asp" --></td>
 </tr>
</table>
<br />
<div align="center">
<%

'Reset Server Objects
Call closeDatabase()

'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnLCode = True Then
	
	If blnTextLinks = True Then
		Response.Write("<span class=""text"" style=""font-size:10px"">Bulletin Board Software by <a href=""http://www.webwizforums.com"" target=""_blank"" style=""font-size:10px"">Web Wiz Forums&reg;</a> version " & strVersion & "</span>")
	Else
  		Response.Write("<a href=""http://www.webwizforums.com"" target=""_blank""><img src=""webwizforums_image.asp"" border=""0"" title=""Bulletin Board Software by Web Wiz Forums&reg; version " & strVersion& """ alt=""Bulletin Board Software by Web Wiz Forums&reg; version " & strVersion& """ /></a>")
	End If

	Response.Write("<br /><span class=""text"" style=""font-size:10px"">Copyright &copy;2001-2008 <a href=""http://www.webwizguide.com"" target=""_blank"" style=""font-size:10px"">Web Wiz</a></span>")
End If
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******

'Display the process time
If blnShowProcessTime Then Response.Write "<span class=""smText""><br /><br />" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "</span>"
%>
</div><%

'Display an alert message letting the user know the topic has been deleted
If Request.QueryString("DL") = "1" Then
	Response.Write("<script language=""JavaScript"" type=""text/javascript"">")
	Response.Write("alert('" & strTxtTheTopicIsNowDeleted & "')")
	Response.Write("</script>")
End If

'Display an alert message if the user is watching this forum for email notification
If Request.QueryString("EN") = "FS" Then
	Response.Write("<script language=""JavaScript"" type=""text/javascript"">")
	Response.Write("alert('" & strTxtYouAreNowBeNotifiedOfPostsInThisForum & "')")
	Response.Write("</script>")
End If

'Display an alert message if the user is not watching this forum for email notification
If Request.QueryString("EN") = "FU" Then
	Response.Write("<script language=""JavaScript"" type=""text/javascript"">")
	Response.Write("alert('" & strTxtYouAreNowNOTBeNotifiedOfPostsInThisForum & "')")
	Response.Write("</script>")
End If

%>
<!-- #include file="includes/footer.asp" -->

⌨️ 快捷键说明

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