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)
 MOD Tweak: Active Users (OS/Browser type)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 4

dayve
Forum Moderator

USA
5820 Posts

Posted - 14 November 2001 :  22:44:19  Show Profile  Visit dayve's Homepage
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  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 14 November 2001 :  23:18:38  Show Profile
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]
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 14 November 2001 :  23:22:51  Show Profile
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
%>

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 14 November 2001 :  23:52:18  Show Profile  Visit dayve's Homepage
thanks Richard.

____________
dayve
http://www.nineinchnailz.com/forum
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 15 November 2001 :  00:41:14  Show Profile  Visit Nathan's Homepage
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
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 15 November 2001 :  00:45:59  Show Profile  Visit Nathan's Homepage
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
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 15 November 2001 :  04:54:09  Show Profile
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"
Go to Top of Page

BLK - Jetta
Starting Member

23 Posts

Posted - 16 November 2001 :  12:25:54  Show Profile
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....?

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 16 November 2001 :  12:40:27  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

BLK - Jetta
Starting Member

23 Posts

Posted - 16 November 2001 :  13:44:07  Show Profile
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.

Go to Top of Page

BLK - Jetta
Starting Member

23 Posts

Posted - 16 November 2001 :  17:39:07  Show Profile
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

Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 16 November 2001 :  18:31:36  Show Profile
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
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 16 November 2001 :  18:58:11  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 16 November 2001 :  19:40:12  Show Profile  Visit Nathan's Homepage
Here

http://www.ls3k.com/stuff/snitzMods/Active%20Users%20OS%20Mod%20Files%203.3.zip

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 17 November 2001 :  04:09:49  Show Profile
quote:

Here

http://www.ls3k.com/stuff/snitzMods/Active%20Users%20OS%20Mod%20Files%203.3.zip




Nathan,

Thanks for the code, worked a treat.. Just got the extra add-on of idle time working with it as well.. Once again thanks.

Dayve,

Great mod by the way.

Regards,

Webmaster @ Classic Motorycling Australia
Classic Motorcycling Australia

Edited by - Classicmotorcycling on 17 November 2001 04:11:34
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
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.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07