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

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 22 September 2005 :  10:17:56  Show Profile  Reply with Quote
quote:
Originally posted by Shaggy

Ay, but my script doesn't use any additional queries, it works off the existing query in topic.asp that's used to determine the page number.



Ay, good job then! <

Support Snitz Forums
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 September 2005 :  10:20:57  Show Profile  Reply with Quote
Although, I seem to remember someone once telling me that jumping around recordsets using the likes of movefirst and movelast isn't exactly an ideal way to work so there may be room for improvement there.

Does anyone have a clean version of Snitz running of MSSQL or MySQL that they could test this on to be sure it works?

<

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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 September 2005 :  10:36:36  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
I can give it a try later on. I always have several Snitz versions installed locally, and now I even have MySQL installed as well...<


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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 September 2005 :  10:38:43  Show Profile  Reply with Quote
Thanks, Rui

Really must get a couple of test forums up & running meself now that I can do so on the new server.

<

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

net83it
Starting Member

18 Posts

Posted - 24 September 2005 :  12:50:38  Show Profile  Visit net83it's Homepage  Reply with Quote
quote:
Originally posted by Riccardo

yes you can..it a test forum in italian. the firts row is black 'cause i was testing a css style.
links removed by ruirib at user's request


i get always the default.asp page when i click the last reply arrow.

see the difference
links removed by ruirib at user's request
i also tested the script on my 3.4.03 and i get the same error!

so it seems it doesn't work! :(<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 September 2005 :  13:39:56  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
net83bit, you need to be running an OLEDB driver for the jump to work. What is your current connection string (remove username/password if that is the case)?<


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

Riccardo
New Member

86 Posts

Posted - 24 September 2005 :  13:51:08  Show Profile  Reply with Quote
My forum isn't a test one..
Ruy please delete all links to my forum from this topic..thanks<

http://www.peperonciniamoci.it
peppers and peppers and peppers (working on an international version)

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 September 2005 :  16:21:14  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Links deleted.<


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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 September 2005 :  16:52:37  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Shaggy, this didn't work with SQL Server. A redirect to default.asp occurs. Normal topic.asp works without a hitch.<


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

net83it
Starting Member

18 Posts

Posted - 25 September 2005 :  06:18:08  Show Profile  Visit net83it's Homepage  Reply with Quote
i'm using mysql<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 26 September 2005 :  07:09:10  Show Profile  Reply with Quote
Hmm ... Don't see why it wouldn't work with SQL Server if it works with Access. Can you check which of the redirects is being executed?

Also, was thinking about improvements to this over the weekend and got to wondering why Access and MSSQL don't use the same code as MySQL for determining the page number so I came up with this:
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)
		if len(request.querystring("REPLY_ID"))>0 then
			LastPostReplyID=clng(request.querystring("REPLY_ID"))
			for iReply=0 to iReplyCount
				intReplyID=arrReplyData(0,iReply)
				if LastPostReplyID=intReplyID then
					intPageNumber=((iReply+1)/strPageSize)
					if intPageNumber>clng(intPageNumber) then intPageNumber=clng(intPageNumber)+1
					strwhichpage="whichpage="&intPageNumber&"&"
					exit for
				end if
			next
		else
			LastPostReplyID=arrReplyData(0,iReplyCount)
			intPageNumber=((iReplyCount+1)/strPageSize)
			if intPageNumber>clng(intPageNumber) then intPageNumber=clng(intPageNumber)+1
			strwhichpage="whichpage="&intPageNumber&"&"
		end if
	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
Note that I've also added ArchiveLink to the redirect URI to save an additional redirect on archived topics. And I've added the SerachLink too which will also require the search terms to be added to the querystring of the last post link in search results.

<

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 27 September 2005 06:13:05
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 September 2005 :  14:15:25  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Shaggy,

The code has several problems. First, near the beginning, where you have

if AdminAllowed=0 then
		strSql=strSql&" AND (R_STATUS<"
		if Moderation="Y" then strSql=strSql&"2" else strSql3=strSql3&"3"
		strSql=strSql&" OR R_AUTHOR="&MemberID&")"

the part in red should be strSql and not strsql3

Second, in my test forum, the redirect link is coming out like this:

topic.asp?whichpage=3.66666666666667&TOPIC_ID=1#11
<


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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 27 September 2005 :  06:19:09  Show Profile  Reply with Quote
Thanks, Rui; spotted the strSql3s when I got home yesterday but was just on a flying visit and didn't have time to edit.

Second problem's an odd one though as I didn't actually make any changes to the way intPageNumber is calcualted other than to use iReplyCount instead of iReply when there's no REPLY_ID in the querystring. Can you try changing:

intPageNumber=((iReply+1)/strPageSize)

To:

intPageNumber=(iReply\strPageSize)+1

And:

intPageNumber=((iReplyCount+1)/strPageSize)

To:

intPageNumber=(iReplyCount\strPageSize)+1

And see if it makes any difference?

<

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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 27 September 2005 :  08:14:40  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
I'll do this from home, when I get there.<


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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 27 September 2005 :  08:22:01  Show Profile  Reply with Quote
Thanks, man

<

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