Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Stick/Edit topic question

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
philsbbs Posted - 19 April 2009 : 17:49:45
Hi,

I want to automatically send a private message to an author when a moderator or administrator edits or makes there topic sticky or unsticky.

Has anyone done such coding on there forum that they wish to share.

Thanks in advance.
5   L A T E S T    R E P L I E S    (Newest First)
Carefree Posted - 23 April 2009 : 05:59:54
To also send a PM to the topic's author, replace the routines as follows.

"pop_lock.asp"


	case "StickyTopic"
		strEncodedPassword = sha256("" & strPassword)
		mLev = cLng(chkUser(strDBNTFUserName, strEncodedPassword,-1))
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev > 2) then
				strSql="SELECT M.M_EMAIL, M.M_NAME, M.MEMBER_ID, T.T_AUTHOR, T.T_SUBJECT, T.TOPIC_ID FROM " & strMemberTablePrefix &_
				"MEMBERS M INNER JOIN " & strTablePrefix & "TOPICS T ON (T.T_AUTHOR=M.MEMBER_ID AND T.TOPIC_ID="& Topic_ID &")"
				set rsPost=my_Conn.Execute(strSql)
				if not rsPost.EOF then
					T1=rsPost("T_AUTHOR")
					strT2=rsPost("T_SUBJECT")
					strT3=rsPost("M_EMAIL")
					strT4=rsPost("M_NAME")
				end if
				rsPost.Close
				set rsPost=Nothing
				strRecipients = chkString(strT3,"SQLString")
				strRecipientsName = chkString(strT4,"SQLString")
				strFrom = strSender
				strFromName = strForumTitle
				strsubject = strForumTitle & " Sticky Topic Change, "&strRecipientsName
				strMessage = strMessage & "Your topic on "& strForumTitle &", titled: "& chr(34)& strT2 & chr(34) &" was made sticky by staff member: "& strDBNTFUserName& vbNewLine& "Link:  "&strForumURL& "topic.asp?topic_id="&Topic_ID & vbNewLine
				%>
				<!--#INCLUDE FILE="inc_mail.asp" -->
				<%
				strSql="INSERT INTO " & strTablePrefix & "PM (M_SUBJECT, M_MESSAGE, M_TO, M_FROM, M_SENT, M_MAIL, M_READ, M_OUTBOX) VALUES ('" & strSubject & "', '" & strMessage & "', " & t1 & ", " & MEMBERID & ", '" & DateToStr(strForumTimeAdjust) & "', " & "0,0,1)"
				Response.Write	strSql


"pop_open.asp"


				strSql="SELECT M.M_EMAIL, M.M_NAME, M.MEMBER_ID, T.T_AUTHOR, T.T_SUBJECT, T.TOPIC_ID FROM " & strMemberTablePrefix &_
				"MEMBERS M INNER JOIN " & strTablePrefix & "TOPICS T ON (T.T_AUTHOR=M.MEMBER_ID AND T.TOPIC_ID="& Topic_ID &")"
				set rsPost=my_Conn.Execute(strSql)
				if not rsPost.EOF then
					T1=rsPost("T_AUTHOR")
					strT2=rsPost("T_SUBJECT")
					strT3=rsPost("M_EMAIL")
					strT4=rsPost("M_NAME")
				end if
				rsPost.Close
				set rsPost=Nothing
				strRecipients = chkString(strT3,"SQLString")
				strRecipientsName = chkString(strT4,"SQLString")
				strFrom = strSender
				strFromName = strForumTitle
				strsubject = strForumTitle & " Sticky Topic Change, "&strRecipientsName
				strMessage = strMessage & "Your topic on "& strForumTitle &", titled: "& chr(34)& strT2 & chr(34) &" was made un-sticky by staff member: "& strDBNTFUserName& vbNewLine& "Link:  "&strForumURL& "topic.asp?topic_id="&Topic_ID & vbNewLine
				%>
				<!--#INCLUDE FILE="inc_mail.asp" -->
				<%
				strSql="INSERT INTO " & strTablePrefix & "PM (M_SUBJECT, M_MESSAGE, M_TO, M_FROM, M_SENT, M_MAIL, M_READ, M_OUTBOX) VALUES ('" & strSubject & "', '" & strMessage & "', " & t1 & ", " & MEMBERID & ", '" & DateToStr(strForumTimeAdjust) & "', " & "0,0,1)"
				Response.Write	strSql
