Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Automatic Email to Moderators - MOD
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rkimball
Starting Member

1 Posts

Posted - 04 April 2001 :  20:26:26  Show Profile
This highly requested mod sends an email to all moderators of the forum whenever a new topic is created or a reply is posted in the forums they moderate. The moderators receive the email only once. Moderators do not receive email when they are the ones making the posts..


Tested on Snitz Forums 2000 Version 3.1 Service Release 4 only.. Tested only using CDONTS

No Demo available as I am behind a firewall..

Installation Instructions..

Step 1) Add the functions getMemberEmail and listForumModeratorEmails to inc_functions.asp

Step 2) Replace subroutines DoReplyEmail and DoEmail in post_info.asp with the modified routines below. These routines were modified to send the special moderator email.

Step 3) Add the Subroutine DoTopicEmail to post_info.asp somewhere near DoEmail. This routine sends an email when a new topic is created.

Step 4) Add the line DoTopicEmail txtSubject, rs("MEMBER_ID"), Request.Form("UserName") to post_info.asp in the section if Request.Form("Method_Type") = "Topic" then directly after the first My_Conn.Execute statement. This is line 473 in my code.. THis is necessary to execute the DoTopicEmail code.

Here are the necessary functions and subroutines.......

'--------------------------------------------------------------------
' Function to return the list of emails of all moderators of a forum
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
function listForumModeratorEmails(fForum_ID)

'## Forum_SQL
strSql = "SELECT * "
strSql = strSql & " FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE FORUM_ID = " & fForum_ID

set rsChk = my_Conn.Execute (strSql)

if rsChk.EOF or not(ChkQuoteOk(fForum_ID)) then
listForumModeratorEmails = ""
exit function
end if

if getMemberName (rsChk("MEMBER_ID")) <> strDBNTUserName then
fMods = getMemberEmail(rsChk("MEMBER_ID"))
end if

rsChk.MoveNext
do until rsChk.EOF
if getMemberName (rsChk("MEMBER_ID")) <> strDBNTUserName then
fMods = fMods & "; " & getMemberEmail(rsChk("MEMBER_ID"))
end if
rsChk.MoveNext
loop

rsChk.close
set rsChk = nothing

listForumModeratorEmails = fMods
end function

'-----------------------------------------------------------------------
' Function to return the email address of a member given the member ID
' Used in EMAIL TO MODERATORS MOD
'-----------------------------------------------------------------------
function getMemberEmail(fUser_Number)

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_EMAIL"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & fUser_Number

set rsGetMemberEmail = my_Conn.Execute(strSql)

if rsGetMemberEmail.EOF or rsGetMemberEmail.BOF then
getMemberEmail = ""
else
getMemberEmail = rsGetMemberEmail("M_EMAIL")
end if

end function

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoEmail(email, user_name)
'## Emails Topic Author if Requested.
'## This needs to be Edited to use your own email component
'## if you don't have one, try the w3Jmail component from www.dimac.net it's free!

if (lcase(strEmail) = "1") and (chkForumModerator(Request.Form("FORUM_ID"), user_name) = 0) then
strRecipientsName = user_name
strRecipients = email
strSubject = strForumTitle & " - Reply to your posting"
strMessage = "Hello " & user_name & vbCrLf & vbCrLf
strMessage = strMessage & "You have received a reply to your posting on " & strForumTitle & "." & vbCrLf
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
'-------------------------------------------
'Add special email to all forum moderators
'-------------------------------------------
strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & user_name & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub

'--------------------------------------------------------------------
' Routine added to send mail when new topic is created
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoTopicEmail(Topic, PostedBy, PostedByName)

strSql = "SELECT " & strMemberTablePrefix & "TOPICS.TOPIC_ID, " & strMemberTablePrefix & "TOPICS.T_SUBJECT"
strSql = strSql & " FROM " & strMemberTablePrefix & "TOPICS"
strSql = strSql & " WHERE " & strMemberTablePrefix & "TOPICS.T_SUBJECT = '" & Topic & "'"

set rsTopic = my_Conn.Execute (strSql)

strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new topic created"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has created a new topic '"& Topic & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the new topic at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & rsTopic("TOPIC_ID") & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this topic and all responses are appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf & vbCrLf
strMessage = strMessage & "To be removed as a moderator for this topic, reply to this message with a subject line of 'REMOVE MODERATOR'. Be sure to include the original message in the reply." &vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if

rsTopic.Close
rsTopic = nothing

end sub

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------

