'********************************************
'*** Rich Text Compatible Browser type *****
'********************************************
Private Function RTEenabled()
Dim strUserAgent 'Holds info on the users browser
'Get the users HTTP user agent (web browser)
strUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
'*************************************
'***** Windows Internet Explorer *****
'*************************************
'See if the user agent is IE on Winows and not Opera trying to look like IE
If InStr(1, strUserAgent, "MSIE", 1) > 0 AND
InStr(1, strUserAgent, "Win", 1) > 0 AND InStr(1, strUserAgent,
"Opera", 1) = 0 Then
'Now we know this is Windows IE we need to see if the version number is 5
If Trim(Mid(strUserAgent, CInt(inStr(1, strUserAgent, "MSIE", 1)+5), 1)) = "5" Then
RTEenabled = "winIE5"
'Now we know this is Windows IE we need to see if the version number is above 5
ElseIf
CInt(Trim(Mid(strUserAgent, CInt(inStr(1, strUserAgent, "MSIE", 1)+5),
1))) => 6 Then
RTEenabled = "winIE"
'Else the IE version is below 5 so return na
Else
RTEenabled = "false"
End If
'****************************
'***** Mozilla Firebird *****
'****************************
'See if this is a version of Mozilla Firebird that supports Rich Text Editing under it's Midas API
ElseIf inStr(1, strUserAgent, "Firebird", 1) Then
'Now we know this is Mozilla
Firebird we need to see if the version 0.6.1 or above; relase date is
above 2003/07/28
If CLng(Trim(Mid(strUserAgent,
CInt(inStr(1, strUserAgent, "Gecko/", 1)+6), 8))) => 20030728 Then
RTEenabled = "Gecko"
'Else the Mozilla Firebird version is below 1.5 so return false
Else
RTEenabled = "false"
End If
'**************************************
'***** Mozilla Seamonkey/Netscape *****
'**************************************
'See if this is a version of Mozilla/Netscape that supports Rich Text Editing under it's Midas API
ElseIf inStr(1, strUserAgent, "Gecko", 1) > 0 AND
inStr(1, strUserAgent, "Firebird", 1) = 0 AND
isNumeric(Trim(Mid(strUserAgent, CInt(inStr(1, strUserAgent, "Gecko/",
1)+6), 8))) Then
'Now we know this is
Mozilla/Netscape we need to see if the version number is above 1.3 or
above; relase date is above 2003/03/12
If CLng(Trim(Mid(strUserAgent,
CInt(inStr(1, strUserAgent, "Gecko/", 1)+6), 8))) => 20030312 Then
RTEenabled = "Gecko"
'Else the Mozilla version is below 1.3 or below 7.1 of Netscape so return false
Else
RTEenabled = "false"
End If
'***********************************
'***** Non RTE Enabled Browser *****
'***********************************
'Else this is a browser that does not support Rich Text Editing
Else
'RTEenabled - false
RTEenabled = "false"
End If
End Function
|