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 | Next Page
Author Previous Topic Topic Next Topic
Page: of 16

Roger Heugen
Starting Member

Netherlands
12 Posts

Posted - 20 May 2001 :  13:14:08  Show Profile  Visit Roger Heugen's Homepage
Thanx M.U.L.E, the solution you gave worked great !!...

Roger
www.ccAcross.nl

Go to Top of Page

kjartis
New Member

Norway
94 Posts

Posted - 06 June 2001 :  18:49:31  Show Profile  Visit kjartis's Homepage
I got this error.


Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'count(UserID) onlinecount'.

/forum/inc_top.asp, line 223


I got this error after inserting the WHOS ONLINE SCRIPT in inc_top.asp
Yes I have updated it trough active_users_setup.asp but it still comes up with a error.
I dont have a clue what to do, is there someone that can help me? Pleace!

www.kjartis.com
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 06 June 2001 :  19:01:56  Show Profile
kjartis,

Look over the code again ( and feel free to post it here ), I am guessing that you pasted something incorrectly. Possibly a linebreak was added incorrectly or other such problems.



http://www.ugfl.net/forums
Go to Top of Page

kjartis
New Member

Norway
94 Posts

Posted - 06 June 2001 :  19:54:12  Show Profile  Visit kjartis's Homepage
quote:

kjartis,

Look over the code again ( and feel free to post it here ), I am guessing that you pasted something incorrectly. Possibly a linebreak was added incorrectly or other such problems.



I have tryed to paste the code everywhere in the page, but...

And I am not that familiar to asp, so I dont know if anything is wrong with the code! But I see something about SQL in the script!?! I don't use SQL, is the Active users script only compatible with SQL?

Here is the code:

<%
' 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


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

' TRY AND FIND OUT WHAT PAGE THEY ARE ON
If lcase(Right(strOnlinePathInfo, 9)) = "forum.asp" Then
strOnlineLocation = "<a href=""forum.asp?" & strOnlineQueryString & """>" & Request.QueryString("Forum_Title") & "</a>"
ElseIf lcase(Right(strOnlinePathInfo, 11)) = "default.asp" Then
strOnlineLocation = "<a href=""default.asp"">Home</a>"
ElseIf lcase(Right(strOnlinePathInfo, 9)) = "topic.asp" Then
strOnlineLocation = "Viewing Message ' <a href=""link.asp?TOPIC_ID=" & Request.QueryString("TOPIC_ID") & """>" & Request.QueryString("Topic_Title") & "</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
%>
_______________
www.kjartis.com

Edited by - kjartis on 06 June 2001 20:24:21
Go to Top of Page

Niteridr
Starting Member

22 Posts

Posted - 14 June 2001 :  17:18:55  Show Profile
I have a small problem.... I cut and pasted from the txt file and put into inc_top.asp, cut the code and put it in the default asp, ran the active_user_setup.asp. with no errors. I was logged in and it showed 0 members and 1 guest. So i viewed the Active Page and it showed Guest # 1. and my IP addy? I'm kinda new to this hehe be kind. Can anyone help with this problem?

Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 14 June 2001 :  17:23:45  Show Profile
In the script in inc_top.asp look of this


' ******************************************************
' ADD HERE WHAT YOU WANT THE PREFIX OF YOUR COOKIE TO BE
' it will either be 'strCookieURL' or 'strUniqueID'
strTempCookieType = strCookieURL
' ******************************************************


and change it to


' ******************************************************
' ADD HERE WHAT YOU WANT THE PREFIX OF YOUR COOKIE TO BE
' it will either be 'strCookieURL' or 'strUniqueID'
strTempCookieType = strUniqueID
' ******************************************************





http://www.ugfl.net/forums
Go to Top of Page

Niteridr
Starting Member

22 Posts

Posted - 14 June 2001 :  17:31:16  Show Profile
duh i should read the rest of the post before i ask a question. I found the prob didnt change this hehe.

' ******************************************************
' ADD HERE WHAT YOU WANT THE PREFIX OF YOUR COOKIE TO BE
' it will either be 'strCookieURL' or 'strUniqueID'
strTempCookieType = strUniqueID
' ******************************************************

it seems to be working now

Go to Top of Page

Niteridr
Starting Member

22 Posts

Posted - 14 June 2001 :  17:36:38  Show Profile
Thanx Big9erfan i've seen when the members showup on the deafault page is there an update to the mod that shows it there??

Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 14 June 2001 :  17:51:58  Show Profile
this is what you want

http://forum.snitz.com/forum/link.asp?TOPIC_ID=6550

http://www.ugfl.net/forums
Go to Top of Page

Niteridr
Starting Member

22 Posts

Posted - 14 June 2001 :  19:01:22  Show Profile
Thanx Big9erfan i've seen when the members showup on the deafault page is there an update to the mod that shows it there??

Go to Top of Page

Niteridr
Starting Member

22 Posts

Posted - 14 June 2001 :  19:02:21  Show Profile
sorry for the repost brower porbs hehe or should i say user probs hehe

Go to Top of Page

speedway
New Member

88 Posts

Posted - 19 June 2001 :  14:42:20  Show Profile
quote:

Ok I have updated the Active Users and this will allow you to view the users IP Address if you are logged in as an Admin or a Moderator. Please give me your feedback. If you have installed the Previous Active User Mod you will still need to run active_users_setup.asp along with replacing all code with this new code for the ip logging to work.

Brad

http://www.freeaspcode.net/active_users.zip

Brad



Sorry!
The page you are looking for is no longer available. BuddyConnections.com is a new site to meet new friends. Please signup for a FREE account now, before your name is taken.


Please Help - Where can I find the code for active user ?


Edited by - speedway on 20 June 2001 10:27:42
Go to Top of Page

sajrus
Starting Member

8 Posts

Posted - 19 June 2001 :  18:10:29  Show Profile
I HAVE PLACED THE CODE UNDER </head>
CANT GET IT TO WORK I HAVE CHANGED:
strTempCookieType = strUniqueID

Cant figure out whats wrong
I dont know if i have the right code:
PLZ someone tell me were i can find it!



Edited by - sajrus on 08 July 2001 15:44:39
Go to Top of Page

rethr
Starting Member

5 Posts

Posted - 20 June 2001 :  08:39:35  Show Profile
Syntax error
/forum/inc_top.asp, line 115
Function OnlineSQLencode(byVal strPass)

any idea?

Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 22 June 2001 :  15:53:22  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
quote:

Syntax error
/forum/inc_top.asp, line 115
Function OnlineSQLencode(byVal strPass)

any idea?





try a comma after byVal:


Function OnlineSQLencode(byVal, strPass)


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