zoomdubai
Starting Member
25 Posts |
Posted - 14 September 2002 : 07:05:47
|
Hi all, from many days in my Active_users.asp all guest/members were being shown as Unknown/Unknown, so i changed my function fUserAgent(ua) to this below.. and it worked fine for me.. !
If your active users also shows Unkown OS & Browser just replace the function and it'll work well!
function fUserAgent(ua) Dim UAgent UAgent = ua if instr(UAgent, "Opera") then if instr(UAgent, "Opera 3.") then strBrowser = "Opera 3.x" elseif instr(UAgent, "Opera 4.") then strBrowser = "Opera 4.x" elseif instr(UAgent, "Opera 5.") then strBrowser = "Opera 5.x" elseif instr(UAgent, "Opera 6.") then strBrowser = "Opera 6.x" else strBrowser = "Opera" end if elseif instr(UAgent, "MSIE") then if instr(UAgent, "MSIE 6.") then strBrowser = "Microsoft IE 6.x" elseif instr(UAgent, "MSIE 5.") then strBrowser = "Microsoft IE 5.x" elseif instr(UAgent, "MSIE 4.") then strBrowser = "Microsoft IE 4.x" elseif instr(UAgent, "MSIE 3.") then strBrowser = "Microsoft IE 3.x" if instr(UAgent, "MSIE 3.02") then strBrowser = "Microsoft IE 3.02" end if else strBrowser = "Microsoft IE" end if elseif instr(UAgent, "Mozilla") and instr(UAgent, "compatible") = 0 then if instr(UAgent, "Netscape7") then strBrowser = "Netscape 7.x" elseif instr(UAgent, "Netscape6") then strBrowser = "Netscape 6.x" elseif instr(UAgent, "Mozilla/4") then strBrowser = "Netscape Navigator 4.x" elseif instr(UAgent, "Mozilla/3") then strBrowser = "Netscape Navigator 3.x" elseif instr(UAgent, "Netscape") then strBrowser = "Netscape" else if instr(UAgent, "Mozilla/5") then strBrowser = Mid(UAgent, instr(UAgent, "rv:")+3) strBrowser = Mid(strBrowser, 1, instr(strBrowser, ")")) strBrowser = Mid(strBrowser, 1, Len(strBrowser)-1) strBrowser = "Mozilla " & strBrowser else strBrowser = "Mozilla" end if end if else strBrowser = fLang(strLangMOD_Ls3kAU_01150) end if
if instr(UAgent, "Windows 95") or instr(UAgent, "Win95") then strSystem = "Windows 95" elseif instr(UAgent, "Win 9x 4.90") then strSystem = "Windows ME" elseif instr(UAgent, "Windows 98") or instr(UAgent, "Win98") then strSystem = "Windows 98" elseif instr(UAgent, "Windows 3.1") or instr(UAgent, "Win16") then strSystem = "Windows 3.x/Windows NT 3.x" elseif instr(UAgent, "NT 5.0") or instr(UAgent, "Windows 2000") then strSystem = "Windows 2000" elseif instr(UAgent, "NT 5.1") or instr(UAgent, "Windows XP") then strSystem = "Windows XP" elseif instr(UAgent, "NT") or instr(os, "NT") then strSystem = "Windows NT" elseif instr(UAgent, "Mac") then strSystem = "Mac" if instr(UAgent, "PowerPC") or instr(UAgent, "PPC") then strSystem = "Mac PPC" elseif instr(UAgent, "68000") or instr(UAgent, "68K") then strSystem = "Mac 68K" end if elseif instr(UAgent, "Linux") then strSystem = "Linux" elseif instr(UAgent, "X11") then strSystem = "UNIX" else strSystem = fLang(strLangMOD_Ls3kAU_01150) end if fUserAgent = strSystem & "<br>" & strBrowser end function |
Edited by - zoomdubai on 14 September 2002 07:07:13 |
|