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)
 Jump to Last Post Permalink
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 5

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 08 March 2006 :  06:32:04  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
It's your work Shaggy. Looks good and we could use it to spare some provider related problems. Well done .<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  06:15:12  Show Profile  Reply with Quote
It doesn't look like it's going to be possible to grab the last edited post using the existing query But I have made a couple of small changes to remove the unnecessary duplication of a couple of lines and to include a check to see if the value of the REPLY_ID variable passed through the querystring is numeric:
if mypage=-1 then
	strSql="SELECT REPLY_ID  FROM "&strActivePrefix&"REPLY WHERE TOPIC_ID="&Topic_ID
	if AdminAllowed=0 then
		strSql=strSql&" AND (R_STATUS<"
		if Moderation="Y" then strSql=strSql&"2" else strSql=strSql&"3"
		strSql=strSql&" OR R_AUTHOR="&MemberID&")"
	end if
	strSql=strSql&" ORDER BY R_DATE ASC"
	set rsReplies=server.createobject("ADODB.Recordset")
	rsReplies.open strSql,my_Conn,adOpenStatic,adLockReadOnly,adCmdText
	if not rsReplies.eof then
		arrReplyData=rsReplies.getrows(adGetRowsRest)
		iReplyCount=ubound(arrReplyData,2)
		Reply_ID=trim(chkString(request.querystring("REPLY_ID"),"sqlstring"))
		if len(Reply_ID)>0 and isnumeric(Reply_ID) then
			LastPostReplyID=clng(Reply_ID)
			for iReply=0 to iReplyCount
				intReplyID=arrReplyData(0,iReply)
				if LastPostReplyID=intReplyID then
					intPageNumber=((iReply+1)\strPageSize)
					exit for
				end if
			next
		else
			LastPostReplyID=clng(arrReplyData(0,iReplyCount))
			intPageNumber=((iReplyCount+1)\strPageSize)
		end if
		if intPageNumber>clng(intPageNumber) then intPageNumber=clng(intPageNumber)+1
		strwhichpage="whichpage="&intPageNumber&"&"
	else
		strWhichpage=""
	end if
	rsReplies.close
	set rsReplies=nothing
	my_Conn.close
	set my_Conn=nothing
	response.redirect "topic.asp?"&ArchiveLink&strwhichpage&"TOPIC_ID="&Topic_ID&SearchLink&"&#"&LastPostReplyID
	response.end
end if
<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 09 March 2006 06:56:04
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  06:26:04  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
I get an error on this line of that last code:
response.redirect "topic.asp?"&ArchiveLink&strwhichpage&"TOPIC_ID="&Topic_ID&SearchLink"#"&LastPostReplyID

Kompileringsfel i Microsoft VBScript fel '800a0401'

**** på programsats förväntas.

/topic.asp, line 350

response.redirect "topic.asp?"&ArchiveLink&strwhichpage&"TOPIC_ID="&Topic_ID&SearchLink"#"&LastPostReplyID

<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  06:29:48  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
LOL!!
the word "end" in swedish is causing trouble with the badword filter =)
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  06:45:24  Show Profile  Reply with Quote
Well, for starters, the bloody & went for a walk again, thanks to the forum filtering out &#.

Secondly, can you translate that error into English for us?

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  06:52:37  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
I suppose this is the correct translation:

Microsoft VBScript compilation error '800a0401'
Expected end of statement

Where should I put the & ? =)
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  06:57:42  Show Profile  Reply with Quote
Another & went walkabout in Rui's last posting of the code which I've added back in; just copy the updated redirect line from my last posting of it and all should be well.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  07:03:35  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
ah, there you go =) No errors!
But I see no link even though the option is selected in admin options. Where should it be located on the topic.asp page?
=)
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  07:17:14  Show Profile  Reply with Quote
It shouldn't be; if you read through this topic, you'll see that this is just a modification to the existing script that will allow you to jump to the last posted reply in a topic with th need to pass the REPLY_ID through the querystring.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  07:21:08  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
Ah, that's right.. I saw that yesterday! My day haven't been that good to me so far =)

But isn't there a button also?
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  07:22:25  Show Profile  Reply with Quote
No - what button?

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  08:08:23  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
A button where you can jump to the last post after opening the thread in topic.asp =)
In admin options, under Feature Configuration I have a on/off-switch for "Show Jump To Last Post Link"...
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 09 March 2006 :  08:15:05  Show Profile  Reply with Quote
There is no such button on topic.asp, unless you have it modded in, and this modification does not add one.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 09 March 2006 :  08:27:52  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
hehe, I'm using SHN version. Maybe it's from there. I thought it was basecode.
Now when that is cleared you can take a look at my latest thread ;)
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 13 September 2006 :  12:18:55  Show Profile  Reply with Quote
Here's the final version of this code that was included in Snitz v3.4.06, released today:
if mypage=-1 then
	strSql="SELECT REPLY_ID  FROM "&strActivePrefix&"REPLY WHERE TOPIC_ID="&Topic_ID
	if AdminAllowed=0 then
		strSql=strSql&" AND (R_STATUS<"
		if Moderation="Y" then strSql=strSql&"2" else strSql=strSql&"3"
		strSql=strSql&" OR R_AUTHOR="&MemberID&")"
	end if
	strSql=strSql&" ORDER BY R_DATE ASC"
	set rsReplies=server.createobject("ADODB.Recordset")
	if strDBType="mysql" then rsReplies.open strSql,my_Conn,adOpenForwardOnly,adLockReadOnly,adCmdText else rsReplies.open strSql,my_Conn,adOpenStatic,adLockReadOnly,adCmdText
	if not rsReplies.eof then
		arrReplyData=rsReplies.getrows(adGetRowsRest)
		iReplyCount=ubound(arrReplyData,2)
		Reply_ID=trim(chkString(request.querystring("REPLY_ID"),"sqlstring"))
		if len(Reply_ID)>0 and isnumeric(Reply_ID) then
			LastPostReplyID=clng(Reply_ID)
			for iReply=0 to iReplyCount
				intReplyID=arrReplyData(0,iReply)
				if LastPostReplyID=intReplyID then
					intPageNumber=((iReply+1)/strPageSize)
					exit for
				end if
			next
		else
			LastPostReplyID=clng(arrReplyData(0,iReplyCount))
			intPageNumber=((iReplyCount+1)/strPageSize)
		end if
		if intPageNumber>clng(intPageNumber) then intPageNumber=clng(intPageNumber)+1
		strwhichpage="whichpage="&intPageNumber&"&"
	else
		strWhichpage=""
	end if
	rsReplies.close
	set rsReplies=nothing
	my_Conn.close
	set my_Conn=nothing
	response.redirect "topic.asp?"&ArchiveLink&strwhichpage&"TOPIC_ID="&Topic_ID&SearchLink&"&#"&LastPostReplyID
	response.end
end if
<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07