sub DoReplyEmail(TopicNum, PostedBy, PostedByName)
'## Emails all users who wish to receive a mail if topic
'## has a reply but only send one per member.
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND TOPIC_ID = " & TopicNum
strSql = strSql & " AND R_MAIL = 1 "
strSql = strSql & " ORDER BY " & strMemberTablePrefix & "MEMBERS.MEMBER_ID"

set rsReply = my_Conn.Execute (strSql)

'## Forum_SQL
strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strTablePrefix & "TOPICS.T_MAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, "
strSql = strSql & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & TopicNum

set rsTopicAuthor = my_Conn.Execute (strSql)

MailSendToAuthor = false

'-------------------------------------------------------------
' Modified so that forum MODERATORS do NOT receive this email
'-------------------------------------------------------------
if (rsTopicAuthor("T_MAIL") = 1) and (PostedBy <> rsTopicAuthor("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsTopicAuthor("M_NAME")) = 0) then
strRecipientsName = rsTopicAuthor("M_NAME")
strRecipients = rsTopicAuthor("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsTopicAuthor("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
MailSendToAuthor = true
end if

prevMember = ""
'-------------------------------------------------------------
' Modified so that forum MODERATORS do NOT receive this email
'-------------------------------------------------------------
do while (not rsReply.EOF) and (not rsReply.BOF)
if (prevMember <> rsReply("MEMBER_ID")) and (PostedBy <> rsReply("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsReply("M_NAME")) = 0) then
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) and (MailSendToAuthor) then
'## Do Nothing
'## The reply was done by the author, and he/she allready has got a mail
else
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) then
MailSendToAuthor = true
end if
strRecipientsName = rsReply("M_Name")
strRecipients = rsReply("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsReply("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
' strMessage = strMessage & "You can view the reply at " & Request.Form("refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end if
prevMember = rsReply("MEMBER_ID")
rsReply.MoveNext
loop

rsReply.Close
set rsReply = nothing

rsTopicAuthor.Close
set rsTopicAuthor = nothing

'-------------------------------------------
'Add special email to all forum moderators
'-------------------------------------------
strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub

Edited by - rkimball on 04 April 2001 20:27:37

Edited by - rkimball on 04 April 2001 20:33:15

Edited by - rkimball on 04 April 2001 20:34:16

rick7165
Senior Member

USA
1094 Posts

Posted - 04 April 2001 :  21:03:47  Show Profile  Visit rick7165's Homepage
Couple Questions...

Can you turn this feature off if a moderator doesn't want to get email?
Can this be setup for Admins to get emails also? and be able to turn it off?


Test Site
www.eastpasco.com
Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 05 April 2001 :  00:49:58  Show Profile  Visit Rob Poretti's Homepage
Good questions Rick,

I'm curious if this can be set to specific forums as well.

Looks, like a good one though!!! Good job!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960

Ok, I read your instructions a little more carefully... I see that it works on moderators of the forum that they moderate. If one has multilple moderators then an email will be sent to each moderator, correct?

Is this basic guideline for ALL forums -- or can one control which forum this affects?

Cheers!


Edited by - Rob Poretti on 05 April 2001 22:05:01
Go to Top of Page

twum
New Member

Netherlands
50 Posts

Posted - 05 April 2001 :  05:03:09  Show Profile  Visit twum's Homepage
quote:

This highly requested mod sends an email to all moderators of the forum whenever a new topic is created or a reply is posted in the forums they moderate. The moderators receive the email only once. Moderators do not receive email when they are the ones making the posts..


Tested on Snitz Forums 2000 Version 3.1 Service Release 4 only.. Tested only using CDONTS

No Demo available as I am behind a firewall..




Hi Rkimball,
I would really like to use your MOD and the one that sends an email to a user when a reply is posted. The only thing is I can't get it to work. I've tried using ASPEmail and Jmail and now I want to try CDONTS but I don't have the slightest clue as to how to install it. I'm also running the PC behind a firewall. It's a Win NT4 PC with IIS 4 installed. I don't remember the option I chose during the installation but that was long before I saw this wonderful forum. Now I want to install CDONTS and SMTP but can't find where. I run the NT 4 Option Pack setup again and chose Add/Remove but couldn't find anything that had to do with SMTP to install. and also not in the parts installed already. The PC I'm running the forum on also does not have an eamil client installed but I don't think that's needed to send an email from an asp page. In the email server config in admin options, I've tried using the company's email server but it doesn't seem to work or I might be adding the wrong server name(?). Could it also be that the server is not allowing emails generated from the asp pages to go thru?
Maybe you can shed some light on what I might be doing wrong.

Hope you can help.Regards
Twum

You can take a man out of Ghana, but you can't take Ghana out of the man.
Go to Top of Page

Wixxerd
Starting Member

25 Posts

Posted - 09 April 2001 :  04:49:22  Show Profile
quote:

This highly requested mod sends an email to all moderators of the forum whenever a new topic is created or a reply is posted in the forums they moderate. The moderators receive the email only once. Moderators do not receive email when they are the ones making the posts..


Tested on Snitz Forums 2000 Version 3.1 Service Release 4 only.. Tested only using CDONTS

No Demo available as I am behind a firewall..

Installation Instructions..

Step 1) Add the functions getMemberEmail and listForumModeratorEmails to inc_functions.asp

Step 2) Replace subroutines DoReplyEmail and DoEmail in post_info.asp with the modified routines below. These routines were modified to send the special moderator email.

Step 3) Add the Subroutine DoTopicEmail to post_info.asp somewhere near DoEmail. This routine sends an email when a new topic is created.

Step 4) Add the line DoTopicEmail txtSubject, rs("MEMBER_ID"), Request.Form("UserName") to post_info.asp in the section if Request.Form("Method_Type") = "Topic" then directly after the first My_Conn.Execute statement. This is line 473 in my code.. THis is necessary to execute the DoTopicEmail code.

