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

📄 pre_approved_topics.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	dtmActiveFrom = "#" & dtmActiveFrom & "#"
Else
	dtmActiveFrom = "'" & dtmActiveFrom & "'"
End If



'Initalise SQL query (quite complex but required if we only want 1 db hit to get the lot for the whole page)
strSQL = "" & _
"SELECT " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Forum_code, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Topic.Moved_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Icon, " & strDbTable & "Topic.Start_Thread_ID, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "Topic.No_of_replies, " & strDbTable & "Topic.No_of_views, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Priority, " & strDbTable & "Topic.Hide, " & strDbTable & "Thread.Message_date, " & strDbTable & "Thread.Message, " & strDbTable & "Thread.Author_ID, " & strDbTable & "Author.Username, LastThread.Message_date, LastThread.Author_ID, LastAuthor.Username, " & strDbTable & "Topic.Event_date, " & strDbTable & "Topic.Event_date_end " & _
"FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Topic" & strDBNoLock & ", " & strDbTable & "Thread" & strDBNoLock & ", " & strDbTable & "Thread AS LastThread" & strDBNoLock & ", " & strDbTable & "Author" & strDBNoLock & ", " & strDbTable & "Author AS LastAuthor" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID " & _
	"AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " & _
	"AND " & strDbTable & "Thread.Author_ID = " & strDbTable & "Author.Author_ID " & _
	"AND LastThread.Author_ID = LastAuthor.Author_ID " & _
	"AND " & strDbTable & "Topic.Start_Thread_ID = " & strDbTable & "Thread.Thread_ID " & _
	"AND " & strDbTable & "Topic.Last_Thread_ID = LastThread.Thread_ID "


'If not admin check they are a moderator
If blnAdmin = false Then
strSQL = strSQL & _
	"AND (" & strDbTable & "Topic.Forum_ID " & _
		"IN (" & _
			"SELECT " & strDbTable & "Permissions.Forum_ID " & _
			"FROM " & strDbTable & "Permissions " & strDBNoLock & " " & _
			"WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") " & _
				"AND " & strDbTable & "Permissions.Moderate = " & strDBTrue & _
			")" & _
	")"
End If


'Get topics with hidden posts only
strSQL = strSQL & _
	"AND (" & strDbTable & "Topic.Hide=" & strDBTrue & "  OR (" & strDbTable & "Topic.Topic_ID " & _
		"IN (" & _
			"SELECT Topic_ID " & _
			"FROM " & strDbTable & "Thread " & strDBNoLock & " " & _
			"WHERE " & strDbTable & "Thread.Hide = " & strDBTrue & _
			")" & _
		")"  & _
	")"
	

'If there is a date to show topics with then apply it to the SQL query
If intShowTopicsFrom <> 0 Then
strSQL = strSQL & _	
	"AND (LastThread.Message_date > " & dtmActiveFrom & ")"
End If




strSQL = strSQL & "ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Forum.Forum_Order ASC, " & strSortBy & ";"


'Set error trapping
On Error Resume Next
	
'Query the database
rsCommon.Open strSQL, adoCon

'If an error has occurred write an error to the page
If Err.Number <> 0 AND  strDatabaseType = "mySQL" Then	
	Call errorMsg("An error has occurred while executing SQL query on database.<br />Please check that the MySQL Server version is 4.1 or above.", "get_hidden_topics", "pre_approved_topics.asp")
ElseIf Err.Number <> 0 Then	
	Call errorMsg("An error has occurred while executing SQL query on database.", "get_hidden_topics", "pre_approved_topics.asp")
End If
			
'Disable error trapping
On Error goto 0

'SQL Query Array Look Up table
'0 = tblForum.Forum_ID
'1 = tblForum.Forum_name
'2 = tblForum.Password
'3 = tblForum.Forum_code
'4 = tblTopic.Topic_ID
'5 = tblTopic.Poll_ID
'6 = tblTopic.Moved_ID
'7 = tblTopic.Subject
'8 = tblTopic.Icon
'9 = tblTopic.Start_Thread_ID
'10 = tblTopic.Last_Thread_ID
'11 = tblTopic.No_of_replies
'12 = tblTopic.No_of_views
'13 = tblTopic.Locked
'14 = tblTopic.Priority
'15 = tblTopic.Hide
'16 = tblThread.Message_date
'17 = tblThread.Message, 
'18 = tblThread.Author_ID, 
'19 = tblAuthor.Username, 
'20 = LastThread.Message_date, 
'21 = LastThread.Author_ID, 
'22 = LastAuthor.Username
'23 = tblTopic.Event_date
'24 = tblTopic.Event_date_end
	

