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 DEV-Group
 DEV Bug Reports (Closed)
 Infinite Loop fix ?
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ThePhoenix
Starting Member

4 Posts

Posted - 21 July 2002 :  10:11:36  Show Profile
i've tryed to fix the problem of infinite looping after posting.

In post.asp replace:
<input name="Refer" type="hidden" value="<% =Request.ServerVariables("HTTP_REFERER") %>"> 


with:

<input name="Refer" type="hidden" value="<%
if strRqMethod = "Edit" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" then
Response.write "topic.asp?TOPIC_ID=" & strRqTopicID
Elseif strRqMethod = "Topic" or _
strRqMethod = "TopicQuote" then
Response.write "forum.asp?FORUM_ID=" & strRqForumId
Else
Response.write "default.asp"
End If
%>">


There are 2 replacement in 3.3.0.x
I'm not an ace in ASP programming, so this code colud be a lot rough... pls make all the changes u belive necessary.
Bye
fenix

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 July 2002 :  10:23:00  Show Profile  Visit HuwR's Homepage

I do not have a problem with infiniate looping when I post, so is this a general problem or does it only happen under specific circumstances ?

You should be a little more specific before proposing a fix.

Go to Top of Page

ThePhoenix
Starting Member

4 Posts

Posted - 21 July 2002 :  11:30:45  Show Profile
quote:


I do not have a problem with infiniate looping when I post, so is this a general problem or does it only happen under specific circumstances ?

You should be a little more specific before proposing a fix.





ya sorry my fault. In my forum (and in a lot of other snitz forums i've seen), when u submit a post, the post_info.asp starts looping with congratulations mexs... very annoying. In this fourm i've read that other ppl have this problem... so, FOR THOSE WHO HAVE this problem, i've posted my fix. You don't have this prob? lucky u ;)

I've tryed to discover where could be the bug, and i found that nothing was written in the <input name="Refer" type="hidden" value="<% =Request.ServerVariables("HTTP_REFERER") %>"> field and post_info.asp become crazy. To avoid that, i don't call request.servervariabiles, but i build from my own the refer. This is the fix i've adopt on my forum, however, and i didn't tested it so much.
Bye
fenix

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 21 July 2002 :  17:16:59  Show Profile
That's a good fix, for those uncertain times when the HTTP_REFFERER field is empty.

«------------------------------------------------------»
What new features are going to be in the 3.4
version? See the 3.4 UnOfficial Features List !
Go to Top of Page

ThePhoenix
Starting Member

4 Posts

Posted - 26 July 2002 :  16:14:32  Show Profile
i've worked a little over this problem again, and i've tried to solve the problem of the page u were redirected. In fact, with previous patch u r redirected to the first page of a thread (even if it's a multi-page one). To solve this, u can pass the whichpage in the reply link.. but it's not so nice, imho.
So i've assembled this code, that can be used from all the snitz users. Pls check and tell me if it's all ok or if there's something that can be cut off.


if Request.ServerVariables("HTTP_REFERER") = "" OR Request.ServerVariables("HTTP_REFERER") = " " Then
if strRqMethod = "Edit" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" then


'## Forum_SQL
strSql = "SELECT " & strActivePrefix & "REPLY.REPLY_ID, " & _
strActivePrefix & "REPLY.FORUM_ID, " & _
strActivePrefix & "REPLY.TOPIC_ID, " & _
strActivePrefix & "REPLY.R_DATE " & _
" FROM " & strActivePrefix & "REPLY " & _
" WHERE TOPIC_ID = " & strRqTopicID & " "

strSql = strSql & " ORDER BY " & strActivePrefix & "REPLY.R_DATE ASC"

if strDBType = "mysql" then 'MySql specific code
'## Forum_SQL - Get the total pagecount
strSql2 = "SELECT COUNT(" & strActivePrefix & "REPLY.TOPIC_ID) AS REPLYCOUNT "
strSql2 = strSql2 & " FROM " & strMemberTablePrefix & "MEMBERS, " & strActivePrefix & "REPLY "
strSql2 = strSql2 & " WHERE TOPIC_ID = " & strRqTopicID & " "

set rsCount = my_Conn.Execute(strSql2)
if not rsCount.eof then
maxpages = (rsCount("REPLYCOUNT") \ strPageSize )
if rsCount("REPLYCOUNT") mod strPageSize <> 0 then
maxpages = maxpages + 1
end if
else
maxpages = 1
end if

rsCount.close
set rsCount = nothing

else 'end MySql specific code

set rsReplies = Server.CreateObject("ADODB.Recordset")

rsReplies.cachesize = strPageSize

rsReplies.open strSql, my_Conn, 3

If not (rsReplies.EOF or rsReplies.BOF) then '## No replies found in DB
rsReplies.movefirst
rsReplies.pagesize = strPageSize
rsReplies.absolutepage = cint(rsReplies.pagecount)
maxpages = cint(rsReplies.pagecount)
end if
end if
Response.write "topic.asp?TOPIC_ID=" & strRqTopicID & "&wichpage=" & maxpages

Elseif strRqMethod = "Topic" or _
strRqMethod = "TopicQuote" then
Response.write "forum.asp?FORUM_ID=" & strRqForumId
Else
Response.write "default.asp"
End If
Else
response.write Request.ServerVariables("HTTP_REFERER")
end If


Bye
fenix

P.S.: my forum works with access DB, i don't know if this fix works fine for mysql users!

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07