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/O Code)
 Including Page Number in notification email
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 30 November 2002 :  16:19:28  Show Profile  Visit Webbo's Homepage
Hi everyone,

I have searched for this idea and cannot find a previous answer. Is it possible to include the page number in the link that is sent within a notification email?

I think it could be implemented possibly in the default.asp file lines 775-783

' DEM --> Start of code for Subscription
if ForumFType = 0 and (strSubscription > 0 and strSubscription < 4) and CatSubscription > 0 and ForumSubscription = 1 and (mlev > 0) and strEmail = 1 then
if InArray(strForumSubs,ForumID) then
Response.Write " " & ShowSubLink ("U", ForumCatID, ForumID, 0, "N")
elseif strBoardSubs <> "Y" and not(InArray(strCatSubs,ForumCatID)) then
Response.Write " " & ShowSubLink ("S", ForumCatID, ForumID, 0, "N")
end if
end if
' DEM --> End of Code for Subscription


......but how?

It would be very useful for threads that go over a number of pages.

Thanks, Dave

Webbo
Average Member

United Kingdom
982 Posts

Posted - 03 December 2002 :  07:29:56  Show Profile  Visit Webbo's Homepage
Bump

Is it possible?

Dave
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 03 December 2002 :  10:25:41  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
It's possible, but not the way you want it to be done. What you'll need to do is change code in inc_subscription.asp. The code you would change would be this line (about line 192 in v3.4.03):

strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?TOPIC_ID=" & TopicId & vbNewline

and changing it to this SHOULD be enough to get what you want it to do:

strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?TOPIC_ID=" & TopicId & "&whichpage=-1" & vbNewline

If that doesn't work, look at the last post code in default.asp and topic.asp to see what I did wrong....Good luck!

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 03 December 2002 :  20:17:55  Show Profile  Visit Webbo's Homepage
Hi Dave,

Thanks for the help but unfortunately it doesn't work.

The page number isn't returned in the link and when the link is clicked it just takes you back to the first page.
The subscription email looks like:
You can view the posting at http://www.domain.com/testforum/topic.asp?TOPIC_ID=3&whichpage=-1

I tried playing around using the various ones in default and topic but to no avail, hmmm

Regards, Dave
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 04 December 2002 :  08:06:23  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
On a notification, you shouldn't need the page number. What that code SHOULD do is take you to the last post on the topic (which is the relevant one since it's the one that triggered the notification....)

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 04 December 2002 :  08:24:27  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
OK. I just went back and see what the problem is...it's expecting the reply_id to be passed along with the whichpage being set to -1.

You've got two ways in which you can approach this:

Option 1: Remove the querystring parameter from the code in topic.asp and change it to be like this:

if mypage = -1 then
	strSql1 = "SELECT REPLY_ID "
	strSql2 = "FROM " & strActivePrefix & "REPLY "
	strSql3 = "WHERE TOPIC_ID = " & Topic_ID & " "
	' DEM --> if not a Moderator, all unapproved posts should not be viewed.
	if AdminAllowed = 0 then
		strSql3 = strSql3 & "AND (R_STATUS < "
		if Moderation = "Y" then
			' Ignore unapproved/rejected posts
			strSql3 = strSql3 & "2 "
		else
			' Ignore any previously rejected topic
			strSql3 = strSql3 & "3 "
		end if
		strSql3 = strSql3 & "OR R_AUTHOR = " & MemberID & ") "
	end if
	strSql4 = "ORDER BY R_DATE DESC "

	if strDBType = "mysql" then
		set rsReplies = Server.CreateObject("ADODB.Recordset")

		rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

		if rsReplies.EOF then
			iReplyCount = ""
		else
			arrReplyData = rsReplies.GetRows(adGetRowsRest)
			iReplyCount = UBound(arrReplyData, 2)
			rREPLY_ID = 0
		end if

		LastPostReplyID = rsReplies("REPLY_ID")
		if iReplyCount <> "" then
			for iReply = 0 to iReplyCount
				intReplyID = arrReplyData(rREPLY_ID,iReply)
				if LastPostReplyID = intReplyID then
					intPageNumber = ((iReply+1)/strPageSize)
					if intPageNumber > cLng(intPageNumber) then
						intPageNumber = cLng(intPageNumber) + 1
					end if
					strwhichpage = "whichpage=" & intPageNumber & "&"
					exit for
				end if
			next
		else
			strwhichpage = ""
		end if

		rsReplies.Close
		set rsReplies = nothing
	else
		set rsReplies = Server.CreateObject("ADODB.Recordset")
		rsReplies.cachesize = strPageSize
		rsReplies.pagesize = strPageSize

		rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText

		LastPostReplyID = rsReplies("REPLY_ID")
		rsReplies.Find = "REPLY_ID=" & LastPostReplyID & ""

		if not (rsReplies.EOF or rsReplies.BOF) then
			if rsReplies.absolutepage > 1 then strwhichpage = "whichpage=" & rsReplies.absolutepage & "&"
		else
			strwhichpage = ""
		end if

		rsReplies.Close
		set rsReplies = nothing
	end if

	Response.Redirect("topic.asp?" & strwhichpage & "TOPIC_ID=" & Topic_ID & "#" & LastPostReplyID & "")
	Response.End