'Read in some details of the topics
If NOT rsCommon.EOF Then 
	
	'Read in the topivc recordset into an array
	sarryTopics = rsCommon.GetRows()
	
	'Count the number of records
	intTotalRecords = Ubound(sarryTopics,2) + 1

	'Count the number of pages for the topics using '\' so that any fraction is omitted 
	intTotalRecordsPages = intTotalRecords \ intTopicPerPage
	
	'If there is a remainder or the result is 0 then add 1 to the total num of pages
	If intTotalRecords Mod intTopicPerPage > 0 OR intTotalRecordsPages = 0 Then intTotalRecordsPages = intTotalRecordsPages + 1
		
	'Start position
	intStartPosition = ((intRecordPositionPageNum - 1) * intTopicPerPage)

	'End Position
	intEndPosition = intStartPosition + intTopicPerPage
		
	'Get the start position
	intCurrentRecord = intStartPosition
End If

'Close the recordset
rsCommon.Close



'Page to link to for mutiple page (with querystrings if required)
strLinkPage = "pre_approved_topics.asp?"



'If active users is enabled update the active users application array
If blnActiveUsers Then
	'Call active users function
	saryActiveUsers = activeUsers(strTxtHiddenTopicsPosts, "", "", 0)
End If


'Set bread crumb trail
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & "<a href=""pre_approved_topics.asp" & strQsSID1 & """>" & strTxtHiddenTopicsPosts & "</a>"

'Status bar Active Topics Links
strStatusBarTools = strStatusBarTools & "&nbsp;&nbsp;<img src=""" & strImagePath & "active_topics." & strForumImageType & """ alt=""" & strTxtActiveTopics & """ title=""" & strTxtActiveTopics & """ style=""vertical-align: text-bottom"" /> <a href=""active_topics.asp" & strQsSID1 & """>" & strTxtActiveTopics & "</a> "
strStatusBarTools = strStatusBarTools & "&nbsp;&nbsp;<img src=""" & strImagePath & "unanswered_topics." & strForumImageType & """ alt=""" & strTxtUnAnsweredTopics & """ title=""" & strTxtUnAnsweredTopics & """ style=""vertical-align: text-bottom"" /> <a href=""active_topics.asp?UA=Y" & strQsSID2 & """>" & strTxtUnAnsweredTopics & "</a> "

%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% = strMainForumName & ": " & strTxtHiddenTopicsPosts %></title>

<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>

