Author |
Topic  |
|
Joshua
Starting Member
31 Posts |
Posted - 20 April 2001 : 16:50:34
|
i see a lot of forums and at the bottom they say who is logged in, how can i do this?
thanks, Joshua
|
|
Joshua
Starting Member
31 Posts |
Posted - 20 April 2001 : 17:14:47
|
also is it possible to make the AIM/ICQ/yahoo thing compatible with MSN messanger? and if so, how?
thanks, Joshua
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 20 April 2001 : 17:42:35
|
For the Who's Online code: http://forum.snitz.com/forum/link.asp?TOPIC_ID=3041
On MSN Messenger, try doing a search for MSN Messenger from the Search link at the top right. I remember it was discussed, but since MSN Messenger doesn't have web-based status indicators (other than within MSN Messenger itself, or via Hotmail) or a way to send an IM without having MSN Messenger open, it's a little different than the other 3. |
 |
|
Joshua
Starting Member
31 Posts |
Posted - 20 April 2001 : 18:00:17
|
hey richard thanks for a responce, but im still unclear; Im not sure if i stated what i was wanting right, and if i did i guess i just didnt understand how to acomplish it (im from Tennessee (USA) so that should explain why im so slow )Anyways i am wanting all my visitors to see who is currently browsing the boards.
thanks, Joshua aka your daily annoyance 
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 20 April 2001 : 21:32:44
|
Instructions for adding the Add-Ons:
This first one is for if you liked the way the Who's Online Mod displayed the Members name and was like a Category of the Forum.
Just insert the Include code like this:
end if rs.MoveNext loop end if %> <!--#include file="active_users2.asp"--> <% if strShowStatistics = "1" then WriteStatistics end if %>
If you have the minimize category mod installed and you want the Who's Online part to be collapsible as well substitute active_users2b.asp as the include file above.
If you would instead like the Active Users displayed as the last line in your statistics section.
Just insert the Include code like this:
rs.MoveNext loop end if if strShowStatistics = "1" then WriteStatistics %> <!--#include file="active_users3.asp"--> <% end if %> </table> </td> |
 |
|
Joshua
Starting Member
31 Posts |
Posted - 22 April 2001 : 17:38:31
|
Thank you for a responce Richard, i downloadede and uploaded those files, then i read the readme file and thought i did what it asked, but afterwards i tried to view and i got some error, so i reuploaded the original top_inc.asp and Default.asp, so it works again, but can you tell me exactly where i need to insert "<a href="active_users.asp">Active Users</a>: <%=strOnlineMembersCount%> Members and <%=strOnlineGuestsCount%> Guests"
and
<% ' 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 %>
i guess i messed it up :)
thank you, Joshua
|
 |
|
Joshua
Starting Member
31 Posts |
Posted - 24 April 2001 : 16:39:07
|
bumpity bump bump
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 24 April 2001 : 17:02:29
|
What's the error you are getting?
|
 |
|
DarlingBri
Junior Member
 
United Kingdom
378 Posts |
Posted - 07 May 2001 : 17:09:12
|
I'm getting an error message:
quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'count(UserID) onlinecount'.
/forums/inc_top.asp, line 224
Anyone know what I'm doing wrong? 
I had inserted the code required at Line 81 of inc_top if it makes a difference...
"Bother," said Pooh, as Piglet was assimilated by the Borg.
Edited by - DarlingBri on 07 May 2001 17:10:50 |
 |
|
DarlingBri
Junior Member
 
United Kingdom
378 Posts |
Posted - 07 May 2001 : 18:35:51
|
Ugh, never mind.
Wrong thread, and a stupid error on my part.
Sorry :o)
"Bother," said Pooh, as Piglet was assimilated by the Borg. |
 |
|
|
Topic  |
|
|
|