Author |
Topic |
MotoX
Junior Member
201 Posts |
Posted - 07 August 2001 : 13:40:00
|
Cyber: I noticed one thing, Users get an exception in inc_top when attempting to view archived topics. I added some code to get around this:
ElseIf lcase(Right(strOnlinePathInfo, 9)) = "topic.asp" Then If Request.QueryString("ARCHIVE") = "true" Then strOnlineLocation = "Viewing Archived Posts" Else ID = request.Querystring("TOPIC_ID") strSQL = "SELECT TOPIC_ID, T_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & ID set rst = my_conn.execute(strSQL) strOnlineLocation = "Viewing Message ' <a href=""topic.asp?TOPIC_ID=" & ID & """>" & rst("T_SUBJECT") & "</a> '" End If
This way if they are viewing archived posts, it just says that. No need to query on those, at least not for me. Thanks again! |
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 07 August 2001 : 16:10:53
|
thanks, but...
what's with the
ID = request.Querystring("FORUM_ID")
?
why would FORUM_ID be in the querystring???
maybe i don't understand something?
RDoGG™ |
|
|
Cyber Paladin
New Member
55 Posts |
Posted - 07 August 2001 : 22:12:24
|
Ah yes, forgot about that. Thanx.
quote:
thanks, but...
what's with the
ID = request.Querystring("FORUM_ID")
?
why would FORUM_ID be in the querystring???
maybe i don't understand something?
The FORUM_ID and TOPIC_ID are the only thing passed with the page (except for the archive). Take a loof for yourself (look at the URL when viewing this topic). It's there.
Remember... Amateurs built the Ark, but professionals built the Titanic. |
|
|
SalmanKhana
Average Member
USA
961 Posts |
Posted - 08 August 2001 : 04:48:24
|
I get this error while using it with the newest version.
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/jforum/inc_top.asp, line 56
ElseIf lcase(Right(strOnlinePathInfo, 8)) = "post.asp" Then
This is the code i Have on the top of inc_top.asp
------
<% ' WHOS ONLINE SCRIPT Dim strOnlinePathInfo, strOnlineQueryString, strOnlineLocation Dim strOnlineUser, strOnlineDate, strOnlineCheckInTime, strOnlineTimedOut Dim strOnlineUsersCount, strOnlineGuestsCount, strOnlineMembersCount Dim strOnlineGuestUserIP
' ****************************************************** ' ADD HERE WHAT YOU WANT THE PREFIX OF YOUR COOKIE TO BE ' it will either be 'strCookieURL' or 'strUniqueID' strTempCookieType = strCookieURL ' ******************************************************
Function OnlineSQLencode(byVal strPass) If not isNull(strPass) and strPass <> "" Then strPass = Replace(strPass, "%", "'%'") strPass = Replace(strPass, "'", "''") strPass = Replace(strPass, "|", "'|'") OnlineSQLencode = strPass End If End Function
Function OnlineSQLdecode(byVal strPass) If not isNull(strPass) and strPass <> "" Then strPass = Replace(strPass, "'%'", "%") strPass = Replace(strPass, "''", "'") strPass = Replace(strPass, "'|'", "|") OnlineSQLdecode = strPass End If End Function
' TRY AND FIND OUT WHAT PAGE THEY ARE ON If lcase(Right(strOnlinePathInfo, 9)) = "forum.asp" Then ID = request.Querystring("FORUM_ID") strSQL = "SELECT FORUM_ID, F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & ID set rst = my_conn.execute(strSQL) strOnlineLocation = "<a href=""forum.asp?FORUM_ID=" & ID & """>" & rst("F_SUBJECT") & "</a>" ElseIf lcase(Right(strOnlinePathInfo, 11)) = "default.asp" Then strOnlineLocation = "<a href=""default.asp"">Home</a>" ElseIf lcase(Right(strOnlinePathInfo, 9)) = "topic.asp" Then If Request.QueryString("ARCHIVE") = "true" Then strOnlineLocation = "Viewing Archived Posts" Else
ID = request.Querystring("TOPIC_ID") strSQL = "SELECT TOPIC_ID, T_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & ID set rst = my_conn.execute(strSQL) strOnlineLocation = "Viewing Message ' <a href=""topic.asp?TOPIC_ID=" & ID & """>" & rst("T_SUBJECT") & "</a> '" ElseIf lcase(Right(strOnlinePathInfo, 8)) = "post.asp" Then If Request.QueryString("method") = "Reply" Then strOnlineLocation = "Replying To Message ' <a href=""topic.asp?" & strOnlineQueryString & """>" & Request.QueryString("Topic_Title") & "</a> '" ElseIf Request.QueryString("method") = "Topic" Then strOnlineLocation = "Posting New Topic in ' <a href=""forum.asp?" & strOnlineQueryString & """>" & Request.QueryString("Forum_Title") & "</a> '" Else strOnlineLocation = "Unknown" End If ElseIf lcase(Right(strOnlinePathInfo, 10)) = "active.asp" Then strOnlineLocation = "<a href=""active.asp"">Active Topics</a>" ElseIf lcase(Right(strOnlinePathInfo, 11)) = "members.asp" Then strOnlineLocation = "<a href=""members.asp"">Members</a>" ElseIf lcase(Right(strOnlinePathInfo, 10)) = "search.asp" Then strOnlineLocation = "<a href=""search.asp"">Search</a>" ElseIf lcase(Right(strOnlinePathInfo, 7)) = "faq.asp" Then strOnlineLocation = "<a href=""faq.asp"">FAQ</a>" ElseIf lcase(Right(strOnlinePathInfo, 15)) = "pop_profile.asp" Then If Request.QueryString("mode") = "Display" Then strOnlineLocation = "<a href=""pop_profile.asp?" & strOnlineQueryString & """>Members Profile</a> '" Else strOnlineLocation = "Profile" End If ElseIf lcase(Right(strOnlinePathInfo, 11)) = "pm_view.asp" Then strOnlineLocation = "<a href=""pm_view.asp"">Private Message Inbox</a>" ElseIf lcase(Right(strOnlinePathInfo, 14)) = "pm_options.asp" Then strOnlineLocation = "<a href=""pm_view.asp"">Private Messages Options</a>" ElseIf lcase(Right(strOnlinePathInfo, 15)) = "privatesend.asp" Then strOnlineLocation = "<a href=""privatesend.asp"">Sending Private Message</a>" ElseIf lcase(Right(strOnlinePathInfo, 16)) = "active_users.asp" Then strOnlineLocation = "<a href=""active_users.asp"">Active Users</a>" Else strOnlineLocation = "Unknown Page" End If
' FIND OUT IF THEY ARE A GUEST, OR A USER if Request.Cookies(strTempCookieType & "User")("Name") = "" then strOnlineUser = "Guest" else strOnlineUser = Request.Cookies(strTempCookieType & "User")("Name") end if
strOnlineUserIP = Request.ServerVariables("REMOTE_ADDR")
' LETS ENCODE THIS INFO strOnlineUser = OnlineSQLencode(strOnlineUser) strOnlineLocation = OnlineSQLencode(strOnlineLocation)
' SET WHEN TO TIMEOUT THE USER ' DO THIS IN SECONDS strOnlineDate = DateToStr(Date) strOnlineCheckInTime = DateToStr(Now())
strOnlineTimedOut = strOnlineCheckInTime - 660 'time out the user after 11 minutes ( 660 seconds )
Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = strConnString objConn.Open
strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked" strSql = strSql & " FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "' AND " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "'" set rsWho = my_Conn.Execute (strSql)
if rsWho.eof or rsWho.bof then ' THEY ARE A NEW USER SO INSERT THERE USERNAME on error resume next Set objRS2 = Server.CreateObject("ADODB.Recordset") strSQL = "INSERT INTO " & strTablePrefix & "ONLINE (UserID,UserIP,DateCreated,CheckedIn,LastChecked,M_BROWSE) VALUES ('" strSql = strSQL & strOnlineUser & "','" & strOnlineUserIP & "','" & strOnlineDate & "','" & strOnlineCheckInTime & "','" & strOnlineCheckInTime & "','" & strOnlineLocation & "')" my_Conn.Execute (strSql) if err.number <> 0 then response.write err.number & "|" & err.description else ' THEY ARE A ACTIVE USER strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked" strSql = strSql & " FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP = '" & strOnlineUserIP & "'" set rsLastChecked = my_Conn.Execute (strSql)
' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'" my_Conn.Execute (strSql) end if
' LETS DELETE ALL INACTIVE USERS SQL = "DELETE FROM " & strTablePrefix & "ONLINE WHERE LastChecked < '" & strOnlineTimedOut & "'" objConn.Execute SQL
set rsOnline = Server.CreateObject("ADODB.Recordset")
if strDBType = "access" then strSqL = "SELECT count(UserID) AS [onlinecount] " else strSqL = "SELECT count(UserID) onlinecount " end if
strSql = strSql & "FROM " & strTablePrefix & "ONLINE " Set rsOnline = my_Conn.Execute(strSql) onlinecount = rsOnline("onlinecount") strOnlineUsersCount = rsOnline("onlinecount")
' Get Guest count for display on Default.asp set rsGuests = Server.CreateObject("ADODB.Recordset") if strDBType = "access" then strSqL = "SELECT count(UserID) AS [Guests] " else strSqL = "SELECT count(UserID) Guests " end if strSql = strSql & "FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE Right(UserID, 5) = 'Guest' "
Set rsGuests = my_Conn.Execute(strSql) Guests = rsGuests("Guests") strOnlineGuestsCount = rsGuests("Guests")
' Get Member count for display on Default.asp set rsGuests = Server.CreateObject("ADODB.Recordset") if strDBType = "access" then strSqL = "SELECT count(UserID) AS [Members] " else strSqL = "SELECT count(UserID) Members " end if strSql = strSql & "FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE Right(UserID, 5) <> 'Guest' "
Set rsMembers = my_Conn.Execute(strSql) Members = rsMembers("Members") strOnlineMembersCount = rsMembers("Members")
' END WHOS ONLINE SCRIPT %>
----- Help me out please
|
|
|
Belrich
Starting Member
USA
10 Posts |
Posted - 08 August 2001 : 06:46:43
|
OK. I am trying to finish up this mod, to complete my forum, and I am running into the following error.
quote: ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
/forum/active_users2.asp, line 40
It is also, the same problem, Taos and helio are having.
quote: Line 127: rs.absolutepage = mypage
If I missed the fix, sorry, but I searched a few times and am ripping my hair out now. Any help would be appreciated.
|
|
|
MotoX
Junior Member
201 Posts |
Posted - 08 August 2001 : 08:05:43
|
Salman, You are just missing an End If after that subset of code. Compare yours with the one above... |
|
|
cHeMiCaL-X
Starting Member
10 Posts |
Posted - 08 August 2001 : 08:46:35
|
I get this problem
|
|
|
rethr
Starting Member
5 Posts |
Posted - 08 August 2001 : 13:48:19
|
How am i gonna add like "My Forum" to show on the active users when they are on that page, it's not working with just adding the the code below...
ElseIf lcase(Right(strOnlinePathInfo, 16)) = "active_users.asp" Then strOnlineLocation = "<a href=""active_users.asp"">Aktive Users</a>"
ElseIf lcase(Right(strOnlinePathInfo, 10)) = "my.asp" Then strOnlineLocation = "<a href=""my.asp"">My Forum</a>" Else strOnlineLocation = "Unknown"
|
|
|
MotoX
Junior Member
201 Posts |
Posted - 08 August 2001 : 13:58:07
|
it doesn't work because my.asp isn't 10 characters. try this:
ElseIf lcase(Right(strOnlinePathInfo, 6)) = "my.asp" Then strOnlineLocation = "<a href=""my.asp"">My Forum</a>"
|
|
|
rethr
Starting Member
5 Posts |
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 08 August 2001 : 15:46:01
|
Try counting off from the left side to show pages outside the forum. See the change in red.
ElseIf lcase(left(strOnlinePathInfo, 19)) = "whatever.asp" Then strOnlineLocation = "<a href=""whatever.asp"">Whatever</a>"
http://www.abc.com/ = 19 spaces to count off
@tomic
|
|
|
Freeman II
Junior Member
232 Posts |
Posted - 09 August 2001 : 13:27:15
|
does anyone know what the column LastDateChecked in FORUM_ONLINE is used for?
|
|
|
Adul
Starting Member
37 Posts |
Posted - 14 August 2001 : 18:49:06
|
Cant find a working link for active users...
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
|
Martin Lauridsen
Starting Member
Denmark
3 Posts |
Posted - 15 August 2001 : 07:39:39
|
I get this message when i try to see the users stats. I use MySql but i can see the install is gouing great. I can see the on default.asp that its standing 3 Guest but i know the 2 of them are logged in, why this ?
I use v3.1 i cant upgrade to v3.3x becaus i have translated the forum to Danish and if i upgrade i have to do it all over again, so i hope you can help me here.
ADODB.Recordset error '800a0cb3' Object or provider is not capable of performing requested operation.
/forum/active_users.asp, line 127
|
|
|
Topic |
|