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 Updated With Ip Viewing for Admin's
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 16

MotoX
Junior Member

201 Posts

Posted - 07 August 2001 :  13:40:00  Show Profile
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!
Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 07 August 2001 :  16:10:53  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
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™
Go to Top of Page

Cyber Paladin
New Member

55 Posts

Posted - 07 August 2001 :  22:12:24  Show Profile  Visit Cyber Paladin's Homepage
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.
Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 08 August 2001 :  04:48:24  Show Profile
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

Go to Top of Page

Belrich
Starting Member

USA
10 Posts

Posted - 08 August 2001 :  06:46:43  Show Profile  Send Belrich an AOL message  Send Belrich an ICQ Message
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.


Go to Top of Page

MotoX
Junior Member

201 Posts

Posted - 08 August 2001 :  08:05:43  Show Profile
Salman,
You are just missing an End If after that subset of code.
Compare yours with the one above...
Go to Top of Page

cHeMiCaL-X
Starting Member

10 Posts

Posted - 08 August 2001 :  08:46:35  Show Profile  Visit cHeMiCaL-X's Homepage
I get this problem

Go to Top of Page

rethr
Starting Member

5 Posts

Posted - 08 August 2001 :  13:48:19  Show Profile
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"

Go to Top of Page

MotoX
Junior Member

201 Posts

Posted - 08 August 2001 :  13:58:07  Show Profile
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>"


Go to Top of Page

rethr
Starting Member

5 Posts

Posted - 08 August 2001 :  14:27:18  Show Profile
Thanx , it worked...one more question, is that possible to show if somebody outside the forum folder (http://www.abc.com/abc.asp not http://www.abc.com/forum/abc.asp ..i have tried full url but it didnt work...

Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 08 August 2001 :  15:46:01  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
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

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 09 August 2001 :  13:27:15  Show Profile
does anyone know what the column LastDateChecked in FORUM_ONLINE is used for?

Go to Top of Page

Adul
Starting Member

37 Posts

Posted - 14 August 2001 :  18:49:06  Show Profile  Visit Adul's Homepage  Send Adul an AOL message  Send Adul an ICQ Message
Cant find a working link for active users...

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 14 August 2001 :  21:26:21  Show Profile
Try here: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=14647
Go to Top of Page

Martin Lauridsen
Starting Member

Denmark
3 Posts

Posted - 15 August 2001 :  07:39:39  Show Profile  Visit Martin Lauridsen's Homepage
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


Go to Top of Page
Page: of 16 Previous Topic Topic Next Topic  
Previous Page
 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 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07