Carefree Posted - 23 April 2009 : 05:29:31
Sure. I'll add that today for you.
philsbbs Posted - 23 April 2009 : 05:08:11
Thanks it works a treat, is it possible to have it also send a private message as well as a email ??

Carefree Posted - 22 April 2009 : 09:11:27
Here you are.

In "pop_lock.asp", look for the following lines (appx 192-196):


	case "StickyTopic"
		strEncodedPassword = sha256("" & strPassword)
		mLev = cLng(chkUser(strDBNTFUserName, strEncodedPassword,-1))
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev = 4) then


Replace them with the following:

	case "StickyTopic"
		strEncodedPassword = sha256("" & strPassword)
		mLev = cLng(chkUser(strDBNTFUserName, strEncodedPassword,-1))
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev > 2) then
				strSql="SELECT M.M_EMAIL, M.M_NAME, M.MEMBER_ID, T.T_AUTHOR, T.T_SUBJECT, T.TOPIC_ID FROM " & strMemberTablePrefix &_
				"MEMBERS M INNER JOIN " & strTablePrefix & "TOPICS T ON (T.T_AUTHOR=M.MEMBER_ID AND T.TOPIC_ID="& Topic_ID &")"
				set rsPost=my_Conn.Execute(strSql)
				if not rsPost.EOF then
					strT2=rsPost("T_SUBJECT")
					strT3=rsPost("M_EMAIL")
					strT4=rsPost("M_NAME")
				end if
				rsPost.Close
				set rsPost=Nothing
				strRecipients = chkString(strT3,"SQLString")
				strRecipientsName = chkString(strT4,"SQLString")
				strFrom = strSender
				strFromName = strForumTitle
				strsubject = strForumTitle & " Sticky Topic Change, "&strRecipientsName
				strMessage = strMessage & "Your topic on "& strForumTitle &", titled: "& chr(34)& strT2 & chr(34) &" was made sticky by staff member: "& strDBNTFUserName& vbNewLine& "Link:  "&strForumURL& "topic.asp?topic_id="&Topic_ID & vbNewLine
				%>
				<!--#INCLUDE FILE="inc_mail.asp" -->
				<%


Then, in "pop_open.asp", look for the following lines (appx 156-160):


	case "UnStickyTopic"
		strEncodedPassword = sha256("" & strPassword)
		mLev = cLng(ChkUser(strDBNTFUserName, strEncodedPassword,-1)) 
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev = 4) then


Replace them with the following:

	case "UnStickyTopic"
		strEncodedPassword = sha256("" & strPassword)
		mLev = cLng(ChkUser(strDBNTFUserName, strEncodedPassword,-1))
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Forum_ID, strDBNTFUserName) = "1") or (mLev > 2) then
				strSql="SELECT M.M_EMAIL, M.M_NAME, M.MEMBER_ID, T.T_AUTHOR, T.T_SUBJECT, T.TOPIC_ID FROM " & strMemberTablePrefix &_
				"MEMBERS M INNER JOIN " & strTablePrefix & "TOPICS T ON (T.T_AUTHOR=M.MEMBER_ID AND T.TOPIC_ID="& Topic_ID &")"
				set rsPost=my_Conn.Execute(strSql)
				if not rsPost.EOF then
					strT2=rsPost("T_SUBJECT")
					strT3=rsPost("M_EMAIL")
					strT4=rsPost("M_NAME")
				end if
				rsPost.Close
				set rsPost=Nothing
				strRecipients = chkString(strT3,"SQLString")
				strRecipientsName = chkString(strT4,"SQLString")
				strFrom = strSender
				strFromName = strForumTitle
				strsubject = strForumTitle & " Sticky Topic Change, "&strRecipientsName
				strMessage = strMessage & "Your topic on "& strForumTitle &", titled: "& chr(34)& strT2 & chr(34) &" was made un-sticky by staff member: "& strDBNTFUserName& vbNewLine& "Link:  "&strForumURL& "topic.asp?topic_id="&Topic_ID & vbNewLine
				%>
				<!--#INCLUDE FILE="inc_mail.asp" -->
				<%
Carefree Posted - 22 April 2009 : 02:21:01
I haven't, no, but I'll write it for you tonight.

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07