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

📄 email_notify_subscriptions.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
'****************************************************************************************
'**  Copyright Notice    
'**
'**  Web Wiz Forums(TM)
'**  http://www.webwizforums.com
'**                            
'**  Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**  
'**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**  
'**  IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE 
'**  THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'**  AND DERIVATIVE WORKS IMMEDIATELY.
'**  
'**  If you have not received a copy of the license with this work then a copy of the latest
'**  license contract can be found at:-
'**
'**  http://www.webwizguide.com/license
'**
'**  For more information about this software and for licensing information please contact
'**  'Web Wiz' at the address and website below:-
'**
'**  Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'**  http://www.webwizguide.com
'**
'**  Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************



'*************************** SOFTWARE AND CODE MODIFICATIONS **************************** 
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE  
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************




'Set the buffer to true
Response.Buffer = True

'Declare variables
Dim intForumColourNumber	'Holds the number to calculate the table row colour
Dim rsForumSelect		'Recordset for teh forum selection	
Dim strCatName			'Holds the category name
Dim intCatID			'Holds the cat ID
Dim strForumName		'Holds the forum  name
Dim lngEmailUserID		'Holds the user ID to look at email notification for
Dim strMode			'Holds the mode of the page
Dim dtmLastEntryDate		'Holds the last entry date
Dim intCurrentRecord		'Holds the recordset array position
Dim sarrySubscribedForums	'Holds the subscribed forums
Dim sarrySubscribedTopics	'Holds the subscribed topics
Dim sarryForumSelect		'Holds the array with all the forums
Dim intSubForumID		'Holds if the forum is a sub forum
Dim intTempRecord		'Temporay record store
Dim blnHideForum		'Holds if the jump forum is hidden or not

'Initialise variable
intForumColourNumber = 0
intCurrentRecord = 0


'If emial notify is not on then send them away
If blnEmail = False Then 
	
	'Clean up
	Call closeDatabase()
	
	'Redirect
	Response.Redirect("default.asp" & strQsSID1)
End If


'If the user is not allowed then send them away
If intGroupID = 2 OR blnActiveMember = False Then 
	
	'Clean up
	Call closeDatabase()
	
	'Redirect
	Response.Redirect("insufficient_permission.asp" & strQsSID1)
End If



'Read in the mode of the page
strMode = Trim(Mid(Request.QueryString("M"), 1, 1))


'If this is not an admin but in admin mode then see if the user is a moderator
If blnAdmin = False AND strMode = "A"  AND blnModeratorProfileEdit Then
	
	'Initalise the strSQL variable with an SQL statement to query the database
        strSQL = "SELECT " & strDbTable & "Permissions.Moderate " & _
        "FROM " & strDbTable & "Permissions" & strDBNoLock & " " & _
        "WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") AND  " & strDbTable & "Permissions.Moderate=" & strDBTrue & ";"
               

        'Query the database
         rsCommon.Open strSQL, adoCon

        'If a record is returned then the user is a moderator in one of the forums
        If NOT rsCommon.EOF Then blnModerator = True

        'Clean up
        rsCommon.Close
End If


'Get the user ID of the email notifications to look at
If (blnAdmin OR (blnModerator AND CLng(Request.QueryString("PF")) > 2)) AND strMode = "A" AND CLng(Request.QueryString("PF")) <> 2 Then
	
	lngEmailUserID = CLng(Request.QueryString("PF"))

'Get the logged in ID number
Else
	lngEmailUserID = lngLoggedInUserID
End If






'DB hit to get subscribed forums

'Initlise the sql statement
strSQL = "SELECT " & strDbTable & "Forum.Forum_name, " & strDbTable & "EmailNotify.Forum_ID, " & strDbTable & "EmailNotify.Watch_ID " & _
"FROM " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "EmailNotify" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Forum.Forum_ID=" & strDbTable & "EmailNotify.Forum_ID AND " & strDbTable & "EmailNotify.Author_ID=" & lngEmailUserID & " " & _
"ORDER BY " & strDbTable & "Forum.Forum_Order;"

'Query the database
rsCommon.Open strSQL, adoCon

'Place the subscribed forums into an array
If NOT rsCommon.EOF Then
	
	'Read in the row from the db using getrows for better performance
	sarrySubscribedForums = rsCommon.GetRows()
End If

'Clean up
rsCommon.Close




'DB hit to get subscribed topics