Here are the necessary functions and subroutines.......

'--------------------------------------------------------------------
' Function to return the list of emails of all moderators of a forum
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
function listForumModeratorEmails(fForum_ID)

'## Forum_SQL
strSql = "SELECT * "
strSql = strSql & " FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE FORUM_ID = " & fForum_ID

set rsChk = my_Conn.Execute (strSql)

if rsChk.EOF or not(ChkQuoteOk(fForum_ID)) then
listForumModeratorEmails = ""
exit function
end if

if getMemberName (rsChk("MEMBER_ID")) <> strDBNTUserName then
fMods = getMemberEmail(rsChk("MEMBER_ID"))
end if

rsChk.MoveNext
do until rsChk.EOF
if getMemberName (rsChk("MEMBER_ID")) <> strDBNTUserName then
fMods = fMods & "; " & getMemberEmail(rsChk("MEMBER_ID"))
end if
rsChk.MoveNext
loop

rsChk.close
set rsChk = nothing

listForumModeratorEmails = fMods
end function

'-----------------------------------------------------------------------
' Function to return the email address of a member given the member ID
' Used in EMAIL TO MODERATORS MOD
'-----------------------------------------------------------------------
function getMemberEmail(fUser_Number)

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_EMAIL"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & fUser_Number

set rsGetMemberEmail = my_Conn.Execute(strSql)

if rsGetMemberEmail.EOF or rsGetMemberEmail.BOF then
getMemberEmail = ""
else
getMemberEmail = rsGetMemberEmail("M_EMAIL")
end if

end function

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoEmail(email, user_name)
'## Emails Topic Author if Requested.
'## This needs to be Edited to use your own email component
'## if you don't have one, try the w3Jmail component from www.dimac.net it's free!

if (lcase(strEmail) = "1") and (chkForumModerator(Request.Form("FORUM_ID"), user_name) = 0) then
strRecipientsName = user_name
strRecipients = email
strSubject = strForumTitle & " - Reply to your posting"
strMessage = "Hello " & user_name & vbCrLf & vbCrLf
strMessage = strMessage & "You have received a reply to your posting on " & strForumTitle & "." & vbCrLf
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
'-------------------------------------------
'Add special email to all forum moderators
'-------------------------------------------
strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & user_name & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub

'--------------------------------------------------------------------
' Routine added to send mail when new topic is created
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoTopicEmail(Topic, PostedBy, PostedByName)

strSql = "SELECT " & strMemberTablePrefix & "TOPICS.TOPIC_ID, " & strMemberTablePrefix & "TOPICS.T_SUBJECT"
strSql = strSql & " FROM " & strMemberTablePrefix & "TOPICS"
strSql = strSql & " WHERE " & strMemberTablePrefix & "TOPICS.T_SUBJECT = '" & Topic & "'"

set rsTopic = my_Conn.Execute (strSql)

strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new topic created"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has created a new topic '"& Topic & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the new topic at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & rsTopic("TOPIC_ID") & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this topic and all responses are appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf & vbCrLf
strMessage = strMessage & "To be removed as a moderator for this topic, reply to this message with a subject line of 'REMOVE MODERATOR'. Be sure to include the original message in the reply." &vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if

