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)
 Auto email notification when a topic is moved
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2001 :  18:02:01  Show Profile  Visit HuwR's Homepage
This Mod sends the author of a topic an email if the topic is moved.


Very simple Mod.
All changes to post_info.asp

at the top of the file, locate this code


if strAuthType = "db" then
strDBNTUserName = Request.Form("UserName")
end if



ADD the following imediately before it


Dim boolTopicMoved
boolTopicMoved = false



Now locate the following


if Request.Form("FORUM_ID") <> "" and Request.Form("FORUM_ID") <> aryForum(1) then
strSql = strSql & ", CAT_ID = " & aryForum(0)
strSql = strSql & ", FORUM_ID = " & aryForum(1)
end if



Change it to


if Request.Form("FORUM_ID") <> "" and Request.Form("FORUM_ID") <> aryForum(1) then
strSql = strSql & ", CAT_ID = " & aryForum(0)
strSql = strSql & ", FORUM_ID = " & aryForum(1)
boolTopicMoved = true
end if



Now scroll down a few lines till you find the


my_Conn.Execute(strSql)



Add the following code imediately after it


if booltopicmoved then
DoAutoMoveEmail(Request.Form("TOPIC_ID"))
end if



Now scroll down to the end of the file and insert the following sub before the closing %>


sub DoAutoMoveEmail(TopicNum)
'## Emails Topic Author if Topic Moved.
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strTablePrefix & "TOPICS.T_SUBJECT "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & TopicNum

set rs2 = my_Conn.Execute (strSql)

email = rs2("M_EMAIL")
user_name = rs2("M_NAME")
Topic_Title = rs2("T_SUBJECT")
rs2.close
if lcase(strEmail) = "1" then
strRecipientsName = user_name
strRecipients = email
strSubject = strForumTitle & " - Topic Moved"
strMessage = "Hello " & user_name & vbCrLf & vbCrLf
strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbCrLf
strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbCrLf & vbCrLf
strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbCrLf & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
end sub



That should be it.



James
Average Member

USA
539 Posts

Posted - 02 May 2001 :  23:42:21  Show Profile  Visit James's Homepage
Nice HuwR. the only thing I'd like to see added is the ability to turn this feature on/off.

-

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

swatijain
Starting Member

48 Posts

Posted - 05 May 2001 :  17:02:45  Show Profile
Lovely!

Thank You for the Mod. Works like a charm.

Go to Top of Page

dssww
Junior Member

USA
182 Posts

Posted - 09 May 2001 :  07:27:53  Show Profile  Visit dssww's Homepage
Is it possible to send a PM instead?

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 09 May 2001 :  08:24:38  Show Profile  Visit HuwR's Homepage
Not everybody has PM's installed, so the mod would no longer work for everyone, which was it's intention

Go to Top of Page

dssww
Junior Member

USA
182 Posts

Posted - 09 May 2001 :  09:24:18  Show Profile  Visit dssww's Homepage
Works Great! Thanks Huw, and I didn't even need to email you my file to edit! lol

PS: I just wanted to know if it was easy to add PM as an option?


Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 09 May 2001 :  09:37:31  Show Profile  Visit HuwR's Homepage
Yes I would think so, maybe as a later refinement when I do the admin to turn it on and off.

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.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07