end if


Now the potential problem with that is there may very well have been a reason why the querystring check was thrown in there. Not quite sure WHAT, but there must have been a reason. Your other option is to make a call to the reply table in inc_subscription.asp. You would add this code somewhere BEFORE the line I gave you earlier:

<%
Dim SubReplyID
strSQL = "SELECT MAX(REPLY_ID) " & _
		 "  FROM " & strTablePrefix & "REPLY" & _
		 " WHERE TOPIC_ID = " & TopicID & _
         "   AND R_AUTHOR = " & ThisMemberID
set rsReply = MyConn.Execute(strSQL)
if rsReply.EOF or rsReply.BOF then
	SubReplyID = 0
else
	SubReplyID = rsReply("REPLY_ID")
end if
rsReply.Close	:	set rsReply = Nothing
%>

You would then need to change that line I gave you before to this:
strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?TOPIC_ID=" & TopicId & "&REPLY_ID=" & SubReplyID & "&whichpage=-1" & vbNewline


Either approach SHOULD fix it. Let me know if it doesn't....

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

DJBBIZ
Junior Member

214 Posts

Posted - 06 December 2002 :  22:27:58  Show Profile  Visit DJBBIZ's Homepage
Webbo: I am interested in this feature as well. Did the last chenge work and did you make the second one DaveMaxwell suggested? ...it seems the way to go.


"The difference between good ideas and good results is performance"
the management institute | tmiFinance | tmiCreative | ProfileOnDemand
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 07 December 2002 :  10:31:44  Show Profile  Visit Webbo's Homepage
I haven't had chance as yet DJBIZZ as I seem to be permanently at work this week but will let you know when I get the opportunity which all being well will be Monday or Tuesday evening.
Thanks Davemaxwell for your time.

I don't suppose anyone has designed a MOD for adding an eighth day into a week - if so can I have it, lol

Dave
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 07 December 2002 :  15:43:06  Show Profile  Visit Webbo's Homepage
Hi Dave,

Just got an hour to myself and gave the two options a whirl.

The first returned an error:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/testforum/topic.asp, line 235


--Line 235 reads: LastPostReplyID = rsReplies("REPLY_ID")

and the second option returned an error:

Microsoft VBScript runtime error '800a01a8'

Object required: 'MyConn'

/testforum/inc_subscription.asp, line 170


That was with the second option code added at lines 165+

Line 170 reads: set rsReply = MyConn.Execute(strSQL)

I also removed the <% %> as a Statement was called for at <%

So over to you once again Dave

Regards, Dave
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 08 December 2002 :  00:28:31  Show Profile  Visit James's Homepage
quote:
Originally posted by Webbo


I don't suppose anyone has designed a MOD for adding an eighth day into a week - if so can I have it, lol



Actually, someone did make that mod. Unfortunately, it's a work day.



James

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

DJBBIZ
Junior Member

214 Posts

Posted - 17 December 2002 :  15:08:50  Show Profile  Visit DJBBIZ's Homepage
Has anyone unlocked the secret yet?


"The difference between good ideas and good results is performance"
the management institute | tmiFinance | tmiCreative | ProfileOnDemand
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 17 December 2002 :  15:23:45  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Sorry, just saw this.....

quote:
Originally posted by Webbo

Hi Dave,

Just got an hour to myself and gave the two options a whirl.

The first returned an error:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/testforum/topic.asp, line 235


--Line 235 reads: LastPostReplyID = rsReplies("REPLY_ID")


Is this a new topic, or a reply? If it's a reply, this should have worked. Looks like it didn't find the topic for some reason (the BOF or EOF gave that away...

As for option #2
quote:
Originally posted by Webbo
and the second option returned an error:

Microsoft VBScript runtime error '800a01a8'

Object required: 'MyConn'

/testforum/inc_subscription.asp, line 170


That was with the second option code added at lines 165+

Line 170 reads: set rsReply = MyConn.Execute(strSQL)

I also removed the <% %> as a Statement was called for at <%

So over to you once again Dave

Regards, Dave



Should be my_Conn, not myConn. Typo on my part. I apologize...

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 19 December 2002 :  20:05:13  Show Profile  Visit Webbo's Homepage
Hi Dave,

I have applied as above but using the #2 option I now get the following error when posting a reply:

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/testforum/inc_subscription.asp, line 174


Line 173,174,175 read:

else
SubReplyID = rsReply("REPLY_ID")
end if



The #1 option was a reply

I have uploaded a text version of my inc_subscription to the server if it helps - Here

Thanks, Dave
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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07