rsTopic.Close
rsTopic = nothing

end sub

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------

sub DoReplyEmail(TopicNum, PostedBy, PostedByName)
'## Emails all users who wish to receive a mail if topic
'## has a reply but only send one per member.
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND TOPIC_ID = " & TopicNum
strSql = strSql & " AND R_MAIL = 1 "
strSql = strSql & " ORDER BY " & strMemberTablePrefix & "MEMBERS.MEMBER_ID"

set rsReply = my_Conn.Execute (strSql)

'## Forum_SQL
strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strTablePrefix & "TOPICS.T_MAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, "
strSql = strSql & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & TopicNum

set rsTopicAuthor = my_Conn.Execute (strSql)

MailSendToAuthor = false

'-------------------------------------------------------------
' Modified so that forum MODERATORS do NOT receive this email
'-------------------------------------------------------------
if (rsTopicAuthor("T_MAIL") = 1) and (PostedBy <> rsTopicAuthor("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsTopicAuthor("M_NAME")) = 0) then
strRecipientsName = rsTopicAuthor("M_NAME")
strRecipients = rsTopicAuthor("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsTopicAuthor("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
MailSendToAuthor = true
end if

prevMember = ""
'-------------------------------------------------------------
' Modified so that forum MODERATORS do NOT receive this email
'-------------------------------------------------------------
do while (not rsReply.EOF) and (not rsReply.BOF)
if (prevMember <> rsReply("MEMBER_ID")) and (PostedBy <> rsReply("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsReply("M_NAME")) = 0) then
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) and (MailSendToAuthor) then
'## Do Nothing
'## The reply was done by the author, and he/she allready has got a mail
else
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) then
MailSendToAuthor = true
end if
strRecipientsName = rsReply("M_Name")
strRecipients = rsReply("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsReply("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
' strMessage = strMessage & "You can view the reply at " & Request.Form("refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end if
prevMember = rsReply("MEMBER_ID")
rsReply.MoveNext
loop

rsReply.Close
set rsReply = nothing

rsTopicAuthor.Close
set rsTopicAuthor = nothing

'-------------------------------------------
'Add special email to all forum moderators
'-------------------------------------------
strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub

Edited by - rkimball on 04 April 2001 20:27:37

Edited by - rkimball on 04 April 2001 20:33:15

Edited by - rkimball on 04 April 2001 20:34:16



Hi, I really like your mod!
Only problem I have is that it doesn't seem to send emails properly? Even tho I have my host set to a different server than the web server the forum is running on, I still get mail failures in the BadMail directory of the web server?

Other emails sent from the forum work fine, it's just the moderator topic emails that are failing...?

Am I doing something wrong?


Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 10 April 2001 :  22:35:08  Show Profile  Visit Rob Poretti's Homepage
Has anyone else successfully applied this mod to their forum -- in particular a production forum that is operating?

Just curious before I jump in...

Cheers!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960

Wow... two days and no responses... I guess that means no one has implemented this?

Edited by - Rob Poretti on 12 April 2001 11:29:20
Go to Top of Page

Rick
Starting Member

7 Posts

Posted - 17 April 2001 :  18:58:22  Show Profile  Visit Rick's Homepage
I am currently attempting to upgrade. I find it difficult to note where the DoReply section ends in ther current Post_info.asp page.
This is the error message I'm recieving.
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/tally/post_info.asp, line 1196
end if

-----------------
From the error you can gather I'm not a hardcore coder. I've list a portion of the file showing where I have pasted the code from this website. If someone would be able to take a look at it and tell me where the error lies that would be great.

end if
%>
<% set rs = nothing %>
<!--#INCLUDE FILE="inc_footer.asp" -->

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoEmail(email, user_name)
'## Emails Topic Author if Requested.
'## This needs to be Edited to use your own email component
'## if you don't have one, try the w3Jmail component from www.dimac.net it's free!

if (lcase(strEmail) = "1") and (chkForumModerator(Request.Form("FORUM_ID"), user_name) = 0) then
strRecipientsName = user_name
strRecipients = email
strSubject = strForumTitle & " - Reply to your posting"
strMessage = "Hello " & user_name & vbCrLf & vbCrLf
strMessage = strMessage & "You have received a reply to your posting on " & strForumTitle & "." & vbCrLf
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
'-------------------------------------------
'Add special email to all forum moderators
'-------------------------------------------
strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & user_name & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub

'--------------------------------------------------------------------
' Routine added to send mail when new topic is created
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------
sub DoTopicEmail(Topic, PostedBy, PostedByName)

strSql = "SELECT " & strMemberTablePrefix & "TOPICS.TOPIC_ID, " & strMemberTablePrefix & "TOPICS.T_SUBJECT"
strSql = strSql & " FROM " & strMemberTablePrefix & "TOPICS"
strSql = strSql & " WHERE " & strMemberTablePrefix & "TOPICS.T_SUBJECT = '" & Topic & "'"

set rsTopic = my_Conn.Execute (strSql)

strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new topic created"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has created a new topic '"& Topic & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the new topic at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & rsTopic("TOPIC_ID") & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this topic and all responses are appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf & vbCrLf
strMessage = strMessage & "To be removed as a moderator for this topic, reply to this message with a subject line of 'REMOVE MODERATOR'. Be sure to include the original message in the reply." &vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if

rsTopic.Close
rsTopic = nothing

end sub

'--------------------------------------------------------------------
' Routine Modified to send special moderator email
' Used in EMAIL TO MODERATORS MOD
'--------------------------------------------------------------------

sub DoReplyEmail(TopicNum, PostedBy, PostedByName)
'## Emails all users who wish to receive a mail if topic
'## has a reply but only send one per member.
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND TOPIC_ID = " & TopicNum
strSql = strSql & " AND R_MAIL = 1 "
strSql = strSql & " ORDER BY " & strMemberTablePrefix & "MEMBERS.MEMBER_ID"

set rsReply = my_Conn.Execute (strSql)

'## Forum_SQL
strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strTablePrefix & "TOPICS.T_MAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, "
strSql = strSql & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & TopicNum

set rsTopicAuthor = my_Conn.Execute (strSql)

MailSendToAuthor = false

if (rsTopicAuthor("T_MAIL") = 1) and (PostedBy <> rsTopicAuthor("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsTopicAuthor("M_NAME")) = 0) then
strRecipientsName = rsTopicAuthor("M_NAME")
strRecipients = rsTopicAuthor("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsTopicAuthor("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
MailSendToAuthor = true

end if

prevMember = ""
do while (not rsReply.EOF) and (not rsReply.BOF)
if (prevMember <> rsReply("MEMBER_ID")) and (PostedBy <> rsReply("MEMBER_ID")) and (chkForumModerator(Request.Form("FORUM_ID"), rsReply("M_NAME")) = 0) then
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) and (MailSendToAuthor) then
'## Do Nothing
'## The reply was done by the author, and he/she allready has got a mail
else
if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) then
MailSendToAuthor = true
end if
strRecipientsName = rsReply("M_Name")
strRecipients = rsReply("M_EMAIL")
strSubject = Request.Form("FORUM_Title") & " - Reply to a posting"
strMessage = "Hello " & rsReply("M_NAME") & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
' strMessage = strMessage & "You can view the reply at " & Request.Form("refer") & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%

end if
prevMember = rsReply("MEMBER_ID")
rsReply.MoveNext
loop

rsReply.Close
set rsReply = nothing

rsTopicAuthor.Close
set rsTopicAuthor = nothing

strRecipientsName = listForumModerators(Request.Form("FORUM_ID"))
if strRecipientsName <> "" then
strRecipients = listForumModeratorEmails(Request.Form("FORUM_ID"))
strSubject = Request.Form("FORUM_Title") & " - new posting made"
strMessage = "Hello '" & Request.Form("FORUM_Title") & "' moderators." & vbCrLf & vbCrLf
strMessage = strMessage & PostedByName & " has replied to the topic '"& Request.Form("Topic_Title") & "' in '" & Request.Form("FORUM_Title") & "', which you are responsible for moderating." & vbCrLf & vbCrLf
strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf & vbCrLf
strMessage = strMessage & "As the forum moderator, you are resonsibe for ensuring that this response is appropriate and accurate."& vbCrLf & vbCrLf
strMessage = strMessage & "You must also ensure that all posts receive a timely and accurate repsonse by tracking down answers to all unanswered questions." & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
prevMember = rsReply("MEMBER_ID")
rsReply.MoveNext
loop

rsReply.Close
set rsReply = nothing

rsTopicAuthor.Close
set rsTopicAuthor = nothing
end sub

sub Go_Result(str_err_Msg, boolOk)
%>
<table border="0" width="100%">

Rick Tadra


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07