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/Code)
 Active Users Mod - Bug and Fix
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nathan
Help Moderator

USA
7664 Posts

Posted - 24 November 2001 :  03:00:50  Show Profile  Visit Nathan's Homepage
The bug occurs spacifically when a topic name contains the vertical bar ( | ) character and possibly others.

It can be repaired by adding a chkString to forum and topic subjects being pulled from the QueryString

Big thanks to Martin at w3realm for the heads up.

The origional code (From the 3.3 version)

' LETS GET WHAT PAGE THEY ARE ON
strOnlinePathInfo = Request.ServerVariables("Path_Info")
strOnlineQueryString = Request.QueryString

iOnlinePathLen = InStrRev(strOnlinePathInfo,"/",-1)
strOnlinePageName = lcase(Right(strOnlinePathInfo,(len(strOnlinePathInfo)-iOnlinePathLen)))
strOnlineLocation = "<a href=""" & strOnlinePageName & """>"
if strOnlineQueryString <> "" then
strOnlineLocation = "<a href=""" & strOnlinePageName & "?" & strOnlineQueryString & """>"
end if
Select Case strOnlinePageName
Case "active.asp"
strOnlineLocation = strOnlineLocation & "Active Topics"
Case "members.asp"
strOnlineLocation = strOnlineLocation & "Members"
Case "search.asp"
strOnlineLocation = strOnlineLocation & "Search"
Case "events.asp"
strOnlineLocation = strOnlineLocation & "Events Calendar"
Case "faq.asp"
strOnlineLocation = strOnlineLocation & "FAQ"
Case "pm_view.asp"
strOnlineLocation = strOnlineLocation & "Private Message Inbox"
Case "pm_options.asp"
strOnlineLocation = strOnlineLocation & "Private Messages Options"
Case "privatesend.asp"
strOnlineLocation = strOnlineLocation & "Sending Private Message"
Case "active_users.asp"
strOnlineLocation = strOnlineLocation & "Active Users"
Case "guestbook.asp"
strOnlineLocation = strOnlineLocation & "GuestBook"
Case "default.asp"
strOnlineLocation = strOnlineLocation & "Forums"
Case "members.asp"
strOnlineLocation = strOnlineLocation & "Members"
Case "pop_profile.asp"
If Request.QueryString("mode") = "Display" Then
strOnlineLocation = strOnlineLocation & "Members Profile"
else
strOnlineLocation = strOnlineLocation & "Profile"
end If
Case "forum.asp"
If Request.QueryString("FORUM_ID") <> "" Then
set rst = my_conn.execute("SELECT FORUM_ID, F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Request.QueryString("FORUM_ID"))
Forum_Subject = rst("F_SUBJECT")
rst.close
set rst = nothing
strOnlineLocation = "Viewing Topics in: <a href=""link.asp?FORUM_ID=" & Request.QueryString("FORUM_ID") & """>"
end if
strOnlineLocation = strOnlineLocation & Forum_Subject
Case "topic.asp"
if Request.QueryString("ARCHIVE") = "true" Then
strOnlineLocation = strOnlineLocation & "Viewing Archived Message"
else
if Request.Querystring("TOPIC_ID") <> "" Then
set rst = my_conn.execute("SELECT TOPIC_ID, T_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & Request.Querystring("TOPIC_ID"))
Topic_Subject = rst("T_SUBJECT")
rst.close
set rst = nothing
strOnlineLocation = "Viewing Topic: <a href=""link.asp?TOPIC_ID=" & Request.QueryString("TOPIC_ID") & """>"
strOnlineLocation = strOnlineLocation & Topic_Subject
end if
end if
Case "post.asp"
if Request.QueryString("method") = "Reply" Then
strOnlineLocation = "Replying To Message: <a href=""link.asp?TOPIC_ID=" & Request.QueryString("TOPIC_ID") & """>" & Request.QueryString("Topic_Title")
elseif Request.QueryString("method") = "Topic" Then
strOnlineLocation = "Posting New Topic in: <a href=""link.asp?FORUM_ID=" & Request.QueryString("FORUM_ID") & """>" & Request.QueryString("Forum_Title")
else
strOnlineLocation = strOnlineLocation & "Unknown"
end if
Case else
strOnlineLocation = strOnlineLocation & "Unknown Page"
End Select
strOnlineLocation = strOnlineLocation & "</a>"
if lcase(instr(strOnlinePathInfo, "admin_")) > 0 Then
strOnlineLocation = "Admin Options"
end if


The Code with fix Applied

' LETS GET WHAT PAGE THEY ARE ON
strOnlinePathInfo = Request.ServerVariables("Path_Info")
strOnlineQueryString = Request.QueryString

iOnlinePathLen = InStrRev(strOnlinePathInfo,"/",-1)
strOnlinePageName = lcase(Right(strOnlinePathInfo,(len(strOnlinePathInfo)-iOnlinePathLen)))
strOnlineLocation = "<a href=""" & strOnlinePageName & """>"
if strOnlineQueryString <> "" then
strOnlineLocation = "<a href=""" & strOnlinePageName & "?" & strOnlineQueryString & """>"
end if
Select Case strOnlinePageName
Case "active.asp"
strOnlineLocation = strOnlineLocation & "Active Topics"
Case "members.asp"
strOnlineLocation = strOnlineLocation & "Members"
Case "search.asp"
strOnlineLocation = strOnlineLocation & "Search"
Case "events.asp"
strOnlineLocation = strOnlineLocation & "Events Calendar"
Case "faq.asp"
strOnlineLocation = strOnlineLocation & "FAQ"
Case "pm_view.asp"
strOnlineLocation = strOnlineLocation & "Private Message Inbox"
Case "pm_options.asp"
strOnlineLocation = strOnlineLocation & "Private Messages Options"
Case "privatesend.asp"
strOnlineLocation = strOnlineLocation & "Sending Private Message"
Case "active_users.asp"
strOnlineLocation = strOnlineLocation & "Active Users"
Case "guestbook.asp"
strOnlineLocation = strOnlineLocation & "GuestBook"
Case "default.asp"
strOnlineLocation = strOnlineLocation & "Forums"
Case "members.asp"
strOnlineLocation = strOnlineLocation & "Members"
Case "pop_profile.asp"
If Request.QueryString("mode") = "Display" Then
strOnlineLocation = strOnlineLocation & "Members Profile"
else
strOnlineLocation = strOnlineLocation & "Profile"
end If
Case "forum.asp"
If Request.QueryString("FORUM_ID") <> "" Then
set rst = my_conn.execute("SELECT FORUM_ID, F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Request.QueryString("FORUM_ID"))
Forum_Subject = rst("F_SUBJECT")
rst.close
set rst = nothing
strOnlineLocation = "Viewing Topics in: <a href=""link.asp?FORUM_ID=" & Request.QueryString("FORUM_ID") & """>"
end if
strOnlineLocation = strOnlineLocation & chkString(Forum_Subject, "urlpath")
Case "topic.asp"
if Request.QueryString("ARCHIVE") = "true" Then
strOnlineLocation = strOnlineLocation & "Viewing Archived Message"
else
if Request.Querystring("TOPIC_ID") <> "" Then
set rst = my_conn.execute("SELECT TOPIC_ID, T_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & Request.Querystring("TOPIC_ID"))
Topic_Subject = rst("T_SUBJECT")
rst.close
set rst = nothing
strOnlineLocation = "Viewing Topic: <a href=""link.asp?TOPIC_ID=" & Request.QueryString("TOPIC_ID") & """>"
strOnlineLocation = strOnlineLocation & chkString(Topic_Subject, "urlpath")
end if
end if
Case "post.asp"
if Request.QueryString("method") = "Reply" Then
strOnlineLocation = "Replying To Message: <a href=""link.asp?TOPIC_ID=" & Request.QueryString("TOPIC_ID") & """>" & chkString(Request.QueryString("Topic_Title"), "urlpath")
elseif Request.QueryString("method") = "Topic" Then
strOnlineLocation = "Posting New Topic in: <a href=""link.asp?FORUM_ID=" & Request.QueryString("FORUM_ID") & """>" & chkString(Request.QueryString("Forum_Title"), "urlpath")
else
strOnlineLocation = strOnlineLocation & "Unknown"
end if
Case else
strOnlineLocation = strOnlineLocation & "Unknown Page"
End Select
strOnlineLocation = strOnlineLocation & "</a>"
if lcase(instr(strOnlinePathInfo, "admin_")) > 0 Then
strOnlineLocation = "Admin Options"
end if


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Nathan Bales

May the God of hope fill you with all joy and peace as you trust in Him, so that you may overflow with hope by the power of the Holy Spirit.
-Romans 15:13

James
Average Member

USA
539 Posts

Posted - 25 November 2001 :  00:29:21  Show Profile  Visit James's Homepage
Applies to version 3.4 also.


Also notice a few errors in version 3.4's optional active_uses.asp file (the one for reloading).

On lines 2 and 3 it reads:


<!--#INCLUDE FILE="include/inc_functions.asp" -->
<!--#INCLUDE FILE="include/inc_top.asp" -->


it should read:


<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->



Also, on lines 60 and 61 it reads:


<img src="icons/icon_folder_open.gif" border="0" WIDTH="15" HEIGHT="15"> <a href="forumsquare.asp">Home</a><br>
<img src="icons/icon_bar.gif" border="0" WIDTH="15" HEIGHT="15"><img src="icons/icon_folder_open_topic.gif" border="0" WIDTH="15" HEIGHT="15"> <a href="active_users.asp">Active Users</a> (Last Updated <%=(ChkDate(Datetostr(Now)))&(ChkTime(Datetostr(Now)))%>)


it should read:


<img src="icon_folder_open.gif" border="0" WIDTH="15" HEIGHT="15"> <a href="default.asp">Forums</a><br>
<img src="icon_bar.gif" border="0" WIDTH="15" HEIGHT="15"><img src="icon_folder_open_topic.gif" border="0" WIDTH="15" HEIGHT="15"> <a href="active_users.asp">Active Users</a> (Last Updated <%=(ChkDate(Datetostr(Now)))&(ChkTime(Datetostr(Now)))%>)



Notice that aside from the 5 incorrect directory entires, on line 60 I also changed the forumsquare link to point back to the default.asp Forums like it should.

-

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*



Edited by - James on 25 November 2001 02:42:01
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 25 November 2001 :  03:54:33  Show Profile  Visit James's Homepage
Put it on the Mod Resource with the above fixes. Can find it as Active Users Ver. 3.4b at http://freeaspcode.net/snitz/default.asp.

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 25 November 2001 :  04:02:18  Show Profile  Visit Nathan's Homepage
Ya Beat me to it thanks

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Nathan Bales

May the God of hope fill you with all joy and peace as you trust in Him, so that you may overflow with hope by the power of the Holy Spirit.
-Romans 15:13
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07