'Initlise the sql statement
strSQL = "SELECT " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "EmailNotify.Topic_ID, " & strDbTable & "EmailNotify.Watch_ID, " & strDbTable & "Thread.Message_date " & _
"FROM " & strDbTable & "Topic" & strDBNoLock & ", " & strDbTable & "EmailNotify" & strDBNoLock & ", " & strDbTable & "Thread" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Topic.Last_Thread_ID=" & strDbTable & "Thread.Thread_ID AND " & strDbTable & "Topic.Topic_ID=" & strDbTable & "EmailNotify.Topic_ID AND " & strDbTable & "EmailNotify.Author_ID=" & lngEmailUserID & " " & _
"ORDER BY " & strDbTable & "Thread.Message_date DESC;"

'Query the database
rsCommon.Open strSQL, adoCon		

'Place the subscribed topics into an array
If NOT rsCommon.EOF Then
	
	'Read in the row from the db using getrows for better performance
	sarrySubscribedTopics = rsCommon.GetRows()
End If

'Clean up
rsCommon.Close




'DB hit to get forums with cats and permissions, for the forum select drop down

'Initlise the sql statement
strSQL = "" & _
"SELECT " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Hide, " & strDbTable & "Permissions.View_Forum " & _
"FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & "  " & _
"WHERE " & strDbTable & "Category.Cat_ID=" & strDbTable & "Forum.Cat_ID " & _
	"AND " & strDbTable & "Forum.Forum_ID=" & strDbTable & "Permissions.Forum_ID  " & _
	"AND (" & strDbTable & "Permissions.Author_ID=" & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID=" & intGroupID & ") " & _
"ORDER BY " & strDbTable & "Category.Cat_order, " & strDbTable & "Forum.Forum_Order;"

'Query the database
rsCommon.Open strSQL, adoCon		

'Place the subscribed topics into an array
If NOT rsCommon.EOF Then
	
	'Read in the row from the db using getrows for better performance
	sarryForumSelect = rsCommon.GetRows()
End If

'Clean up
rsCommon.Close
Call closeDatabase()


'Set bread crumb trail
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & strTxtEmailNotificationSubscriptions


%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% = strTxtEmailNotificationSubscriptions %></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">
//Funtion to check or uncheck all forum delete boxes
function checkAllForum(){

	var formArea = document.getElementById('frmForumDel');

 	if (formArea.chkDelete.length > 0) {
  		for (i=0; i < formArea.chkDelete.length; i++){
   			formArea.chkDelete[i].checked = formArea.chkAll.checked;
  		}
 	}
 	else {
  		formArea.chkDelete.checked = formArea.chkAll.checked;
 	}
}

//Funtion to check or uncheck all topic delete boxes
function checkAllTopic(){

	var formArea = document.getElementById('frmTopicDel');

 	if (formArea.chkDelete.length > 0) {
  		for (i=0; i < formArea.chkDelete.length; i++){
   				formArea.chkDelete[i].checked = formArea.chkAll.checked;
  		}
 	}
 	else {
  		formArea.chkDelete.checked = formArea.chkAll.checked;
 	}
}

//Function to check form is filled in correctly before submitting
function CheckForm () {
	
	var errorMsg = "";
	var formArea = document.getElementById('frmAddForum');
	
	//Check for a forum
	if (formArea.FID.value==""){
		errorMsg += "\n\t<% = strTxtSelectForumErrorMsg %>";
	}
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine1 %>\n";
		msg += "<% = strTxtErrorDisplayLine2 %>\n";
		msg += "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine3 %>\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	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><% = strTxtEmailNotificationSubscriptions %></h1></td>
</tr>
</table>  
<br />
<table class="basicTable" cellspacing="0" cellpadding="0" align="center"> 
 <tr> 
  <td class="tabTable">
   <a href="member_control_panel.asp<% If strMode = "A" Then Response.Write("?PF=" & lngEmailUserID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtControlPanel %>" class="tabButton">&nbsp;<img src="<% = strImagePath %>member_control_panel.<% = strForumImageType %>" border="0" alt="<% = strTxtControlPanel %>" /> <% = strTxtControlPanel %></a>
   <a href="register.asp<% If strMode = "A" Then Response.Write("?PF=" & lngEmailUserID & "&M=A" & strQsSID2) Else Response.Write(strQsSID1) %>" title="<% = strTxtProfile2 %>" class="tabButton">&nbsp;<img src="<% = strImagePath %>profile.<% = strForumImageType %>" border="0" alt="<% = strTxtProfile2 %>" /> <% = strTxtProfile2 %></a><%

⌨️ 快捷键说明

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