Author |
Topic |
dayve
Forum Moderator
USA
5820 Posts |
Posted - 14 November 2001 : 22:44:19
|
I've had several people email me asking me for the tweak I made to the active user page that shows the members operating system and web browser so decided to post it here. You must have Active Users mod installed and this code is for 3.1 SR4 but I am quite sure it is compatable with 3.3
Active Users Demo: http://dayve.d2g.com:666/forum/active_users.asp
Page Edits:
inc_top.asp (in the active users portion) Comparison Script ===========
' Browser/OS Check ua = Request.ServerVariables("HTTP_USER_AGENT") os = Request.ServerVariables("HTTP_UA_OS") If Instr(ua, "MSIE") Then If Instr(ua, "MSIE 6.") Then Browser = "Microsoft Internet Explorer 6.x" Elseif Instr(ua, "MSIE 5.") Then Browser = "Microsoft Internet Explorer 5.x" Elseif Instr(ua, "MSIE 4.") Then Browser = "Microsoft Internet Explorer 4.x" Elseif Instr(ua, "MSIE 3.") Then Browser = "Microsoft Internet Explorer 3.x" If Instr(ua, "MSIE 3.02") Then Browser = "Microsoft Internet Explorer 3.02" End If Else Browser = "Microsoft Internet Explorer" End If ElseIf Instr(ua, "Mozilla") and Instr(ua, "compatible") = 0 Then If Instr(ua, "Netscape6") Then Browser = "Netscape Navigator 6.x" Elseif Instr(ua, "Mozilla/4") Then Browser = "Netscape Navigator 4.x" Elseif Instr(ua, "Mozilla/3") Then Browser = "Netscape Navigator 3.x" Else Browser = "Netscape Navigator" End If End If
If Instr(ua, "Windows 95") or Instr(ua, "Win95") Then System = "Windows 95" Elseif Instr(ua, "Win 9x 4.90") Then System = "Windows ME" Elseif Instr(ua, "Windows 98") or Instr(ua, "Win98") Then System = "Windows 98" Elseif Instr(ua, "Windows 3.1") or Instr(os, "Win16") Then System = "Windows 3.x/Windows NT 3.x" Elseif Instr(ua, "NT 5") or Instr(oa, "NT 5") Then System = "Windows 2000" Elseif Instr(ua, "NT") or Instr(oa, "NT") Then System = "Windows NT" Elseif Instr(ua, "Mac") Then System = "Mac" If Instr(ua, "PowerPC") or Instr(ua, "PPC") Then System = "Mac PPC" Elseif Instr(ua, "68000") or Instr(ua, "68K") Then System = "Mac 68K" End If Elseif Instr(ua, "Linux") Then System = "Linux" Elseif Instr(ua, "X11") Then System = "UNIX" End If
active_users.asp (add to SQL statement) Comparison Script
strSql ="SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.M_BROWSE, " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.LastChecked, " & strTablePrefix & "ONLINE.CheckedIn, " & strTablePrefix & "ONLINE.SystemOS, " & strTablePrefix & "ONLINE.BrowserTYPE " strSql = strSql & " FROM " & strMemberTablePrefix & "ONLINE " strSql = strSql & " ORDER BY " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.CheckedIn DESC"
set variables to database values:
strSystem = rs("SystemOS") strBrowser = rs("BrowserTYPE")
display in table:
<td align="center" valign="middle" width="100" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%=strBrowser%></FONT></td> <td align="center" valign="middle" width="100" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%=strSystem%></FONT></td>
one last thing, and you'll have to forgive me for NOT created a .dbs file for use with mod_dbsetup.asp. you have to create two fields in FORUM_ONLINE:
SystemOS (text) BrowserTYPE (text)
post any questions if you need help with this. I did this kind of quickly and apologize if it appears confusing.
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 04 December 2001 13:22:10
Edited by - dayve on 04 December 2001 13:22:57 |
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 14 November 2001 : 23:16:33
|
Very nice :)
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 14 November 2001 : 23:18:38
|
This should work for the dbs file:
Browser/OS Add-On for Active Users MOD [ALTER] ONLINE ADD#SystemOS#varchar (100)#NULL# ADD#BrowserTYPE#varchar (100)#NULL# [END] |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 14 November 2001 : 23:22:51
|
or, if you have the active_users_setup.asp file, change it to look like this:
<!--#INCLUDE FILE="config.asp" --> <% set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString strSql = "DROP TABLE " & strTablePrefix & "ONLINE" on error resume next my_Conn.Execute strSql if err.number <> 0 then err.number = 0 end if strSql = "CREATE TABLE " & strTablePrefix & "ONLINE ( " strSql = strSql & "UserID varchar (100) , " strSql = strSql & "UserIP varchar (40) , " strSql = strSql & "DateCreated varchar (100) , " strSql = strSql & "LastDateChecked varchar (100) , " strSql = strSql & "CheckedIn varchar (100) , " strSql = strSql & "LastChecked varchar (100) , " strSql = strSql & "M_BROWSE memo , " strSql = strSql & "SystemOS varchar (100) , " strSql = strSql & "BrowserTYPE varchar (100) ) " Response.Write "<p>" & strSql & "</p>" my_Conn.Execute strSql response.write "<h1>Database set-up finish!!</h1>" my_Conn.Close set my_Conn = nothing Response.End %>
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 15 November 2001 : 00:41:14
|
In theory, this should work as well. . .
Elseif Instr(ua, "NT 5.1") or Instr(oa, "NT 5.1") Then System = "Windows XP"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 15 November 2001 : 00:45:59
|
It works, but you have to change Windows 2000 to NT 5.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
Edited by - Nathan on 15 November 2001 02:01:16 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 15 November 2001 : 04:54:09
|
or just make sure that this:
Elseif Instr(ua, "NT 5.1") or Instr(oa, "NT 5.1") Then System = "Windows XP"
is above this:
Elseif Instr(ua, "NT 5") or Instr(oa, "NT 5") Then System = "Windows 2000" |
|
|
BLK - Jetta
Starting Member
23 Posts |
Posted - 16 November 2001 : 12:25:54
|
Error Type: Microsoft JET Database Engine (0x80040E10) No value given for one or more required parameters. /forum/active_users.asp, line 44 ===============================================
<% set rs = Server.CreateObject("ADODB.Recordset") '## Forum_SQL strSql ="SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.M_BROWSE, " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.LastChecked, " & strTablePrefix & "ONLINE.CheckedIn, " & strTablePrefix & "ONLINE.SystemOS, " & strTablePrefix & "ONLINE.BrowserTYPE " strSql = strSql & " FROM " & strMemberTablePrefix & "ONLINE " strSql = strSql & " ORDER BY " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.CheckedIn DESC"
rs.cachesize = 20 rs.open strSql, my_Conn, 3
i = 0
================================================ Red is line 44 .... help....?
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 16 November 2001 : 12:40:27
|
sounds like the necessary added fields are not in your table... make sure they are their and is verbatim to the sql variables.
____________ dayve http://www.nineinchnailz.com/forum |
|
|
BLK - Jetta
Starting Member
23 Posts |
Posted - 16 November 2001 : 13:44:07
|
quote:
sounds like the necessary added fields are not in your table... make sure they are their and is verbatim to the sql variables.
Ugh! Broke down and created the tables manually. Having up the comparison scripts REALLY HELPS !!! Thanks!
Almost there - no more errors, its just not filling the table (maybe not filling the database) ill let you know.
|
|
|
BLK - Jetta
Starting Member
23 Posts |
Posted - 16 November 2001 : 17:39:07
|
I cannot get inc_activeusers.asp to ever fill the database. Could one of you PLEASE Email me the inc_activeusers.asp & the active_users.asp in a zip to jlowe@socal.rr.com
Thanks a million
|
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 16 November 2001 : 18:31:36
|
quote:
I cannot get inc_activeusers.asp to ever fill the database. Could one of you PLEASE Email me the inc_activeusers.asp & the active_users.asp in a zip to jlowe@socal.rr.com
Thanks a million
Neither can I. Everything else works in active users but I can not get the browser or OS going in it.. Does anyone have a version for 3.3 that works, please? Please e-mail me with it, thanks in advanced..
Regards,
Webmaster @ Classic Motorycling Australia Classic Motorcycling Australia |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 16 November 2001 : 18:58:11
|
quote:
I cannot get inc_activeusers.asp to ever fill the database. Could one of you PLEASE Email me the inc_activeusers.asp & the active_users.asp in a zip to jlowe@socal.rr.com
Thanks a million
active users file is displayed above in my earlier post (see comparison script or click here) as for inc_activeUsers.asp, I don't have one of those.
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 16 November 2001 18:58:32
Edited by - dayve on 16 November 2001 18:59:07 |
|
|
Nathan
Help Moderator
USA
7664 Posts |
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
|
Topic |
|