Author |
Topic |
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 22 September 2005 : 10:17:56
|
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
|
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 22 September 2005 : 10:20:57
|
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.” |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 22 September 2005 : 10:38:43
|
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.” |
|
|
net83it
Starting Member
18 Posts |
Posted - 24 September 2005 : 12:50:38
|
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! :(< |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Riccardo
New Member
86 Posts |
Posted - 24 September 2005 : 13:51:08
|
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)
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
net83it
Starting Member
18 Posts |
Posted - 25 September 2005 : 06:18:08
|
i'm using mysql< |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 26 September 2005 : 07:09:10
|
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 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 26 September 2005 : 14:15:25
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 27 September 2005 : 06:19:09
|
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.” |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 27 September 2005 : 08:22:01
|
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.” |
|
|
Topic |
|