<script  language="JavaScript">
//Function to choose how many topics are show
function ShowTopics(Show){

   	strShow = escape(Show.options[Show.selectedIndex].value);

   	if (Show != '') self.location.href = 'pre_approved_topics.asp?MT=' + strShow + '&PN=1<% = strQsSID2 %>';
	return true;
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/status_bar_header_inc.asp" -->
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
 <tr>
  <td align="left">
   <h1><% = strTxtHiddenTopicsPosts %></h1>
   <span class="smText"><% = strTxtLastPostDetailNotHiddenDetails %></span>
  </td>
</table>
<br />
<table class="basicTable" cellspacing="0" cellpadding="4" align="center">
 <tr>
  <td><% = strTxtShowTopics %>
   <select name="show" id="show" onchange="ShowTopics(this)">
    <option value="0"<% If intShowTopicsFrom = 0 Then Response.Write " selected" %>><% = strTxtAnyDate %></option>
    <option value="1"<% If intShowTopicsFrom = 1 Then Response.Write " selected" %>><% = DateFormat(dtmLastVisitDate) & " " & strTxtAt & " " & TimeFormat(dtmLastVisitDate) %></option>
    <option value="2"<% If intShowTopicsFrom = 2 Then Response.Write " selected" %>><% = strTxtLastFifteenMinutes %></option>
    <option value="3"<% If intShowTopicsFrom = 3 Then Response.Write " selected" %>><% = strTxtLastThirtyMinutes %></option>
    <option value="4"<% If intShowTopicsFrom = 4 Then Response.Write " selected" %>><% = strTxtLastFortyFiveMinutes %></option>
    <option value="5"<% If intShowTopicsFrom = 5 Then Response.Write " selected" %>><% = strTxtLastHour %></option>
    <option value="6"<% If intShowTopicsFrom = 6 Then Response.Write " selected" %>><% = strTxtLastTwoHours %></option>
    <option value="7"<% If intShowTopicsFrom = 7 Then Response.Write " selected" %>><% = strTxtLastFourHours %></option>
    <option value="8"<% If intShowTopicsFrom = 8 Then Response.Write " selected" %>><% = strTxtLastSixHours %></option>
    <option value="9"<% If intShowTopicsFrom = 9 Then Response.Write " selected" %>><% = strTxtLastEightHours %></option>
    <option value="10"<% If intShowTopicsFrom = 10 Then Response.Write " selected" %>><% = strTxtLastTwelveHours %></option>
    <option value="11"<% If intShowTopicsFrom = 11 Then Response.Write " selected" %>><% = strTxtLastSixteenHours %></option>
    <option value="12"<% If intShowTopicsFrom = 12 Then Response.Write " selected" %>><% = strTxtYesterday %></option>
    <option value="13"<% If intShowTopicsFrom = 13 Then Response.Write " selected" %>><% = strTxtLastWeek %></option>
    <option value="14"<% If intShowTopicsFrom = 14 Then Response.Write " selected" %>><% = strTxtLastMonth %></option>
    <option value="15"<% If intShowTopicsFrom = 15 Then Response.Write " selected" %>><% = strTxtLastTwoMonths %></option>
    <option value="16"<% If intShowTopicsFrom = 16 Then Response.Write " selected" %>><% = strTxtLastSixMonths %></option>
    <option value="17"<% If intShowTopicsFrom = 17 Then Response.Write " selected" %>><% = strTxtLastYear %></option>
   </select>
  </td>
  <td align="right" valign="top" nowrap><!-- #include file="includes/page_link_inc.asp" --></td>
 </tr>
</table>
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
 <tr class="tableLedger">
  <td width="5%">&nbsp;</td>
  <td width="50%"><a href="pre_approved_topics.asp?SO=T<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtTopics %></a><% If Request.QueryString("SO") = "T" Then Response.Write(" <a href=""pre_approved_topics.asp?SO=T&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %> / <a href="pre_approved_topics.asp?SO=A<% = strQsSID2 %>"><% = strTxtThreadStarter %></a><% If Request.QueryString("SO") = "A" Then Response.Write(" <a href=""pre_approved_topics.asp?SO=A&OB=" & strSortDirection & strQsSID2 & """ title=""" & strTxtReverseSortOrder & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
  <td width="10%" align="center" nowrap><a href="pre_approved_topics.asp?SO=R<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtReplies %></a><% If Request.QueryString("SO") = "R" Then Response.Write(" <a href=""pre_approved_topics.asp?SO=R&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
  <td width="10%" align="center" nowrap><a href="pre_approved_topics.asp?SO=V<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtViews %></a><% If Request.QueryString("SO") = "V" Then Response.Write(" <a href=""pre_approved_topics.asp?SO=V&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
  <td width="20%"><a href="pre_approved_topics.asp<% = strQsSID1 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtLastPost %></a><% If Request.QueryString("SO") = "" Then Response.Write(" <a href=""pre_approved_topics.asp?OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
 </tr><%




'If there are no active topics display an error msg
If intTotalRecords <= 0 Then
	
	'If there are no Active Topic's to display then display the appropriate error message
	Response.Write vbCrLf & " <tr class=""tableRow""><td colspan=""6"" align=""center""><br />" & strTxtNoHiddenTopicsPostsSince & " " & strShowTopicsFrom & " " & strTxtToDisplay & "<br /><br /></td></tr>"




'Disply any active topics in the forum
Else


	'Do....While Loop to loop through the recorset to display the forum topics
	Do While intCurrentRecord < intEndPosition

		'If there are no topic records left to display then exit loop
		If intCurrentRecord >= intTotalRecords Then Exit Do
			
			
		'SQL Query Array Look Up table
		'0 = tblForum.Forum_ID
		'1 = tblForum.Forum_name
		'2 = tblForum.Password
		'3 = tblForum.Forum_code
		'4 = tblTopic.Topic_ID
		'5 = tblTopic.Poll_ID
		'6 = tblTopic.Moved_ID
		'7 = tblTopic.Subject
		'8 = tblTopic.Icon
		'9 = tblTopic.Start_Thread_ID
		'10 = tblTopic.Last_Thread_ID
		'11 = tblTopic.No_of_replies
		'12 = tblTopic.No_of_views
		'13 = tblTopic.Locked
		'14 = tblTopic.Priority
		'15 = tblTopic.Hide
		'16 = tblThread.Message_date
		'17 = tblThread.Message, 
		'18 = tblThread.Author_ID, 
		'19 = tblAuthor.Username, 
		'20 = LastThread.Message_date, 

⌨️ 快捷键说明

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