Author |
Topic |
Gooey
New Member
55 Posts |
Posted - 25 February 2003 : 10:51:38
|
Is there any way to get the link in the e-mail notifications to got o the correct post instead of the start of the thread? Hopefully someone of immense brain power will know.. |
Edited by - ruirib on 25 February 2003 11:39:09 |
|
Gooey
New Member
55 Posts |
Posted - 28 February 2003 : 10:51:03
|
Ok, I've worked out that the code needs to go in the inc_Subscriptions.asp file at line 192. I also know I need to append "&ReplyID=ReplyID" to the line, but I have no idea how to find out the replyID of the last post from a TopicID. |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Gooey
New Member
55 Posts |
Posted - 28 February 2003 : 10:58:40
|
MS-SQL |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Gooey
New Member
55 Posts |
Posted - 28 February 2003 : 12:14:13
|
I have that in but it doesn't produce anything. I have the following on line 71 of inc_subcription.asp, right before the rsSub.Close call:
dim rst
set rst = my_Conn.execute("SELECT @@IDENTITY")
NewID = rst(0)
set rst = nothing
I'm sure it's just a question of placement, but to me it looks like it's in the right place.
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Gooey
New Member
55 Posts |
Posted - 01 March 2003 : 07:03:54
|
Ok, my link that is emailed is now as below, which seems to be correct. Unfortuantly it only ever seems to go to the first page of a topic, exactly the same thing as goto last post links on default.asp - which is most weird . Once I have that sorted I'll post all my code changes for everyone else.
http://***.***.***.*/forums/topic.asp?whichpage=-1&TOPIC_ID=1&REPLY_ID=34
Thanks ruirib, you've been very helpful. Cheers. |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 01 March 2003 : 07:10:28
|
The fact that the jump to last post does not work may be due to one of two reasons:
1. You're using an ODBC connection string. Use an OLEDB one instead.
2. If 1 isn't true, then your server has an old MDAC. MDAC needs to be 2.5 or higher for jump to last post to work. You can download a more recent MDAC from http://www.microsoft.com/data. If you download MDAC 2.7 (which is the latest) be sure to download and install the lastes Jet service pack as well, otherwise nothing will change. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
Edited by - ruirib on 01 March 2003 07:11:39 |
|
|
Gooey
New Member
55 Posts |
Posted - 01 March 2003 : 09:25:18
|
Excellent, I changed my connection string and it worked like a charm!
Right, so if anyone else wants to do this then here are the changes I've made (bear in mind I'm not the best asp coder):
Post_info.asp
1. Right after line 981 (my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords) I've inserted the following:
dim rst
strSql = "SELECT Max(REPLY_ID) as NewReplyID "
strSql = strSql & " FROM " & strActivePrefix & "REPLY "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
strSql = strSql & " and R_AUTHOR = " & rs("MEMBER_ID")
set rst = my_Conn.Execute (strSql)
NewID = rst("NewReplyID")
set rst = nothing
2. Alter lines 1051 & 876 to include the Reply ID. Line 1051 is as below, line 876 passes across and empty string:
ProcessSubscriptions rs("MEMBER_ID"), Cat_ID, Forum_ID, Topic_ID, Moderation, NewID
inc_subscription.asp
1. Change the function definition on line 40 to accept the ReplyID:
sub ProcessSubscriptions (pMemberId, CatID, ForumId, TopicId, Moderation, NewID)
2. Line 193 needs to be changed to include the reply ID, it's now:
strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?whichpage=-1&TOPIC_ID=" & TopicId & "&REPLY_ID=" & NewID & vbNewline
And there you have it, subscription email links that go to the actual post that has been added instead of the topic in general, and my first mod! I couldn't get the @@IDENTITY thing to work, but I'm not too worried about that. Big debt to ruirib too.
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 01 March 2003 : 17:39:53
|
Gooey,
Glad you got it working. Anyhow, let me say that the query you are using now does not ensure that you're getting the correct reply id. In fact, in a multiuser environment, there is the possibility that it will now and then result in the link to last post not working due to a non-existing id for the topic. I would suggest that you try the SELECT @@IDENTITY now, that you have changed to an OLEDB driver. Probably that does not work with an ODBC driver. I cannot assure that it will, but if it won't maybe that's because your DB is an Access 97 one.
If you choose not to use SELECT @@ IDENTITY, at least change the WHERE clause to include the TOPIC_ID, instead of the FORUM_ID. I think the chances of getting a wrong reply id would diminish considerably. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Gooey
New Member
55 Posts |
Posted - 03 March 2003 : 03:46:55
|
Ok, I just tried this and now the @@Identity thing works. Strange that a connetion string can have such an effect. Anyway below is the code for step one of post_info.asp:
dim rst
set rst = my_Conn.execute("SELECT @@IDENTITY")
NewID = rst(0)
set rst = nothing
cheers ruirib |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 03 March 2003 : 06:40:29
|
No, its no that strange that the connection string had an effect on that. You see this is a SQL extension supported only by the Jet 4 engine, so it's natural that an ODBC driver wouldn't support it.
Anyway I'm glad this is finally working as it should . |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Gooey
New Member
55 Posts |
Posted - 03 March 2003 : 09:20:34
|
Just a quick alteration to the code. point 2 of inc_subscriptions.asp should be as below, otherwise new topic links don't work...
if NewID <> "" then
strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?whichpage=-1&TOPIC_ID=" & TopicId & "&REPLY_ID=" & NewID & vbNewline
else
strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?TOPIC_ID=" & TopicId & vbNewline
end if
|
|
|
mikerayjones
Starting Member
4 Posts |
Posted - 20 March 2003 : 09:59:43
|
Gooey
I've made these changes, and it's almost working perfectly! However, I have noticed that if the user follows the link from the email without already being logged in to the forum, then the link only gets them as far as the forum home page. Do you have that problem too, or have I done something wrong?
Thanks Mike. |
|
|
Gooey
New Member
55 Posts |
Posted - 27 March 2003 : 03:56:55
|
Hey there Mike (thanks for the nudge via e-mail ). Right at the top of topic.asp there is the following, which redirects you to default.asp. Unfortuantly I, or as far as I know any of my members, have had a link that failed to go to the correct post. The only thing I can think of is that it's not picking up a cookie or something and so can't log you back in. I've no idea what the Request.Form thing is, but it looks to be the centre of the problem. Does anyone else know what's going on?
if (Request.QueryString("TOPIC_ID") = "" or IsNumeric(Request.QueryString("TOPIC_ID")) = False) and Request.Form("Method_Type") <> "login" and Request.Form("Method_Type") <> "logout" then
Response.Redirect "default.asp"
Response.End
else
Topic_ID = cLng(Request.QueryString("TOPIC_ID"))
end if
|
|
|
Topic |
|